[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-12-04 Thread Aron Budea (via logerrit)
 sc/source/ui/docshell/docfunc.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 67cdcf1ab2d2977fa79f9ecd7935ad8f3a8b4377
Author: Aron Budea 
AuthorDate: Sun Dec 3 19:33:28 2023 +1030
Commit: Caolán McNamara 
CommitDate: Mon Dec 4 20:11:49 2023 +0100

sc SetLayoutRTL: Only call PostPaint for current tab

...instead of the usual 0-, a layout change of the current
sheet should have no effect on others.

Change-Id: I5a9a2da78daf1fab06da939574c0e8a027533fcd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160254
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/ui/docshell/docfunc.cxx 
b/sc/source/ui/docshell/docfunc.cxx
index be844634ea25..12ff9a0f9908 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -3485,7 +3485,7 @@ bool ScDocFunc::SetLayoutRTL( SCTAB nTab, bool bRTL )
 rDocShell.GetUndoManager()->AddUndoAction( 
std::make_unique( , nTab, bRTL ) );
 }
 
-rDocShell.PostPaint( 0,0,0,rDoc.MaxCol(),rDoc.MaxRow(),MAXTAB, 
PaintPartFlags::All );
+rDocShell.PostPaint( 0,0,nTab,rDoc.MaxCol(),rDoc.MaxRow(),nTab, 
PaintPartFlags::All );
 aModificator.SetDocumentModified();
 
 SfxBindings* pBindings = rDocShell.GetViewBindings();


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-12-04 Thread Aron Budea (via logerrit)
 sc/source/ui/docshell/docsh3.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 4d30910523bccb3b965f254401e6341af2ee8704
Author: Aron Budea 
AuthorDate: Sun Dec 3 19:22:17 2023 +1030
Commit: Caolán McNamara 
CommitDate: Mon Dec 4 20:09:29 2023 +0100

lok: Notify all tabs in the range

34d5abf464dfbf4bdc36f6b87e606c84a1f4d99d restricted this to the
first tab, but PostPaint(...) is sometimes called with a
0.. tab range, even if the change only affected somewhere
in between.

In addition, restrict range end to the last actual tab in the
spreadsheet.

Change-Id: I44a7bb351e17bf85b13fedfe2a9f3d76543c4372
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160253
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index 8b24cf81d727..0e2efa7f09fc 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -110,12 +110,13 @@ void ScDocShell::PostPaint( const ScRangeList& rRanges, 
PaintPartFlags nPart, sa
 {
 ScRangeList aPaintRanges;
 std::set aTabsInvalidated;
+const SCTAB nMaxTab = m_pDocument->GetTableCount() - 1;
 for (size_t i = 0, n = rRanges.size(); i < n; ++i)
 {
 const ScRange& rRange = rRanges[i];
 SCCOL nCol1 = rRange.aStart.Col(), nCol2 = rRange.aEnd.Col();
 SCROW nRow1 = rRange.aStart.Row(), nRow2 = rRange.aEnd.Row();
-SCTAB nTab1 = rRange.aStart.Tab(), nTab2 = rRange.aEnd.Tab();
+SCTAB nTab1 = rRange.aStart.Tab(), nTab2 = std::min(nMaxTab, 
rRange.aEnd.Tab());
 
 if (!m_pDocument->ValidCol(nCol1)) nCol1 = m_pDocument->MaxCol();
 if (!m_pDocument->ValidRow(nRow1)) nRow1 = m_pDocument->MaxRow();
@@ -168,7 +169,8 @@ void ScDocShell::PostPaint( const ScRangeList& rRanges, 
PaintPartFlags nPart, sa
 }
 }
 aPaintRanges.push_back(ScRange(nCol1, nRow1, nTab1, nCol2, nRow2, 
nTab2));
-aTabsInvalidated.insert(nTab1);
+for (auto nTabNum = nTab1; nTabNum <= nTab2; ++nTabNum)
+aTabsInvalidated.insert(nTabNum);
 }
 
 Broadcast(ScPaintHint(aPaintRanges.Combine(), nPart));


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-12-03 Thread Darshan11 (via logerrit)
 sc/source/ui/cctrl/checklistmenu.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 5788f736578dc22bc9bcd46a6e75233237b82af2
Author: Darshan11 
AuthorDate: Wed Nov 29 17:02:44 2023 +0530
Commit: Szymon Kłos 
CommitDate: Sun Dec 3 19:17:46 2023 +0100

Disable Select/Unselect-current Filter Checkboxes in Calc

Change-Id: I99a3d78bfbb65e751328452d7405d7844f810dd9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160082
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/sc/source/ui/cctrl/checklistmenu.cxx 
b/sc/source/ui/cctrl/checklistmenu.cxx
index a913bcfe55ef..1cb1565ab482 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -619,6 +619,11 @@ 
ScCheckListMenuControl::ScCheckListMenuControl(weld::Widget* pParent, ScViewData
 // bulk_insert_for_each
 mxTreeChecks->set_size_request(mnCheckWidthReq, nChecksHeight);
 mxListChecks->set_size_request(mnCheckWidthReq, nChecksHeight);
+if (comphelper::LibreOfficeKit::isActive())
+{
+mxBtnSelectSingle->hide();
+mxBtnUnselectSingle->hide();
+}
 }
 
 void ScCheckListMenuControl::GrabFocus()


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-11-28 Thread Szymon Kłos (via logerrit)
 sc/source/core/tool/webservicelink.cxx   |8 
 sc/source/ui/docshell/externalrefmgr.cxx |6 ++
 2 files changed, 14 insertions(+)

New commits:
commit 42109bda9972738b6e7a4448127458c7d24be4dc
Author: Szymon Kłos 
AuthorDate: Mon Nov 27 09:56:27 2023 +0100
Commit: Szymon Kłos 
CommitDate: Tue Nov 28 11:20:45 2023 +0100

lok: Block requests to load external references

- currently in LOK case we don't open multiple files in
  one "environment"
- currently it opens import dialog which is synchronous - and that
  blocks whole app

Change-Id: I11c2c7f602ecf1e29b3d6fb2930ce873749bc2ef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159984
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/sc/source/core/tool/webservicelink.cxx 
b/sc/source/core/tool/webservicelink.cxx
index b61907471e54..156048430636 100644
--- a/sc/source/core/tool/webservicelink.cxx
+++ b/sc/source/core/tool/webservicelink.cxx
@@ -7,6 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -36,6 +37,13 @@ sfx2::SvBaseLink::UpdateResult 
ScWebServiceLink::DataChanged(const OUString&, co
 aResult.clear();
 bHasResult = false;
 
+if (comphelper::LibreOfficeKit::isActive())
+{
+SAL_WARN("sc.ui", "ScWebServiceLink::DataChanged: blocked access to 
external file: \""
+  << aURL << "\"");
+return ERROR_GENERAL;
+}
+
 css::uno::Reference xFileAccess
 = 
css::ucb::SimpleFileAccess::create(comphelper::getProcessComponentContext());
 if (!xFileAccess.is())
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx 
b/sc/source/ui/docshell/externalrefmgr.cxx
index 0653d4609aee..0b8215cd3edc 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -2537,6 +2537,12 @@ SfxObjectShellRef 
ScExternalRefManager::loadSrcDocument(sal_uInt16 nFileId, OUSt
 if (!isFileLoadable(aFile))
 return nullptr;
 
+if (comphelper::LibreOfficeKit::isActive())
+{
+SAL_WARN( "sc.ui", "ScExternalRefManager::loadSrcDocument: blocked 
access to external file: \"" << aFile << "\"");
+return nullptr;
+}
+
 OUString aOptions = pFileData->maFilterOptions;
 if ( !pFileData->maFilterName.isEmpty() )
 rFilter = pFileData->maFilterName;  // don't overwrite stored 
filter with guessed filter


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-11-27 Thread Caolán McNamara (via logerrit)
 sc/source/core/tool/viewopti.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit c2d44cb8544fdc696b271e2c1920c6ef5d5770cf
Author: Caolán McNamara 
AuthorDate: Mon Nov 27 14:38:19 2023 +
Commit: Miklos Vajna 
CommitDate: Tue Nov 28 08:26:23 2023 +0100

ScViewOptions::operator== doesn't compare sColorSchemeName

Change-Id: I21e6630deb9a5329092c88651e4ba0a3715ce616
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159998
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sc/source/core/tool/viewopti.cxx b/sc/source/core/tool/viewopti.cxx
index 46f3d13227e8..849d15d2412e 100644
--- a/sc/source/core/tool/viewopti.cxx
+++ b/sc/source/core/tool/viewopti.cxx
@@ -140,6 +140,7 @@ bool ScViewOptions::operator==( const ScViewOptions& rOpt ) 
const
 bEqual = bEqual && (aGridCol   == rOpt.aGridCol);
 bEqual = bEqual && (aGridColName   == rOpt.aGridColName);
 bEqual = bEqual && (aGridOpt   == rOpt.aGridOpt);
+bEqual = bEqual && (sColorSchemeName == rOpt.sColorSchemeName);
 bEqual = bEqual && (aDocCol== rOpt.aDocCol);
 
 return bEqual;


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-11-22 Thread offtkp (via logerrit)
 sc/source/ui/app/inputhdl.cxx |   12 
 1 file changed, 12 insertions(+)

New commits:
commit 1482ae614645599bebedec7c0467333bd324
Author: offtkp 
AuthorDate: Wed Nov 22 17:00:53 2023 +0200
Commit: Paris Oplopoios 
CommitDate: Wed Nov 22 17:05:46 2023 +0100

sc: Enable text wrapping when inputting line breaks in cell

In Excel, when typing new lines in a cell or pasting text with new lines
and then clicking out of the cell, wrap text is enabled, which actually
shows the contents on the new line instead of on the same line

Change-Id: I113aceab33380a5deb536f57969c3fc90825146b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159821
Tested-by: Paris Oplopoios 
Reviewed-by: Paris Oplopoios 

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 7aa1ebf218be..1153a7dc03d4 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -47,6 +47,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -3144,6 +3145,17 @@ void ScInputHandler::EnterHandler( ScEnterMode 
nBlockMode, bool bBeforeSavingInL
 lcl_RemoveTabs(aString);
 lcl_RemoveTabs(aPreAutoCorrectString);
 
+if (aString.indexOf('\n') != -1)
+{
+// Cell contains line breaks, enable wrapping
+ScLineBreakCell aBreakItem(true);
+pActiveViewSh->ApplyAttr(aBreakItem);
+
+SfxViewFrame* pViewFrm = SfxViewFrame::Current();
+if (pViewFrm)
+pViewFrm->GetBindings().Invalidate(SID_ATTR_ALIGN_LINEBREAK);
+}
+
 // Test if valid (always with simple string)
 if (bModified && nValidation && pActiveViewSh)
 {


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-11-18 Thread Michael Meeks (via logerrit)
 sc/source/ui/inc/viewfunc.hxx  |3 -
 sc/source/ui/undo/undoblk3.cxx |3 -
 sc/source/ui/view/cellsh3.cxx  |8 ---
 sc/source/ui/view/viewfun2.cxx |   96 +++--
 4 files changed, 60 insertions(+), 50 deletions(-)

New commits:
commit 5c77b34a2004a2f6e7cab7a81b111ba22c2b96ba
Author: Michael Meeks 
AuthorDate: Thu Nov 16 19:28:21 2023 +
Commit: Tomaž Vajngerl 
CommitDate: Sun Nov 19 02:18:27 2023 +0100

lok: async calc merge-cells popup dialog.

Change-Id: I6f7d1e8de4ac36f546706f7702157cc7e49c80b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159520
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tomaž Vajngerl 

diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx
index 0d8d7515441a..a62406020de5 100644
--- a/sc/source/ui/inc/viewfunc.hxx
+++ b/sc/source/ui/inc/viewfunc.hxx
@@ -236,7 +236,8 @@ public:
 boolTestMergeCells();
 boolTestRemoveMerge();
 
-boolMergeCells( bool bApi, bool& rDoContents, bool bCenter );
+voidMergeCells( bool bApi, bool bDoContents, bool bCenter,
+const sal_uInt16 nSlot );
 boolRemoveMerge();
 
 SC_DLLPUBLIC void
diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx
index f614e0ff0b4a..43363fd6722c 100644
--- a/sc/source/ui/undo/undoblk3.cxx
+++ b/sc/source/ui/undo/undoblk3.cxx
@@ -755,8 +755,7 @@ void ScUndoMerge::Repeat(SfxRepeatTarget& rTarget)
 if (auto pViewTarget = dynamic_cast( ))
 {
 ScTabViewShell& rViewShell = *pViewTarget->GetViewShell();
-bool bCont = false;
-rViewShell.MergeCells( false, bCont, false );
+rViewShell.MergeCells( false, false, false, 0 );
 }
 }
 
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index 72c7d94ff625..dab2ee7b6a3f 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -944,13 +944,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
 bMoveContents = static_cast(pItem)->GetValue();
 }
 
-if (pTabViewShell->MergeCells( bApi, bMoveContents, 
bCenter ))
-{
-if (!bApi && bMoveContents) // "yes" 
clicked in dialog
-rReq.AppendItem( SfxBoolItem( nSlot, bMoveContents 
) );
-rBindings.Invalidate( nSlot );
-rReq.Done();
-}
+pTabViewShell->MergeCells( bApi, bMoveContents, bCenter, 
nSlot );
 }
 else
 {
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 884722204f0a..45aeb2a3cdce 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -20,6 +20,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1178,7 +1179,8 @@ bool ScViewFunc::TestMergeCells()   // pre-test 
(for menu)
 return false;
 }
 
-bool ScViewFunc::MergeCells( bool bApi, bool& rDoContents, bool bCenter )
+void ScViewFunc::MergeCells( bool bApi, bool bDoContents, bool bCenter,
+ const sal_uInt16 nSlot )
 {
 //  Editable- and Being-Nested- test must be at the beginning (in DocFunc 
too),
 //  so that the Contents-QueryBox won't appear
@@ -1186,7 +1188,7 @@ bool ScViewFunc::MergeCells( bool bApi, bool& 
rDoContents, bool bCenter )
 if (!aTester.IsEditable())
 {
 ErrorMessage(aTester.GetMessageId());
-return false;
+return;
 }
 
 ScMarkData& rMark = GetViewData().GetMarkData();
@@ -1194,7 +1196,7 @@ bool ScViewFunc::MergeCells( bool bApi, bool& 
rDoContents, bool bCenter )
 if (!rMark.IsMarked())
 {
 ErrorMessage(STR_NOMULTISELECT);
-return false;
+return;
 }
 
 ScDocShell* pDocSh = GetViewData().GetDocShell();
@@ -1210,14 +1212,14 @@ bool ScViewFunc::MergeCells( bool bApi, bool& 
rDoContents, bool bCenter )
 if ( nStartCol == nEndCol && nStartRow == nEndRow )
 {
 // nothing to do
-return true;
+return;
 }
 
 if ( rDoc.HasAttrib( nStartCol, nStartRow, nStartTab, nEndCol, nEndRow, 
nEndTab,
 HasAttrFlags::Merged | HasAttrFlags::Overlapped ) )
 {   // "Don't nest merging  !"
 ErrorMessage(STR_MSSG_MERGECELLS_0);
-return false;
+return;
 }
 
 // Check for the contents of all selected tables.
@@ -1240,7 +1242,7 @@ bool ScViewFunc::MergeCells( bool bApi, bool& 
rDoContents, bool bCenter )
 {
 // this range contains only one data cell.
 if (nStartCol != aState.mnCol1 || nStartRow != aState.mnRow1)
-rDoContents = true; // move the value to the top-left.
+bDoContents = true; // move the 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-11-17 Thread Caolán McNamara (via logerrit)
 sc/source/ui/app/inputhdl.cxx |   45 ++
 sc/source/ui/app/inputwin.cxx |   12 +++
 sc/source/ui/inc/inputhdl.hxx |2 -
 sc/source/ui/inc/tabvwsh.hxx  |   20 +-
 4 files changed, 60 insertions(+), 19 deletions(-)

New commits:
commit da3fbd8f6d69a248e30cfa76a4ec59a919ea91c0
Author: Caolán McNamara 
AuthorDate: Tue Nov 14 17:24:18 2023 +
Commit: Miklos Vajna 
CommitDate: Fri Nov 17 12:05:16 2023 +0100

merge duplicate formula bar updates in close time proximity

We get three updates per keystroke, StartExtTextInput, ExtTextInput and
PostExtTextInput.  Skip duplicate updates. Be conservative and don't
skip duplicates that are 5+ seconds apart.

Change-Id: I501bff4193528fa9263d296700d64e2f60b5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159424
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index a816210ea6a3..7aa1ebf218be 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1811,8 +1811,7 @@ void ScInputHandler::LOKPasteFunctionData(const OUString& 
rFunctionName)
 }
 }
 
-void ScInputHandler::LOKSendFormulabarUpdate(EditView* pActiveView,
- const SfxViewShell* pActiveViewSh,
+void ScTabViewShell::LOKSendFormulabarUpdate(EditView* pActiveView,
  const OUString& rText,
  const ESelection& rSelection)
 {
@@ -1829,13 +1828,35 @@ void ScInputHandler::LOKSendFormulabarUpdate(EditView* 
pActiveView,
 OUString::number(rSelection.nStartPara) + ";" + 
OUString::number(rSelection.nEndPara);
 }
 
+sal_uInt64 nCurrentShellId = reinterpret_cast(this);
+
+// We can get three updates per keystroke, StartExtTextInput, ExtTextInput 
and PostExtTextInput
+// Skip duplicate updates. Be conservative and don't skip duplicates that 
are 5+ seconds
+// apart.
+std::chrono::steady_clock::time_point now = 
std::chrono::steady_clock::now();
+if (maSendFormulabarUpdate.m_nShellId == nCurrentShellId &&
+maSendFormulabarUpdate.m_aText == rText &&
+maSendFormulabarUpdate.m_aSelection == aSelection &&
+std::chrono::duration_cast(
+now - maSendFormulabarUpdate.m_nTimeStamp) < 
std::chrono::seconds(5))
+{
+return;
+}
+
+maSendFormulabarUpdate.m_nShellId = nCurrentShellId;
+maSendFormulabarUpdate.m_aText = rText;
+maSendFormulabarUpdate.m_aSelection = aSelection;
+maSendFormulabarUpdate.m_nTimeStamp = now;
+maSendFormulabarUpdate.Send();
+}
+
+void ScTabViewShell::SendFormulabarUpdate::Send()
+{
 std::unique_ptr pData = 
std::make_unique();
 (*pData)["action_type"] = "setText";
-(*pData)["text"] = rText;
-(*pData)["selection"] = aSelection;
-
-sal_uInt64 nCurrentShellId = reinterpret_cast(pActiveViewSh);
-std::string sWindowId = std::to_string(nCurrentShellId) + "formulabar";
+(*pData)["text"] = m_aText;
+(*pData)["selection"] = m_aSelection;
+std::string sWindowId = std::to_string(m_nShellId) + "formulabar";
 jsdialog::SendAction(sWindowId, "sc_input_window", std::move(pData));
 }
 
@@ -2820,9 +2841,9 @@ void ScInputHandler::DataChanged( bool bFromTopNotify, 
bool bSetModified )
 if (pActiveView)
 aSel = pActiveView->GetSelection();
 
-ScInputHandler::LOKSendFormulabarUpdate(pActiveView, pActiveViewSh,
-
ScEditUtil::GetMultilineString(*mpEditEngine),
-aSel);
+pActiveViewSh->LOKSendFormulabarUpdate(pActiveView,
+   
ScEditUtil::GetMultilineString(*mpEditEngine),
+   aSel);
 }
 
 UpdateFormulaMode();
@@ -4299,7 +4320,7 @@ void ScInputHandler::NotifyChange( const ScInputHdlState* 
pState,
 if (aSel.nEndPara == EE_PARA_NOT_FOUND)
 aSel.nEndPara = 0;
 
-ScInputHandler::LOKSendFormulabarUpdate(pActiveView, 
pActiveViewSh, aString, aSel);
+pActiveViewSh->LOKSendFormulabarUpdate(pActiveView, 
aString, aSel);
 // TODO: deprecated?
 
pActiveViewSh->libreOfficeKitViewCallback(LOK_CALLBACK_CELL_FORMULA, 
aString.toUtf8().getStr());
 }
@@ -4463,7 +4484,7 @@ void ScInputHandler::InputSelection( const EditView* 
pView )
 {
 EditView* pActiveView = pTopView ? pTopView : pTableView;
 ESelection aSel = pActiveView ? pActiveView->GetSelection() : 
ESelection();
-ScInputHandler::LOKSendFormulabarUpdate(pActiveView, pActiveViewSh, 
GetEditString(), aSel);
+

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-11-15 Thread Attila Szűcs (via logerrit)
 sc/source/ui/inc/content.hxx|2 ++
 sc/source/ui/navipi/content.cxx |   18 +-
 2 files changed, 19 insertions(+), 1 deletion(-)

New commits:
commit 3dff3a50dfda011c8bfb5502f6a8d1e7f8b95d59
Author: Attila Szűcs 
AuthorDate: Tue Nov 7 15:03:33 2023 +0100
Commit: Tomaž Vajngerl 
CommitDate: Thu Nov 16 04:02:36 2023 +0100

SC navigator: fix changing language of contenttree

Saved the actual language, when ScContentTree is created, and use
that language to localise is text.

Note: Saving language in ScContentTree::ScContentTree caused
problems, so it replaced into where this tree filled with text at
the first time.

In case of LOK, there can be seapate views, with different
languages, that means there can be 2+ ScContentTree, one have text
in English and the other in German.

When new item is created that is listed in navigator, then every
ScContentTree is updated at once... but that would use the global
laguage, not the one what was used when the actual ScContentTree
was created.

Change-Id: I2dedf293e0ad9fb8f3cdd1090e1e1707a9f6cfa4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159077
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tomaž Vajngerl 

diff --git a/sc/source/ui/inc/content.hxx b/sc/source/ui/inc/content.hxx
index 9cd7e977319d..3f179860cce7 100644
--- a/sc/source/ui/inc/content.hxx
+++ b/sc/source/ui/inc/content.hxx
@@ -59,6 +59,8 @@ class ScContentTree
 
 o3tl::enumarray pPosList; // for the sequence
 
+std::unique_ptr m_pResLocaleForLOK; //it needed only in case 
of LOK
+
 ScDocShell* GetManualOrCurrent();
 
 voidInitRoot(ScContentId nType);
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index 1387abd44346..7c3d2b7d022b 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -188,7 +188,23 @@ void ScContentTree::InitRoot( ScContentId nType )
 }
 
 auto const aImage(aContentBmps[static_cast(nType) - 1]);
-OUString aName(ScResId(SCSTR_CONTENT_ARY[static_cast(nType)]));
+
+OUString aName;
+if(comphelper::LibreOfficeKit::isActive())
+{
+//In case of LOK we may have many different languaged ScContentTree
+//At creation time, we store what language we use, and then use it 
later too.
+//It not work in the constructor, that is why it is here.
+if (!m_pResLocaleForLOK)
+{
+m_pResLocaleForLOK = 
std::make_unique(SC_MOD()->GetResLocale());
+}
+aName = Translate::get(SCSTR_CONTENT_ARY[static_cast(nType)], 
*m_pResLocaleForLOK);
+}
+else
+{
+aName = ScResId(SCSTR_CONTENT_ARY[static_cast(nType)]);
+}
 // back to the correct position:
 sal_uInt16 nPos = nRootType != ScContentId::ROOT ? 0 : pPosList[nType]-1;
 m_aRootNodes[nType] = m_xTreeView->make_iterator();


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-11-03 Thread Caolán McNamara (via logerrit)
 sc/source/ui/app/inputhdl.cxx |   28 +++-
 sc/source/ui/app/inputwin.cxx |   28 ++--
 sc/source/ui/inc/inputwin.hxx |   10 +-
 3 files changed, 38 insertions(+), 28 deletions(-)

New commits:
commit 97b8b9685c2df242608a429ab8526b14ea60ad6f
Author: Caolán McNamara 
AuthorDate: Fri Nov 3 11:46:32 2023 +
Commit: Caolán McNamara 
CommitDate: Fri Nov 3 14:43:14 2023 +0100

reduce jsdialog formulabar updates from 6 to 3 per keystroke

SetTextString will emit one, so skip doing that if we are going to be
followed by another emission that will override the earlier one.

Change-Id: I82d804d57cd9647631bd338a3a0c4dd11989b9fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158876
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index b90b1b100be4..a816210ea6a3 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -2611,7 +2611,7 @@ bool ScInputHandler::StartTable( sal_Unicode cTyped, bool 
bFromCommand, bool bIn
 aStr = aStr.copy(1, aStr.getLength() -2);
 mpEditEngine->SetTextCurrentDefaults(aStr);
 if ( pInputWin )
-pInputWin->SetTextString(aStr);
+pInputWin->SetTextString(aStr, true);
 }
 
 UpdateAdjust( cTyped );
@@ -2706,7 +2706,7 @@ IMPL_LINK_NOARG(ScInputHandler, ModifyHdl, 
LinkParamNone*, void)
 // wrapped by DataChanging/DataChanged calls (like Drag)
 OUString aText(ScEditUtil::GetMultilineString(*mpEditEngine));
 lcl_RemoveTabs(aText);
-pInputWin->SetTextString(aText);
+pInputWin->SetTextString(aText, true);
 }
 }
 
@@ -2753,6 +2753,8 @@ void ScInputHandler::DataChanged( bool bFromTopNotify, 
bool bSetModified )
 
 UpdateParenthesis(); // Highlight parentheses anew
 
+const bool bUpdateKit = comphelper::LibreOfficeKit::isActive() && 
pActiveViewSh && pInputWin;
+
 if (eMode==SC_INPUT_TYPE || eMode==SC_INPUT_TABLE)
 {
 OUString aText;
@@ -2762,8 +2764,11 @@ void ScInputHandler::DataChanged( bool bFromTopNotify, 
bool bSetModified )
 aText = GetEditText(mpEditEngine.get());
 lcl_RemoveTabs(aText);
 
-if ( pInputWin )
-pInputWin->SetTextString( aText );
+if (pInputWin)
+{
+// If we will end up updating LoKit at the end, we can skip it here
+pInputWin->SetTextString(aText, !bUpdateKit);
+}
 
 if (comphelper::LibreOfficeKit::isActive())
 {
@@ -2809,7 +2814,7 @@ void ScInputHandler::DataChanged( bool bFromTopNotify, 
bool bSetModified )
 }
 }
 
-if (comphelper::LibreOfficeKit::isActive() && pActiveViewSh && pInputWin)
+if (bUpdateKit)
 {
 UpdateActiveView();
 if (pActiveView)
@@ -4273,10 +4278,15 @@ void ScInputHandler::NotifyChange( const 
ScInputHdlState* pState,
 bTextValid = true;  //! To begin with 
remember as a string
 }
 
-if ( pInputWin )
-pInputWin->SetTextString(aString);
+const bool bUpdateKit = 
comphelper::LibreOfficeKit::isActive() && pActiveViewSh;
 
-if (comphelper::LibreOfficeKit::isActive() && 
pActiveViewSh)
+if (pInputWin)
+{
+// If we will end up updating LoKit after this, we can 
skip it here
+pInputWin->SetTextString(aString, !bUpdateKit);
+}
+
+if (bUpdateKit)
 {
 UpdateActiveView();
 EditView* pActiveView = pTopView ? pTopView : 
pTableView;
@@ -4432,7 +4442,7 @@ IMPL_LINK_NOARG( ScInputHandler, DelayTimer, Timer*, void 
)
 if ( pInputWin )
 {
 pInputWin->SetPosString( OUString() );
-pInputWin->SetTextString( OUString() );
+pInputWin->SetTextString(OUString(), true);
 pInputWin->Disable();
 }
 
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 5667766b827f..7d9890c5858d 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -259,14 +259,14 @@ ScInputWindow::ScInputWindow( vcl::Window* pParent, const 
SfxBindings* pBind ) :
 // Switch over while the Function AutoPilot is active
 // -> show content of the Function AutoPilot again
 // Also show selection (remember at the InputHdl)
-mxTextWindow->SetTextString( pInputHdl->GetFormString() );
+mxTextWindow->SetTextString(pInputHdl->GetFormString(), true);
 }
 else if (pInputHdl && pInputHdl->IsInputMode())
 {
 // If the input row was hidden while editing 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-11-01 Thread offtkp (via logerrit)
 sc/source/core/data/fillinfo.cxx |   14 --
 1 file changed, 4 insertions(+), 10 deletions(-)

New commits:
commit cb53d9731a8dcb51596b4181b8fefd462854d984
Author: offtkp 
AuthorDate: Wed Nov 1 18:52:35 2023 +0200
Commit: Paris Oplopoios 
CommitDate: Wed Nov 1 20:28:46 2023 +0100

sc: Don't end handleConditionalFormat early

handleConditionalFormat would exit the conditional format searching loop
which meant that cells with overlapping conditional formatting rules
would not get properly rendered

Change-Id: I98664c758cc2c8f844994e6dcecdc57df2213a01
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158767
Reviewed-by: Michael Meeks 
Tested-by: Jenkins CollaboraOffice 

diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx
index 7c95701e9705..2dc9d5960128 100644
--- a/sc/source/core/data/fillinfo.cxx
+++ b/sc/source/core/data/fillinfo.cxx
@@ -287,7 +287,6 @@ bool handleConditionalFormat(ScConditionalFormatList& 
rCondFormList, const ScCon
 ScCellInfo* pInfo, ScTableInfo* pTableInfo, ScStyleSheetPool* pStlPool,
 const ScAddress& rAddr, bool& bHidden, bool& bHideFormula, bool 
bTabProtect)
 {
-bool bFound = false;
 bool bAnyCondition = false;
 for(const auto& rCondFormat : rCondFormats)
 {
@@ -317,33 +316,28 @@ bool handleConditionalFormat(ScConditionalFormatList& 
rCondFormList, const ScCon
 bHideFormula = pProtAttr->GetHideFormula();
 
 }
-bFound = true;
-
 }
 // if style is not there, treat like no condition
 }
 
-if(aData.mxColorScale)
+if(aData.mxColorScale && !pInfo->mxColorScale)
 {
 pInfo->mxColorScale = aData.mxColorScale;
-bFound = true;
 }
 
-if(aData.pDataBar)
+if(aData.pDataBar && !pInfo->pDataBar)
 {
 pInfo->pDataBar = aData.pDataBar.get();
 pTableInfo->addDataBarInfo(std::move(aData.pDataBar));
-bFound = true;
 }
 
-if(aData.pIconSet)
+if(aData.pIconSet && !pInfo->pIconSet)
 {
 pInfo->pIconSet = aData.pIconSet.get();
 pTableInfo->addIconSetInfo(std::move(aData.pIconSet));
-bFound = true;
 }
 
-if (bFound)
+if (pInfo->mxColorScale && pInfo->pIconSet && pInfo->pDataBar)
 break;
 }
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-11-01 Thread offtkp (via logerrit)
 sc/source/core/data/colorscale.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit d66079dfec125e79d9c367cba90b04ee32c07cb3
Author: offtkp 
AuthorDate: Wed Nov 1 19:14:44 2023 +0200
Commit: Paris Oplopoios 
CommitDate: Wed Nov 1 19:43:56 2023 +0100

sc: Fix conditional formatting icon set order for smilies

The order of these icon sets was not consistent with other icon sets
(traffic lights, flags, circles) and Excel

Change-Id: I5cbc2ff96118530420341f6994310f946717e0d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158771
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Paris Oplopoios 

diff --git a/sc/source/core/data/colorscale.cxx 
b/sc/source/core/data/colorscale.cxx
index 4e61dbdbc228..97cc50f73829 100644
--- a/sc/source/core/data/colorscale.cxx
+++ b/sc/source/core/data/colorscale.cxx
@@ -1337,11 +1337,11 @@ constexpr rtl::OUStringConstExpr a3Flags[] = {
 };
 
 constexpr rtl::OUStringConstExpr a3Smilies[] = {
-BMP_ICON_SET_POSITIVE_YELLOW_SMILIE, BMP_ICON_SET_NEUTRAL_YELLOW_SMILIE, 
BMP_ICON_SET_NEGATIVE_YELLOW_SMILIE
+BMP_ICON_SET_NEGATIVE_YELLOW_SMILIE, BMP_ICON_SET_NEUTRAL_YELLOW_SMILIE, 
BMP_ICON_SET_POSITIVE_YELLOW_SMILIE
 };
 
 constexpr rtl::OUStringConstExpr a3ColorSmilies[] = {
-BMP_ICON_SET_POSITIVE_GREEN_SMILIE, BMP_ICON_SET_NEUTRAL_YELLOW_SMILIE, 
BMP_ICON_SET_NEGATIVE_RED_SMILIE
+BMP_ICON_SET_NEGATIVE_RED_SMILIE, BMP_ICON_SET_NEUTRAL_YELLOW_SMILIE, 
BMP_ICON_SET_POSITIVE_GREEN_SMILIE
 };
 
 constexpr rtl::OUStringConstExpr a3Stars[] = {


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source sc/uiconfig

2023-10-31 Thread Szymon Kłos (via logerrit)
 sc/source/ui/condformat/condformateasydlg.cxx |8 ++--
 sc/source/ui/inc/condformateasydlg.hxx|4 ++--
 sc/uiconfig/scalc/ui/conditionaleasydialog.ui |4 ++--
 3 files changed, 6 insertions(+), 10 deletions(-)

New commits:
commit 2b8df39aea832d0521bf0d3c6b543a81709c382f
Author: Szymon Kłos 
AuthorDate: Fri Oct 27 13:02:29 2023 +0200
Commit: Szymon Kłos 
CommitDate: Tue Oct 31 08:34:53 2023 +0100

Allow to enter text in simple conditional formatting dialog

We have rules for test values like: "contains text".
Better to use formatter which will be used only when needed.
But it is possible to use Less or Greater even for text
using the lexicographic order.

Strings in quotes are interpreted as text.
Strings without quotes are interpreted as refs to columns/rows/ranges.

Change-Id: I1f63b3f4b2a878e55d405a030dd3ddf47305e220
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158559
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Gülşah Köse 

diff --git a/sc/source/ui/condformat/condformateasydlg.cxx 
b/sc/source/ui/condformat/condformateasydlg.cxx
index 7e07b1a1dc19..d707b7c9f88d 100644
--- a/sc/source/ui/condformat/condformateasydlg.cxx
+++ b/sc/source/ui/condformat/condformateasydlg.cxx
@@ -64,8 +64,8 @@ 
ConditionalFormatEasyDialog::ConditionalFormatEasyDialog(SfxBindings* pBindings,
 "modules/scalc/ui/conditionaleasydialog.ui", 
"CondFormatEasyDlg")
 , mpViewData(pViewData)
 , mpDocument(>GetDocument())
-, mxNumberEntry(m_xBuilder->weld_spin_button("entryNumber"))
-, mxNumberEntry2(m_xBuilder->weld_spin_button("entryNumber2"))
+, mxNumberEntry(m_xBuilder->weld_entry("entryNumber"))
+, mxNumberEntry2(m_xBuilder->weld_entry("entryNumber2"))
 , mxRangeEntry(new formula::RefEdit(m_xBuilder->weld_entry("entryRange")))
 , mxButtonRangeEdit(new 
formula::RefButton(m_xBuilder->weld_button("rbassign")))
 , mxStyles(m_xBuilder->weld_combo_box("themeCombo"))
@@ -92,10 +92,6 @@ 
ConditionalFormatEasyDialog::ConditionalFormatEasyDialog(SfxBindings* pBindings,
 meMode = *pCurrentMode;
 }
 mxNumberEntry2->hide();
-mxNumberEntry->set_range(SAL_MIN_INT64, SAL_MAX_INT64);
-mxNumberEntry2->set_range(SAL_MIN_INT64, SAL_MAX_INT64);
-mxNumberEntry->set_increments(1, 0);
-mxNumberEntry2->set_increments(1, 0);
 switch (meMode)
 {
 case ScConditionMode::Equal:
diff --git a/sc/source/ui/inc/condformateasydlg.hxx 
b/sc/source/ui/inc/condformateasydlg.hxx
index 9ca15a11bda9..6d6af1041b49 100644
--- a/sc/source/ui/inc/condformateasydlg.hxx
+++ b/sc/source/ui/inc/condformateasydlg.hxx
@@ -42,8 +42,8 @@ private:
 ScAddress maPosition;
 ScTabViewShell* mpTabViewShell;
 
-std::unique_ptr mxNumberEntry;
-std::unique_ptr mxNumberEntry2;
+std::unique_ptr mxNumberEntry;
+std::unique_ptr mxNumberEntry2;
 std::unique_ptr mxRangeEntry;
 std::unique_ptr mxButtonRangeEdit;
 std::unique_ptr mxStyles;
diff --git a/sc/uiconfig/scalc/ui/conditionaleasydialog.ui 
b/sc/uiconfig/scalc/ui/conditionaleasydialog.ui
index 2bee383956a9..077610196356 100644
--- a/sc/uiconfig/scalc/ui/conditionaleasydialog.ui
+++ b/sc/uiconfig/scalc/ui/conditionaleasydialog.ui
@@ -90,7 +90,7 @@
 False
 12
 
-  
+  
 True
 True
 
@@ -104,7 +104,7 @@
   
 
 
-  
+  
 True
 True
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source sc/uiconfig

2023-10-28 Thread Paris Oplopoios (via logerrit)
 sc/source/ui/condformat/condformateasydlg.cxx |2 +
 sc/source/ui/inc/condformateasydlg.hxx|1 
 sc/uiconfig/scalc/ui/conditionaleasydialog.ui |   29 +-
 3 files changed, 31 insertions(+), 1 deletion(-)

New commits:
commit 1373bacdb99caec73b1a534e534c758c26982324
Author: Paris Oplopoios 
AuthorDate: Fri Oct 27 13:12:19 2023 +0300
Commit: Paris Oplopoios 
CommitDate: Sat Oct 28 22:36:19 2023 +0200

tdf#157930 Add button to switch to range view in condformateasydlg

Add a button that minimizes the dialog to make it easier to choose the
conditional formatting range in the condformateasydlg. Also added more
spacing.

Change-Id: Ibf90e1d44caf2ab7a5c7bdb0bb2fa6c11d58
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158532
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Paris Oplopoios 

diff --git a/sc/source/ui/condformat/condformateasydlg.cxx 
b/sc/source/ui/condformat/condformateasydlg.cxx
index 8ddb297269dc..41b8a31eafd3 100644
--- a/sc/source/ui/condformat/condformateasydlg.cxx
+++ b/sc/source/ui/condformat/condformateasydlg.cxx
@@ -60,11 +60,13 @@ 
ConditionalFormatEasyDialog::ConditionalFormatEasyDialog(SfxBindings* pBindings,
 , mxNumberEntry(m_xBuilder->weld_spin_button("entryNumber"))
 , mxNumberEntry2(m_xBuilder->weld_spin_button("entryNumber2"))
 , mxRangeEntry(new formula::RefEdit(m_xBuilder->weld_entry("entryRange")))
+, mxButtonRangeEdit(new 
formula::RefButton(m_xBuilder->weld_button("rbassign")))
 , mxStyles(m_xBuilder->weld_combo_box("themeCombo"))
 , mxDescription(m_xBuilder->weld_label("description"))
 , mxButtonOk(m_xBuilder->weld_button("ok"))
 , mxButtonCancel(m_xBuilder->weld_button("cancel"))
 {
+mxButtonRangeEdit->SetReferences(this, mxRangeEntry.get());
 mpTabViewShell = GetTabViewShell(pBindings);
 if (!mpTabViewShell)
 mpTabViewShell = 
dynamic_cast(SfxViewShell::Current());
diff --git a/sc/source/ui/inc/condformateasydlg.hxx 
b/sc/source/ui/inc/condformateasydlg.hxx
index 001414396522..856e5fe9463f 100644
--- a/sc/source/ui/inc/condformateasydlg.hxx
+++ b/sc/source/ui/inc/condformateasydlg.hxx
@@ -43,6 +43,7 @@ private:
 std::unique_ptr mxNumberEntry;
 std::unique_ptr mxNumberEntry2;
 std::unique_ptr mxRangeEntry;
+std::unique_ptr mxButtonRangeEdit;
 std::unique_ptr mxStyles;
 std::unique_ptr mxDescription;
 std::unique_ptr mxButtonOk;
diff --git a/sc/uiconfig/scalc/ui/conditionaleasydialog.ui 
b/sc/uiconfig/scalc/ui/conditionaleasydialog.ui
index 8f3da05b2ce8..2bee383956a9 100644
--- a/sc/uiconfig/scalc/ui/conditionaleasydialog.ui
+++ b/sc/uiconfig/scalc/ui/conditionaleasydialog.ui
@@ -68,7 +68,7 @@
 True
 False
 vertical
-12
+24
 
   
 True
@@ -79,6 +79,10 @@
   
 True
 False
+12
+12
+6
+6
 12
 
   
@@ -191,6 +195,11 @@
   
 True
 False
+12
+12
+6
+6
+12
 
   
 True
@@ -205,6 +214,24 @@
 0
   
 
+
+  
+True
+True
+True
+center
+
+  
+Click 
the Shrink icon to reduce the dialog to the size of the input field. It is then 
easier to mark the required reference in the sheet. The icons then 
automatically convert to the Maximize icon. Click it to restore the dialog to 
its original size.
+  
+
+  
+  
+False
+True
+1
+  
+
   
 
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-10-28 Thread Paris Oplopoios (via logerrit)
 sc/source/filter/excel/xecontent.cxx |   17 -
 1 file changed, 16 insertions(+), 1 deletion(-)

New commits:
commit a63bd448c84c8b337b099d3b0c027f40516bc603
Author: Paris Oplopoios 
AuthorDate: Thu Oct 26 12:35:23 2023 +0300
Commit: Paris Oplopoios 
CommitDate: Sat Oct 28 22:26:11 2023 +0200

sc: Export conditional formatting expression correctly for text rules

Text rules like BeginsWith would discard the expression if it was a
number when exporting, which is not what is supposed to happen - as
something like a conditional formatting rule BeginsWith "1" should be
valid.

Change-Id: I2d53754c462403f20b1991fa201184fcab3616a8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158440
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Paris Oplopoios 

diff --git a/sc/source/filter/excel/xecontent.cxx 
b/sc/source/filter/excel/xecontent.cxx
index 316fe673c359..71bf09cc84f5 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -1057,7 +1057,22 @@ void XclExpCFImpl::SaveXml( XclExpXmlStream& rStrm )
 // the token array for that
 std::unique_ptr 
pTokenArray(mrFormatEntry.CreateFlatCopiedTokenArray(0));
 if(pTokenArray->GetLen())
-aText = 
pTokenArray->FirstToken()->GetString().getString().toUtf8();
+{
+formula::StackVar eType = pTokenArray->FirstToken()->GetType();
+switch (eType)
+{
+case formula::svDouble:
+{
+aText = 
OString::number(pTokenArray->FirstToken()->GetDouble());
+break;
+}
+default:
+{
+aText = 
pTokenArray->FirstToken()->GetString().getString().toUtf8();
+break;
+}
+}
+}
 }
 
 sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-10-28 Thread Caolán McNamara (via logerrit)
 sc/source/ui/inc/viewdata.hxx  |1 +
 sc/source/ui/view/viewdata.cxx |   33 +
 2 files changed, 18 insertions(+), 16 deletions(-)

New commits:
commit 396f56a2e7f6d818846c1d97d2d008b279e746e1
Author: Caolán McNamara 
AuthorDate: Thu Oct 26 12:47:21 2023 +0100
Commit: Tomaž Vajngerl 
CommitDate: Sat Oct 28 13:28:18 2023 +0200

null-deref seen in ScTabView::UpdateEditView

 #0  0x7f2bcc41df63 in ScViewData::GetCurYForTab 
(this=this@entry=0x3502d0b8, nTabIndex=nTabIndex@entry=6)
 at libreoffice/sc/source/ui/view/viewdata.cxx:1443
 #1  0x7f2bcc3ebf02 in ScTabView::UpdateEditView 
(this=this@entry=0x3502d0b0) at libreoffice/sc/source/ui/view/tabview3.cxx:2185
 #2  0x7f2bcc3ec636 in ScTabView::UpdateFormulas 
(this=this@entry=0x3502d0b0, nStartCol=nStartCol@entry=-1, 
nStartRow=nStartRow@entry=-1, nEndCol=nEndCol@entry=-1,
 nEndRow=nEndRow@entry=-1) at 
libreoffice/sc/source/ui/view/tabview3.cxx:2327
 #3  0x7f2bcc40735c in ScTabViewShell::Notify (this=0x3502cf20, 
rBC=..., rHint=...) at libreoffice/sc/source/ui/view/tabvwsh5.cxx:216
 #4  0x7f2bdc1885a9 in SfxBroadcaster::Broadcast 
(this=this@entry=0x31e31430, rHint=...)
 at libreoffice/svl/source/notify/SfxBroadcaster.cxx:40
 #5  0x7f2bcc022e6d in ScDocShell::PostDataChanged 
(this=this@entry=0x31e31430) at libreoffice/sc/source/ui/docshell/docsh3.cxx:95
 #6  0x7f2bcc0101aa in ScDocShell::SetDocumentModified 
(this=0x31e31430) at libreoffice/sc/source/ui/docshell/docsh.cxx:3015
 #7  0x7f2bcc010df3 in ScDocShellModificator::SetDocumentModified 
(this=this@entry=0x7fff2d168da0)
 at libreoffice/sc/source/ui/docshell/docsh.cxx:3330
 #8  0x7f2bcc040c1a in ScDocShell::MoveTable 
(this=this@entry=0x31e31430, nSrcTab=, nDestTab=, 
bCopy=bCopy@entry=false, bRecord=bRecord@entry=false)
 at libreoffice/sc/source/ui/docshell/docsh5.cxx:1010
 #9  0x7f2bcc441a41 in ScViewFunc::MoveTable 
(this=this@entry=0x333d0fe0, nDestDocNo=nDestDocNo@entry=0, 
nDestTab=nDestTab@entry=7, bCopy=bCopy@entry=false,
 pNewTabName=pNewTabName@entry=0x7fff2d169068) at 
libreoffice/sc/source/ui/view/viewfun2.cxx:3117
 #10 0x7f2bcc418459 in ScTabViewShell::ExecuteTable (this=0x333d0e50, 
rReq=...) at libreoffice/sc/source/ui/view/tabvwshf.cxx:593
 #11 0x7f2bdbd3d96f in SfxDispatcher::Call_Impl 
(this=this@entry=0x33379ed0, rShell=..., rSlot=..., rReq=..., 
bRecord=)
 at libreoffice/sfx2/source/control/dispatch.cxx:254
 #12 0x7f2bdbd427ee in SfxDispatcher::Execute_ 
(this=this@entry=0x33379ed0, rShell=..., rSlot=..., rReq=..., 
eCallMode=eCallMode@entry=SfxCallMode::RECORD)
 at libreoffice/sfx2/source/control/dispatch.cxx:753
 #13 0x7f2bdbd45a33 in SfxDispatcher::Execute (this=0x33379ed0, 
nSlot=, nCall=nCall@entry=SfxCallMode::RECORD, 
pArgs=pArgs@entry=0x7fff2d1694a0,
 pInternalArgs=pInternalArgs@entry=0x7fff2d169460, nModi=nModi@entry=0) 
at libreoffice/sfx2/source/control/dispatch.cxx:813
 #14 0x7f2bdbd83c0f in SfxDispatchController_Impl::dispatch 
(this=, aURL=..., aArgs=..., rListener=...)

we have nulls in here for hidden sheets

Change-Id: I8f1295e67552f3ec9306a031aaecd0838e18d98d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158442
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tomaž Vajngerl 

diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx
index 34bc8c49c4f6..abe93954f774 100644
--- a/sc/source/ui/inc/viewdata.hxx
+++ b/sc/source/ui/inc/viewdata.hxx
@@ -343,6 +343,7 @@ private:
 SAL_DLLPRIVATE void  CreateSelectedTabData();
 SAL_DLLPRIVATE void  EnsureTabDataSize(size_t nSize);
 SAL_DLLPRIVATE void  UpdateCurrentTab();
+SAL_DLLPRIVATE ScViewDataTable* FetchTableData(SCTAB) const;
 
 ScViewData(ScDocument* pDoc, ScDocShell* pDocSh, ScTabViewShell* pViewSh);
 
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index e400f1b314ff..57ef3e5487d0 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -1427,36 +1427,37 @@ SCROW ScViewData::GetPosY( ScVSplitPos eWhich, SCTAB 
nForTab ) const
 return maTabData[nForTab]->nPosY[eWhich];
 }
 
-SCCOL ScViewData::GetCurXForTab( SCTAB nTabIndex ) const
+ScViewDataTable* ScViewData::FetchTableData(SCTAB nTabIndex) const
 {
-if (!ValidTab(nTabIndex) || (nTabIndex >= 
static_cast(maTabData.size())) || !maTabData[nTabIndex])
-return -1;
+if (!ValidTab(nTabIndex) || (nTabIndex >= 
static_cast(maTabData.size(
+return nullptr;
+ScViewDataTable* pRet = maTabData[nTabIndex].get();
+SAL_WARN_IF(!pRet, "sc.viewdata", "ScViewData::FetchTableData: hidden 
sheet = " << nTabIndex);
+return pRet;
+}
 
-return maTabData[nTabIndex]->nCurX;
+SCCOL ScViewData::GetCurXForTab( SCTAB nTabIndex ) const
+{
+ScViewDataTable* 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-10-27 Thread Caolán McNamara (via logerrit)
 sc/source/ui/docshell/docsh4.cxx |   46 ++-
 1 file changed, 22 insertions(+), 24 deletions(-)

New commits:
commit 9c5f72071ea7f268cfbd5c7f76f8a6c3c970887b
Author: Caolán McNamara 
AuthorDate: Fri Oct 27 12:04:29 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Oct 27 17:47:31 2023 +0200

calc comment boost::property_tree::ptree use quotes comment id numbers

which does not conform to JSON standard and means that added/deleted
comment ids are strings and not numbers as created by the related
getPostIts

found during: https://github.com/CollaboraOnline/online/issues/7334
where if the regular updating of comments via getPostIts doesn't happen
then deleting/adding comments doesn't appear to work

boost bug report found as:
https://svn.boost.org/trac/boost/ticket/9721
https://marc.info/?l=boost-bugs=139351272302586=2

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

diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index ceef6e3009f5..5c1f6b0505f7 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -19,8 +19,6 @@
 
 #include 
 
-#include 
-
 #include 
 
 using namespace ::com::sun::star;
@@ -55,6 +53,7 @@ using namespace ::com::sun::star;
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -2531,32 +2530,31 @@ void 
ScDocShell::LOKCommentNotify(LOKCommentNotificationType nType, const ScDocu
  comphelper::LibreOfficeKit::isTiledAnnotations() )
 return;
 
-boost::property_tree::ptree aAnnotation;
-aAnnotation.put("action", (nType == LOKCommentNotificationType::Add ? 
"Add" :
-   (nType == LOKCommentNotificationType::Remove ? 
"Remove" :
-(nType == LOKCommentNotificationType::Modify ? 
"Modify" : "???";
+tools::JsonWriter aAnnotation;
+{
+auto commentNode = aAnnotation.startNode("comment");
+aAnnotation.put("action", (nType == LOKCommentNotificationType::Add ? 
"Add" :
+   (nType == 
LOKCommentNotificationType::Remove ? "Remove" :
+(nType == 
LOKCommentNotificationType::Modify ? "Modify" : "???";
 
-assert(pNote);
-aAnnotation.put("id", pNote->GetId());
-aAnnotation.put("tab", rPos.Tab());
+assert(pNote);
+aAnnotation.put("id", pNote->GetId());
+aAnnotation.put("tab", rPos.Tab());
 
-if (nType != LOKCommentNotificationType::Remove)
-{
-aAnnotation.put("author", pNote->GetAuthor());
-aAnnotation.put("dateTime", pNote->GetDate());
-aAnnotation.put("text", pNote->GetText());
-
-// Calculating the cell cursor position
-ScViewData* pViewData = GetViewData();
-if (pViewData && pViewData->GetActiveWin())
-aAnnotation.put("cellRange", 
ScPostIt::NoteRangeToJsonString(*pDocument, rPos));
+if (nType != LOKCommentNotificationType::Remove)
+{
+aAnnotation.put("author", pNote->GetAuthor());
+aAnnotation.put("dateTime", pNote->GetDate());
+aAnnotation.put("text", pNote->GetText());
+
+// Calculating the cell cursor position
+ScViewData* pViewData = GetViewData();
+if (pViewData && pViewData->GetActiveWin())
+aAnnotation.put("cellRange", 
ScPostIt::NoteRangeToJsonString(*pDocument, rPos));
+}
 }
 
-boost::property_tree::ptree aTree;
-aTree.add_child("comment", aAnnotation);
-std::stringstream aStream;
-boost::property_tree::write_json(aStream, aTree);
-std::string aPayload = aStream.str();
+std::string aPayload(aAnnotation.extractAsStdString());
 
 ScViewData* pViewData = GetViewData();
 SfxViewShell* pThisViewShell = ( pViewData ? pViewData->GetViewShell() : 
nullptr );


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-10-24 Thread Noel Grandin (via logerrit)
 sc/source/core/data/column2.cxx |4 
 sc/source/ui/view/output2.cxx   |   14 +-
 2 files changed, 13 insertions(+), 5 deletions(-)

New commits:
commit 18c2358d3b0658b20daa045a8950cb2bfb15bd7b
Author: Noel Grandin 
AuthorDate: Sun Oct 22 21:25:15 2023 +0200
Commit: Caolán McNamara 
CommitDate: Tue Oct 24 12:54:10 2023 +0200

cool#7332 calc perf: GetEmptyLinesInBlock

reuse existing method to find area of sheet which contains data - this 
method already caches the necessary data.

Also add a shortcut for the common case in ScColumn::IsEmptyData to avoid 
performing more expensive lookup operation.


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

diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index e01a3458f6fc..3abb568befbc 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -1318,6 +1318,10 @@ bool ScColumn::HasVisibleDataAt(SCROW nRow) const
 
 bool ScColumn::IsEmptyData(SCROW nStartRow, SCROW nEndRow) const
 {
+// simple case
+if (maCells.block_size() == 1 && maCells.begin()->type == 
sc::element_type_empty)
+return true;
+
 std::pair aPos = 
maCells.position(nStartRow);
 sc::CellStoreType::const_iterator it = aPos.first;
 if (it == maCells.end())
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 3887f19b3d5c..9b325a5dbe82 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -1517,8 +1517,11 @@ tools::Rectangle ScOutputData::LayoutStrings(bool 
bPixelToLogic, bool bPaint, co
 
 SCCOL nLastContentCol = mpDoc->MaxCol();
 if ( nX2 < mpDoc->MaxCol() )
-nLastContentCol = sal::static_int_cast(
-nLastContentCol - mpDoc->GetEmptyLinesInBlock( nX2+1, nY1, nTab, 
mpDoc->MaxCol(), nY2, nTab, DIR_RIGHT ) );
+{
+SCROW nEndRow;
+mpDoc->GetCellArea(nTab, nLastContentCol, nEndRow);
+}
+
 SCCOL nLoopStartX = nX1;
 if ( nX1 > 0 )
 --nLoopStartX;  // start before nX1 for rest of long text to 
the left
@@ -4319,11 +4322,12 @@ void ScOutputData::DrawEdit(bool bPixelToLogic)
 }
 tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
 
-//! store nLastContentCol as member!
 SCCOL nLastContentCol = mpDoc->MaxCol();
 if ( nX2 < mpDoc->MaxCol() )
-nLastContentCol = sal::static_int_cast(
-nLastContentCol - mpDoc->GetEmptyLinesInBlock( nX2+1, nY1, nTab, 
mpDoc->MaxCol(), nY2, nTab, DIR_RIGHT ) );
+{
+SCROW nEndRow;
+mpDoc->GetCellArea(nTab, nLastContentCol, nEndRow);
+}
 
 tools::Long nRowPosY = nScrY;
 for (SCSIZE nArrY=0; nArrY+1

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-10-20 Thread Michael Meeks (via logerrit)
 sc/source/core/data/column4.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 00563949554ca52f7316e9c8769b4567d8875c88
Author: Michael Meeks 
AuthorDate: Thu Oct 19 15:15:33 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Oct 20 11:26:58 2023 +0200

sc: perf: avoid construction of collector for empty note columns.

It is extremely common to have empty note columns; so shorten this
path profile in: cool#7334

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

diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx
index 49420642bf5f..aeb38e00150a 100644
--- a/sc/source/core/data/column4.cxx
+++ b/sc/source/core/data/column4.cxx
@@ -860,7 +860,9 @@ public:
 
 void ScColumn::GetAllNoteEntries( std::vector& rNotes ) const
 {
-std::for_each(maCellNotes.begin(), maCellNotes.end(), 
NoteEntryCollector(rNotes, nTab, nCol, 0, GetDoc().MaxRow()));
+if (HasCellNotes())
+std::for_each(maCellNotes.begin(), maCellNotes.end(),
+  NoteEntryCollector(rNotes, nTab, nCol, 0, 
GetDoc().MaxRow()));
 }
 
 void ScColumn::GetNotesInRange(SCROW nStartRow, SCROW nEndRow,


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-10-13 Thread Noel Grandin (via logerrit)
 sc/source/ui/view/output2.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 5da82a87517819c4d3c3a87c09934ecdc51fc855
Author: Noel Grandin 
AuthorDate: Fri Oct 13 08:18:46 2023 +0200
Commit: Caolán McNamara 
CommitDate: Fri Oct 13 13:30:22 2023 +0200

cool#6893 disable undo for editengine when rendering cell text

We don't need undo functionality when performing pure cell text
rendering, shaves some CPU time off

Change-Id: Icfc688122af7e77c874dd984555b2b0951e9e134
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157882
Reviewed-by: Michael Meeks 
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 8543f2f517c7..3887f19b3d5c 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -2168,6 +2168,7 @@ std::unique_ptr 
ScOutputData::CreateOutputEditEngine()
 {
 std::unique_ptr pEngine(new ScFieldEditEngine(mpDoc, 
mpDoc->GetEnginePool()));
 pEngine->SetUpdateLayout( false );
+pEngine->EnableUndo( false ); // dont need undo for painting purposes
 // a RefDevice always has to be set, otherwise EditEngine would create a 
VirtualDevice
 pEngine->SetRefDevice( pFmtDevice );
 EEControlBits nCtrl = pEngine->GetControlWord();


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-10-06 Thread Caolán McNamara (via logerrit)
 sc/source/ui/navipi/navipi.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 140d02bb818c47795dcb89845150ce2b10194dc3
Author: Caolán McNamara 
AuthorDate: Fri Oct 6 13:01:12 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Oct 6 18:01:09 2023 +0200

cool#7373 the document doesn't change in online

the navigator always looks at the same document

calc should do like writer and have the navigator listen to just
the initial document until that dies. This is the safest option
to take for the scenario in question though.

Change-Id: Ic75cad4bb52f4d58ec58341fb8bed4c87ca9d90a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157622
Reviewed-by: Michael Meeks 
Tested-by: Jenkins CollaboraOffice 

diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index 037bc9b0836c..83a099659472 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -490,6 +490,11 @@ void ScNavigatorDlg::Notify( SfxBroadcaster&, const 
SfxHint& rHint )
 {
 if (rHint.GetId() == SfxHintId::ThisIsAnSfxEventHint)
 {
+// This is for when the document might change and the navigator
+// wants to update for the new document, which isn't a scenario
+// that happens in online.
+if (comphelper::LibreOfficeKit::isActive())
+return;
 const SfxEventHint& rEventHint = static_cast(rHint);
 if (rEventHint.GetEventId() == SfxEventHintId::ActivateDoc)
 {


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-10-05 Thread Caolán McNamara (via logerrit)
 sc/source/filter/xml/XMLExportIterator.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 70a13bda1fa686a3d615085bc6070c8032968d63
Author: Caolán McNamara 
AuthorDate: Thu Oct 5 14:27:45 2023 +0100
Commit: Caolán McNamara 
CommitDate: Thu Oct 5 17:43:30 2023 +0200

ubsan error seen export to ods

sc/source/filter/xml/XMLExportIterator.cxx:722:30: runtime error: load of 
value 5, which is not a valid value for type 'bool'

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

diff --git a/sc/source/filter/xml/XMLExportIterator.cxx 
b/sc/source/filter/xml/XMLExportIterator.cxx
index 6d8c408f19ec..bff7e8498642 100644
--- a/sc/source/filter/xml/XMLExportIterator.cxx
+++ b/sc/source/filter/xml/XMLExportIterator.cxx
@@ -712,7 +712,7 @@ bool ScMyNotEmptyCellsIterator::GetNext(ScMyCell& aCell, 
ScFormatRangeStyles* pC
 pDetectiveOp->SetCellData( aCell );
 
 HasAnnotation( aCell );
-bool bIsAutoStyle;
+bool bIsAutoStyle(false);
 // Ranges before the previous cell are not needed by 
ExportFormatRanges anymore and can be removed
 SCROW nRemoveBeforeRow = aLastAddress.Row();
 aCell.nStyleIndex = 
pCellStyles->GetStyleNameIndex(aCell.maCellAddress.Tab(),


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-09-27 Thread Caolán McNamara (via logerrit)
 sc/source/core/tool/numformat.cxx |   35 ++-
 1 file changed, 18 insertions(+), 17 deletions(-)

New commits:
commit f1e7d9726b09aeb8f0aece65a98298f4ef9022ed
Author: Caolán McNamara 
AuthorDate: Tue Sep 26 21:09:02 2023 +0100
Commit: Noel Grandin 
CommitDate: Wed Sep 27 14:00:33 2023 +0200

perf: NumFmtUtil::isLatinScript doesn't need to copy OUString

the original const OUString& from LocaleDataWrapper::getNumDecimalSep is
sufficient

aDecSep OUString dtor appeared as 2% of a sampled session

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

diff --git a/sc/source/core/tool/numformat.cxx 
b/sc/source/core/tool/numformat.cxx
index 8b8512339d43..c69da6de4e3b 100644
--- a/sc/source/core/tool/numformat.cxx
+++ b/sc/source/core/tool/numformat.cxx
@@ -27,6 +27,23 @@
 #include 
 #include 
 
+namespace
+{
+const OUString& getNumDecimalSep(const SvNumberformat& rFormat)
+{
+LanguageType nFormatLang = rFormat.GetLanguage();
+if (nFormatLang == LANGUAGE_SYSTEM)
+return ScGlobal::getLocaleData().getNumDecimalSep();
+// LocaleDataWrapper can be expensive to construct, so cache the 
result for
+// repeated calls
+static std::optional localeCache;
+if (!localeCache || localeCache->getLanguageTag().getLanguageType() != 
nFormatLang)
+localeCache.emplace(
+comphelper::getProcessComponentContext(), 
LanguageTag(nFormatLang));
+return localeCache->getNumDecimalSep();
+}
+}
+
 namespace sc {
 
 bool NumFmtUtil::isLatinScript( const ScPatternAttr& rPat, ScDocument& rDoc )
@@ -45,23 +62,7 @@ bool NumFmtUtil::isLatinScript( sal_uLong nFormat, 
ScDocument& rDoc )
 
 // The standard format is all-latin if the decimal separator doesn't
 // have a different script type
-
-OUString aDecSep;
-LanguageType nFormatLang = pFormat->GetLanguage();
-if (nFormatLang == LANGUAGE_SYSTEM)
-aDecSep = ScGlobal::getLocaleData().getNumDecimalSep();
-else
-{
-// LocaleDataWrapper can be expensive to construct, so cache the 
result for
-// repeated calls
-static std::optional localeCache;
-if (!localeCache || localeCache->getLanguageTag().getLanguageType() != 
nFormatLang)
-localeCache.emplace(
-comphelper::getProcessComponentContext(), 
LanguageTag(nFormatLang));
-aDecSep = localeCache->getNumDecimalSep();
-}
-
-SvtScriptType nScript = rDoc.GetStringScriptType(aDecSep);
+SvtScriptType nScript = 
rDoc.GetStringScriptType(getNumDecimalSep(*pFormat));
 return (nScript == SvtScriptType::NONE || nScript == SvtScriptType::LATIN);
 }
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-09-27 Thread Noel Grandin (via logerrit)
 sc/source/core/tool/numformat.cxx |   11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

New commits:
commit 79e723cde11d2eba6d45d6c89a3d3109062e675c
Author: Noel Grandin 
AuthorDate: Tue Jun 13 22:04:09 2023 +0200
Commit: Noel Grandin 
CommitDate: Wed Sep 27 08:00:21 2023 +0200

tdf#151946 cache LocaleDataWrapper

because it is a little more expensive these days to create it, since I
made it an immutable type (which is also why we can safely cache it)

Reduces load time from 7s to 1.5s for me

Change-Id: I583381f0ee5494b8edf746b2329ac5751a9e5d86
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153006
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157301
Tested-by: Jenkins CollaboraOffice 

diff --git a/sc/source/core/tool/numformat.cxx 
b/sc/source/core/tool/numformat.cxx
index 8240c1ac6e4f..8b8512339d43 100644
--- a/sc/source/core/tool/numformat.cxx
+++ b/sc/source/core/tool/numformat.cxx
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace sc {
 
@@ -51,9 +52,13 @@ bool NumFmtUtil::isLatinScript( sal_uLong nFormat, 
ScDocument& rDoc )
 aDecSep = ScGlobal::getLocaleData().getNumDecimalSep();
 else
 {
-LocaleDataWrapper aLocaleData(
-comphelper::getProcessComponentContext(), 
LanguageTag(nFormatLang));
-aDecSep = aLocaleData.getNumDecimalSep();
+// LocaleDataWrapper can be expensive to construct, so cache the 
result for
+// repeated calls
+static std::optional localeCache;
+if (!localeCache || localeCache->getLanguageTag().getLanguageType() != 
nFormatLang)
+localeCache.emplace(
+comphelper::getProcessComponentContext(), 
LanguageTag(nFormatLang));
+aDecSep = localeCache->getNumDecimalSep();
 }
 
 SvtScriptType nScript = rDoc.GetStringScriptType(aDecSep);


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-09-13 Thread Tomaž Vajngerl (via logerrit)
 sc/source/filter/oox/sheetdatacontext.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c148e51c446855cc751e955652081578f57e63d3
Author: Tomaž Vajngerl 
AuthorDate: Tue Sep 12 14:34:03 2023 +0200
Commit: Miklos Vajna 
CommitDate: Wed Sep 13 08:09:57 2023 +0200

sc: row import - default style index is 0 and not -1

When importing CT_Row structure, the style index is 0 by default
and not -1. The effect of this is that the style is not applied
for the rows, because the index is -1. With the change to 0, the
style applied is the first style, which is the correct behaviour
and this fixes the issue with the test document.

Change-Id: If5ab571e8dd7ec1319e7cb4d26ba006ca827eca6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156845
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 2412ae8d8854a96bd3dc423e199c6356355cde83)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156748
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sc/source/filter/oox/sheetdatacontext.cxx 
b/sc/source/filter/oox/sheetdatacontext.cxx
index bc5855e9f4b7..19ad0a2a3465 100644
--- a/sc/source/filter/oox/sheetdatacontext.cxx
+++ b/sc/source/filter/oox/sheetdatacontext.cxx
@@ -279,7 +279,7 @@ void SheetDataContext::importRow( const AttributeList& 
rAttribs )
 mnCol = -1;
 
 aModel.mfHeight   = rAttribs.getDouble( XML_ht, -1.0 );
-aModel.mnXfId = rAttribs.getInteger( XML_s, -1 );
+aModel.mnXfId = rAttribs.getInteger(XML_s, 0); // default style index is 0
 aModel.mnLevel= rAttribs.getInteger( XML_outlineLevel, 0 );
 aModel.mbCustomHeight = rAttribs.getBool( XML_customHeight, false );
 aModel.mbCustomFormat = rAttribs.getBool( XML_customFormat, false );


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-09-12 Thread Dennis Francis (via logerrit)
 sc/source/ui/dbgui/pvfundlg.cxx |   18 +++---
 sc/source/ui/inc/pvfundlg.hxx   |1 -
 2 files changed, 3 insertions(+), 16 deletions(-)

New commits:
commit 88afeef7cf58863707ea9fe404fdc3942e74e55b
Author: Dennis Francis 
AuthorDate: Mon Sep 11 17:49:32 2023 +0530
Commit: Dennis Francis 
CommitDate: Tue Sep 12 16:09:00 2023 +0200

sc:pivot allow sort by selection in non-manual mode

Otherwise it is currently impossible to sort a field by its data
summarization values.

The RadioClickHdl is now doing nothing hence is removed with this
change.

Change-Id: I76064ce05e5b996ad96f596524be351708ef35e4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156823
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 

diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx
index f74bb4b7391d..7f97e2576795 100644
--- a/sc/source/ui/dbgui/pvfundlg.cxx
+++ b/sc/source/ui/dbgui/pvfundlg.cxx
@@ -703,9 +703,11 @@ void ScDPSubtotalOptDlg::FillLabelData( ScDPLabelData& 
rLabelData ) const
 {
 rLabelData.maSortInfo.Field =
 ScDPUtil::createDuplicateDimensionName(aFieldName.maName, 
aFieldName.mnDupCount);
-rLabelData.maSortInfo.IsAscending = m_xRbSortAsc->get_active();
 }
 
+if (rLabelData.maSortInfo.Mode != DataPilotFieldSortMode::MANUAL)
+rLabelData.maSortInfo.IsAscending = m_xRbSortAsc->get_active();
+
 // *** LAYOUT MODE ***
 
 rLabelData.maLayoutInfo.LayoutMode = 
ToDataPilotFieldLayoutMode(m_xLbLayout->get_active());
@@ -769,11 +771,6 @@ void ScDPSubtotalOptDlg::Init( const ScDPNameVec& 
rDataFields, bool bEnableLayou
 }
 m_xLbSortBy->set_active(nSortPos);
 
-// sorting mode
-m_xRbSortAsc->connect_toggled( LINK( this, ScDPSubtotalOptDlg, 
RadioClickHdl ) );
-m_xRbSortDesc->connect_toggled( LINK( this, ScDPSubtotalOptDlg, 
RadioClickHdl ) );
-m_xRbSortMan->connect_toggled( LINK( this, ScDPSubtotalOptDlg, 
RadioClickHdl ) );
-
 weld::RadioButton* pRBtn = nullptr;
 switch( nSortMode )
 {
@@ -785,7 +782,6 @@ void ScDPSubtotalOptDlg::Init( const ScDPNameVec& 
rDataFields, bool bEnableLayou
 pRBtn = maLabelData.maSortInfo.IsAscending ? m_xRbSortAsc.get() : 
m_xRbSortDesc.get();
 }
 pRBtn->set_active(true);
-RadioClickHdl(*pRBtn);
 
 // *** LAYOUT MODE ***
 
@@ -879,14 +875,6 @@ IMPL_LINK(ScDPSubtotalOptDlg, ButtonClicked, 
weld::Button&, rButton, void)
 response(RET_CANCEL);
 }
 
-IMPL_LINK(ScDPSubtotalOptDlg, RadioClickHdl, weld::Toggleable&, rBtn, void)
-{
-if (!rBtn.get_active())
-return;
-
-m_xLbSortBy->set_sensitive(m_xRbSortMan->get_active());
-}
-
 IMPL_LINK(ScDPSubtotalOptDlg, CheckHdl, weld::Toggleable&, rCBox, void)
 {
 if ( == m_xCbShow.get())
diff --git a/sc/source/ui/inc/pvfundlg.hxx b/sc/source/ui/inc/pvfundlg.hxx
index f5f140c54cdf..146048cfedbf 100644
--- a/sc/source/ui/inc/pvfundlg.hxx
+++ b/sc/source/ui/inc/pvfundlg.hxx
@@ -150,7 +150,6 @@ private:
 /** Searches for a listbox entry, starts search at specified position. */
 sal_Int32 FindListBoxEntry( const weld::ComboBox& rLBox, 
std::u16string_view rEntry, sal_Int32 nStartPos ) const;
 
-DECL_LINK( RadioClickHdl, weld::Toggleable&, void );
 DECL_LINK( CheckHdl, weld::Toggleable&, void );
 DECL_LINK( SelectHdl, weld::ComboBox&, void );
 DECL_LINK( ButtonClicked, weld::Button&, void );


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-09-05 Thread Aron Budea (via logerrit)
 sc/source/ui/view/tabview2.cxx |   10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

New commits:
commit 8f822b7032c98d37bd0cb7cb010f0375444f4f31
Author: Aron Budea 
AuthorDate: Mon Sep 4 03:15:13 2023 +0200
Commit: Aron Budea 
CommitDate: Tue Sep 5 11:14:00 2023 +0200

sc: ui: view: Use conditional assignment

Change-Id: I51ba012079a955c139a0c55f12a4b141ba536aa6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156502
Tested-by: Jenkins
Reviewed-by: Henry Castro 
(cherry picked from commit 4d8cff696cfdb23733b0e91348b28a83f1c3bedc)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156538
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Aron Budea 

diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index 308e734f95a0..d2293ff94f36 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -217,10 +217,7 @@ void moveRefByCell(SCCOL& rNewX, SCROW& rNewY,
 SCCOL nTempX = rNewX;
 while (rDoc.IsHorOverlapped(nTempX, rNewY, nRefTab))
 {
-if (nMovX > 0)
-++nTempX;
-else
---nTempX;
+nTempX = (nMovX > 0) ? nTempX + 1 : nTempX - 1;
 if (!checkBoundary(, nTempX, rNewY))
 break;
 }
@@ -242,10 +239,7 @@ void moveRefByCell(SCCOL& rNewX, SCROW& rNewY,
 SCROW nTempY = rNewY;
 while (rDoc.IsVerOverlapped(rNewX, nTempY, nRefTab))
 {
-if (nMovY > 0)
-++nTempY;
-else
---nTempY;
+nTempY = (nMovY > 0) ? nTempY + 1 : nTempY - 1;
 if (!checkBoundary(, rNewX, nTempY))
 break;
 }


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-08-30 Thread Michael Meeks (via logerrit)
 sc/source/ui/app/inputwin.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 2721148fe36aaab9c2eed6c52a4afde7a868e29d
Author: Michael Meeks 
AuthorDate: Tue Aug 29 22:08:42 2023 +0100
Commit: Caolán McNamara 
CommitDate: Wed Aug 30 10:29:52 2023 +0200

lok: avoid forcing expensive re-layout of the calc input bar.

This occured on doc_setView and was unreasonably expensive - loading and
de-compressing new PNGs as multiple users typed, re-sizing and
re-rendering a toolbar that is not visible -> do nothing here.

cf. cool#6893.

Change-Id: I1980a3a4516fb2aa629da85de9d4628f29de5af7
Signed-off-by: Michael Meeks 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156219
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 07a4cd93a836..1afa94c23822 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1104,6 +1104,10 @@ void ScInputBarGroup::NumLinesChanged()
 
 void ScInputBarGroup::TriggerToolboxLayout()
 {
+// layout changes are expensive and un-necessary.
+if (comphelper::LibreOfficeKit::isActive())
+return;
+
 vcl::Window *w=GetParent();
 ScInputWindow  = dynamic_cast(*w);
 SfxViewFrame* pViewFrm = SfxViewFrame::Current();


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-08-28 Thread Tomaž Vajngerl (via logerrit)
 sc/source/filter/excel/xestyle.cxx  |   96 ++--
 sc/source/filter/inc/export/ExportTools.hxx |   38 +++
 2 files changed, 59 insertions(+), 75 deletions(-)

New commits:
commit 2f9385f184f39d70d55c301a1173dc5eedd60979
Author: Tomaž Vajngerl 
AuthorDate: Sat Jul 29 15:42:32 2023 +0200
Commit: Mike Kaganski 
CommitDate: Mon Aug 28 12:40:43 2023 +0200

sc: remove code duplication at OOXML export of ComplexColor

This removes the code duplication when exporting the ComplexColor
to OOXML. Now we use a common oox::xls::writeComplexColor function
which writes a ComplexColor to the stream.

Change-Id: I4e7bb1f8427409d09550c71894c327dba5096bec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155110
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit fc996d8d195263f09d8aaf65deaf9d42f7413be8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156103
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Mike Kaganski 

diff --git a/sc/source/filter/excel/xestyle.cxx 
b/sc/source/filter/excel/xestyle.cxx
index 403121ffec37..50db4781f1d4 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -49,6 +49,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -1852,29 +1853,17 @@ static void lcl_WriteBorder(XclExpXmlStream& rStrm, 
sal_Int32 nElement, sal_uInt
 if( nLineStyle == EXC_LINE_NONE )
 {
 rStyleSheet->singleElement(nElement);
-}
-else if (rComplexColor.isValidSchemeType())
-{
-rStyleSheet->startElement(nElement, XML_style, 
ToLineStyle(nLineStyle));
-
-sal_Int32 nTheme = 
oox::convertThemeColorTypeToExcelThemeNumber(rComplexColor.getSchemeType());
-double fTintShade = 
oox::convertColorTransformsToTintOrShade(rComplexColor);
-rStyleSheet->singleElement(XML_color,
-XML_theme, OString::number(nTheme),
-XML_tint, 
sax_fastparser::UseIf(OString::number(fTintShade), fTintShade != 0.0));
-
-rStyleSheet->endElement(nElement);
+return;
 }
 else if (rColor == Color(0, 0, 0))
 {
 rStyleSheet->singleElement(nElement, XML_style, 
ToLineStyle(nLineStyle));
+return;
 }
-else
-{
-rStyleSheet->startElement(nElement, XML_style, 
ToLineStyle(nLineStyle));
-rStyleSheet->singleElement(XML_color, XML_rgb, 
XclXmlUtils::ToOString(rColor));
-rStyleSheet->endElement( nElement );
-}
+
+rStyleSheet->startElement(nElement, XML_style, ToLineStyle(nLineStyle));
+oox::xls::writeComplexColor(rStyleSheet, XML_color, rComplexColor, rColor);
+rStyleSheet->endElement(nElement);
 }
 
 void XclExpCellBorder::SaveXml(XclExpXmlStream& rStream) const
@@ -2004,62 +1993,27 @@ void XclExpCellArea::SaveXml( XclExpXmlStream& rStrm ) 
const
 
 if (maForeColor != COL_TRANSPARENT || maBackColor != COL_TRANSPARENT)
 {
-if (maForegroundComplexColor.isValidSchemeType())
-{
-sal_Int32 nTheme = 
oox::convertThemeColorTypeToExcelThemeNumber(maForegroundComplexColor.getSchemeType());
-double fTintShade = 
oox::convertColorTransformsToTintOrShade(maForegroundComplexColor);
-rStyleSheet->singleElement(XML_fgColor,
-XML_theme, OString::number(nTheme),
-XML_tint, 
sax_fastparser::UseIf(OString::number(fTintShade), fTintShade != 0.0));
-}
-else if (maForeColor != COL_TRANSPARENT)
-{
-rStyleSheet->singleElement(XML_fgColor, XML_rgb, 
XclXmlUtils::ToOString(maForeColor));
-}
-
-if (maBackgroundComplexColor.isValidSchemeType())
-{
-sal_Int32 nTheme = 
oox::convertThemeColorTypeToExcelThemeNumber(maBackgroundComplexColor.getSchemeType());
-double fTintShade = 
oox::convertColorTransformsToTintOrShade(maBackgroundComplexColor);
-rStyleSheet->singleElement(XML_bgColor,
-XML_theme, OString::number(nTheme),
-XML_tint, 
sax_fastparser::UseIf(OString::number(fTintShade), fTintShade != 0.0));
-}
-else if (maBackColor != COL_TRANSPARENT)
-{
-rStyleSheet->singleElement(XML_bgColor, XML_rgb, 
XclXmlUtils::ToOString(maBackColor));
-}
+oox::xls::writeComplexColor(rStyleSheet, XML_fgColor, 
maForegroundComplexColor, maForeColor);
+oox::xls::writeComplexColor(rStyleSheet, XML_bgColor, 
maBackgroundComplexColor, maBackColor);
 }
 else
 {
-if (maForegroundComplexColor.isValidSchemeType())
-{
-sal_Int32 nTheme = 
oox::convertThemeColorTypeToExcelThemeNumber(maForegroundComplexColor.getSchemeType());
-double fTintShade = 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-08-28 Thread Tomaž Vajngerl (via logerrit)
 sc/source/filter/inc/stylesbuffer.hxx  |   18 +-
 sc/source/filter/inc/viewsettings.hxx  |2 +-
 sc/source/filter/inc/worksheetsettings.hxx |4 ++--
 sc/source/filter/oox/stylesbuffer.cxx  |   27 +++
 4 files changed, 27 insertions(+), 24 deletions(-)

New commits:
commit fb1660e1360c5331b3e7a7411eb07f45951a8cd7
Author: Tomaž Vajngerl 
AuthorDate: Fri Jul 28 17:01:42 2023 +0200
Commit: Mike Kaganski 
CommitDate: Mon Aug 28 12:40:26 2023 +0200

sc: rename oox::xls::Color to oox::xls::XlsColor

It's annoying that the class name is so similar to the commonly
used class Color, even when it is in its own namespace. To avoid
unneccesary conflicts and confusion, it was renamed.

(Similar would be also good for oox::drawingml::Color)

Change-Id: I68dcaf951b7faf089cb2b13d94576007f40c441e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155109
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 7f265875ef784d717f5a534bdca2cd36fdce7ecb)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156102
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Mike Kaganski 

diff --git a/sc/source/filter/inc/stylesbuffer.hxx 
b/sc/source/filter/inc/stylesbuffer.hxx
index b454f8bb3f39..c462da48ee20 100644
--- a/sc/source/filter/inc/stylesbuffer.hxx
+++ b/sc/source/filter/inc/stylesbuffer.hxx
@@ -85,7 +85,7 @@ public:
 virtual ::Color getPaletteColor( sal_Int32 nPaletteIdx ) const 
override;
 };
 
-class Color : public ::oox::drawingml::Color
+class XlsColor : public ::oox::drawingml::Color
 {
 public:
 /** Sets the color to automatic. */
@@ -109,7 +109,7 @@ public:
 bool isAuto() const { return isPlaceHolder(); }
 };
 
-SequenceInputStream& operator>>( SequenceInputStream& rStrm, Color& orColor );
+SequenceInputStream& operator>>( SequenceInputStream& rStrm, XlsColor& orColor 
);
 
 /** Stores all colors of the color palette. */
 class ColorPalette : public WorkbookHelper
@@ -138,8 +138,8 @@ private:
 /** Contains all XML font attributes, e.g. from a font or rPr element. */
 struct FontModel
 {
-OUString maName; /// Font name.
-Color   maColor;/// Font color.
+OUString maName;  /// Font name.
+XlsColor maColor; /// Font color.
 sal_Int32   mnScheme;   /// Major/minor scheme font.
 sal_Int32   mnFamily;   /// Font family.
 sal_Int32   mnCharSet;  /// Windows font character set.
@@ -380,7 +380,7 @@ private:
 /** Contains XML attributes of a single border line. */
 struct BorderLineModel
 {
-Color   maColor;/// Borderline color.
+XlsColor maColor; /// Borderline color.
 sal_Int32   mnStyle;/// Border line style.
 boolmbUsed; /// True = line format used.
 
@@ -473,9 +473,9 @@ typedef std::shared_ptr< Border > BorderRef;
 /** Contains XML pattern fill attributes from the patternFill element. */
 struct PatternFillModel
 {
-Color   maPatternColor; /// Pattern foreground color.
-Color   maFilterPatternColor; /// Pattern foreground for color 
filter.
-Color   maFillColor;/// Background fill color.
+XlsColor maPatternColor; /// Pattern foreground color.
+XlsColor maFilterPatternColor; /// Pattern foreground for color filter.
+XlsColor maFillColor;/// Background fill color.
 sal_Int32   mnPattern;  /// Pattern identifier (e.g. 
solid).
 boolmbPattColorUsed;/// True = pattern foreground 
color used.
 boolmbFillColorUsed;/// True = background fill color 
used.
@@ -490,7 +490,7 @@ struct PatternFillModel
 /** Contains XML gradient fill attributes from the gradientFill element. */
 struct GradientFillModel
 {
-typedef ::std::map< double, Color > ColorMap;
+typedef ::std::map ColorMap;
 
 sal_Int32   mnType; /// Gradient type, linear or path.
 double  mfAngle;/// Rotation angle for type linear.
diff --git a/sc/source/filter/inc/viewsettings.hxx 
b/sc/source/filter/inc/viewsettings.hxx
index 2382f5b54112..70797967afd1 100644
--- a/sc/source/filter/inc/viewsettings.hxx
+++ b/sc/source/filter/inc/viewsettings.hxx
@@ -42,7 +42,7 @@ struct SheetViewModel
 typedef RefMap< sal_Int32, PaneSelectionModel > PaneSelectionModelMap;
 
 PaneSelectionModelMap maPaneSelMap; /// Selections of all 
panes.
-Color   maGridColor;/// Grid color.
+XlsColor maGridColor; /// Grid color.
 ScAddress   maFirstPos;/// First visible cell.
 ScAddress   maSecondPos;   /// First visible cell in additional 
panes.
 sal_Int32   mnWorkbookViewId;   /// Index into list of 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-08-25 Thread Tomaž Vajngerl (via logerrit)
 sc/source/ui/theme/ThemeColorChanger.cxx |   13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 468d6d6af6249a67aed206b3d1b4614433fbbcc2
Author: Tomaž Vajngerl 
AuthorDate: Tue Jul 4 00:44:15 2023 +0900
Commit: Miklos Vajna 
CommitDate: Fri Aug 25 10:33:36 2023 +0200

sc: change theme color for SdrObjects

Change-Id: I318821c843fe937b7011f1674809f8c78df24a2d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153938
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 30ee52e6c284be1095fdf278439b4c0a7c5982f0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156076
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sc/source/ui/theme/ThemeColorChanger.cxx 
b/sc/source/ui/theme/ThemeColorChanger.cxx
index a245f7b0c1c0..8eaa6ed0fcb6 100644
--- a/sc/source/ui/theme/ThemeColorChanger.cxx
+++ b/sc/source/ui/theme/ThemeColorChanger.cxx
@@ -18,6 +18,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -129,9 +130,9 @@ void 
ThemeColorChanger::apply(std::shared_ptr const& pColorSet)
 pStyle = static_cast(pPool->Next());
 }
 
-// Change Cell / Text attributes
 for (SCTAB nTab = 0; nTab < rDocument.GetTableCount(); nTab++)
 {
+// Change Cell / Text attributes
 ScDocAttrIterator aAttributeIterator(rDocument, nTab, 0, 0, 
rDocument.MaxCol(),
  rDocument.MaxRow());
 SCCOL nCol = 0;
@@ -144,6 +145,16 @@ void 
ThemeColorChanger::apply(std::shared_ptr const& pColorSet)
 auto& rItemSet = pNonConstPattern->GetItemSet();
 changeCellItems(rItemSet, *pColorSet);
 }
+
+// Change all SdrObjects
+SdrPage* pPage = 
rDocument.GetDrawLayer()->GetPage(static_cast(nTab));
+SdrObjListIter aIter(pPage, SdrIterMode::DeepNoGroups);
+SdrObject* pObject = aIter.Next();
+while (pObject)
+{
+svx::theme::updateSdrObject(*pColorSet, pObject);
+pObject = aIter.Next();
+}
 }
 }
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-08-25 Thread Tomaž Vajngerl (via logerrit)
 sc/source/ui/drawfunc/drawsh.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 59bf914bf96b27f5aa4cb26c652ee0ba702fd45b
Author: Tomaž Vajngerl 
AuthorDate: Tue Jul 4 00:38:01 2023 +0900
Commit: Miklos Vajna 
CommitDate: Fri Aug 25 10:32:53 2023 +0200

sc: fix failed assert in when setting a color on a shape

When setting a color with a colorpicker, and assert failed,
because it's not possible to clone a SfxItemSet by value - use
a plane Clone instead, which clones into a SfxItemSet.

Change-Id: I8780ed42d3807e9802d3f4fa1d68e16bd5d5a5e6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153937
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 548e5b6d825606bd218ef18591df642872e6acd0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156070
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index 60570c9cb669..652e25083090 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -289,9 +289,9 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
 
 if( pView->AreObjectsMarked() )
 {
-SfxItemSet aNewArgs = rReq.GetArgs()->CloneAsValue();
-lcl_convertStringArguments( rReq.GetSlot(), aNewArgs );
-pView->SetAttrToMarked( aNewArgs, false );
+std::unique_ptr aNewArgs = 
rReq.GetArgs()->Clone();
+lcl_convertStringArguments(rReq.GetSlot(), *aNewArgs);
+pView->SetAttrToMarked(*aNewArgs, false);
 }
 else
 pView->SetDefaultAttr( *rReq.GetArgs(), false);


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-08-25 Thread Tomaž Vajngerl (via logerrit)
 sc/source/filter/excel/excdoc.cxx |   26 ++
 sc/source/filter/oox/workbookfragment.cxx |8 
 2 files changed, 34 insertions(+)

New commits:
commit 4d9bd4dbc1261d21e10f81942b2fcf9e4b283f38
Author: Tomaž Vajngerl 
AuthorDate: Fri Jun 30 00:47:27 2023 +0900
Commit: Miklos Vajna 
CommitDate: Fri Aug 25 10:30:34 2023 +0200

sc: OOXML import and export the model::Theme properly

Change-Id: I76fc928a53d007a9f5e9174167e0594208a4b47a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153784
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 9a6cdc8a90cd32e8d9ecdae6fb6684cfa8aadbab)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156068
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sc/source/filter/excel/excdoc.cxx 
b/sc/source/filter/excel/excdoc.cxx
index c01dde32981c..cdee12a7c11c 100644
--- a/sc/source/filter/excel/excdoc.cxx
+++ b/sc/source/filter/excel/excdoc.cxx
@@ -53,6 +53,10 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
 #include 
 
 using namespace oox;
@@ -861,6 +865,28 @@ void ExcDocument::WriteXml( XclExpXmlStream& rStrm )
 {
 InitializeSave();
 
+auto* pDrawLayer = GetDoc().GetDrawLayer();
+if (pDrawLayer)
+{
+SdrPage* pPage = pDrawLayer->GetPage(0);
+if (pPage)
+{
+std::shared_ptr pTheme = 
pPage->getSdrPageProperties().GetTheme();
+if (pTheme)
+{
+OUString sThemeRelationshipPath = "theme/theme1.xml";
+OUString sThemeDocumentPath = "xl/" + 
sThemeRelationshipPath;
+
+oox::ThemeExport aThemeExport(, 
oox::drawingml::DOCUMENT_XLSX);
+aThemeExport.write(sThemeDocumentPath, *pTheme);
+
+
rStrm.addRelation(rStrm.GetCurrentStream()->getOutputStream(),
+  
oox::getRelationship(Relationship::THEME),
+  sThemeRelationshipPath);
+}
+}
+}
+
 aHeader.WriteXml( rStrm );
 
 for( size_t nTab = 0, nTabCount = maTableList.GetSize(); nTab < 
nTabCount; ++nTab )
diff --git a/sc/source/filter/oox/workbookfragment.cxx 
b/sc/source/filter/oox/workbookfragment.cxx
index b86c15def16b..08df44404eb4 100644
--- a/sc/source/filter/oox/workbookfragment.cxx
+++ b/sc/source/filter/oox/workbookfragment.cxx
@@ -64,6 +64,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -486,6 +487,12 @@ void WorkbookFragment::finalizeImport()
 // load all worksheets
 importSheetFragments(*this, aSheetFragments);
 
+SdrPage* pPage = pModel->GetPage(0);
+if (pPage && pTheme && !pTheme->GetName().isEmpty())
+{
+pPage->getSdrPageProperties().SetTheme(pTheme);
+}
+
 // assumes getTables().finalizeImport ( which creates the DatabaseRanges )
 // has been called already
 getTables().applyAutoFilters();
@@ -512,6 +519,7 @@ void WorkbookFragment::finalizeImport()
 rxSheetGlob.reset();
 }
 
+
 getDocImport().finalize();
 
 recalcFormulaCells();


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-08-24 Thread Tomaž Vajngerl (via logerrit)
 sc/source/ui/theme/ThemeColorChanger.cxx |   36 +++
 1 file changed, 36 insertions(+)

New commits:
commit 50e0a91c6907bab1a82e66bbc24e55621e673088
Author: Tomaž Vajngerl 
AuthorDate: Fri Jun 23 13:49:24 2023 +0900
Commit: Miklos Vajna 
CommitDate: Thu Aug 24 16:42:27 2023 +0200

sc: ThemeColorChanger - change theme color for borders

Change-Id: Id6b08ad48b496d2f1138aeea8d024a5f61bee633
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153500
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 95d199e3d1a04a469e1d22896ffd967c7a06c3f0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156027
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sc/source/ui/theme/ThemeColorChanger.cxx 
b/sc/source/ui/theme/ThemeColorChanger.cxx
index 2211aa67b554..a245f7b0c1c0 100644
--- a/sc/source/ui/theme/ThemeColorChanger.cxx
+++ b/sc/source/ui/theme/ThemeColorChanger.cxx
@@ -16,6 +16,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -35,6 +37,26 @@ ThemeColorChanger::~ThemeColorChanger() = default;
 
 namespace
 {
+bool changeBorderLine(editeng::SvxBorderLine* pBorderLine, model::ColorSet 
const& rColorSet)
+{
+if (!pBorderLine)
+return false;
+
+model::ComplexColor const& rComplexColor = pBorderLine->getComplexColor();
+if (rComplexColor.meType == model::ColorType::Scheme)
+{
+auto eThemeType = rComplexColor.meSchemeType;
+
+if (eThemeType != model::ThemeColorType::Unknown)
+{
+Color aColor = rColorSet.resolveColor(rComplexColor);
+pBorderLine->SetColor(aColor);
+return true;
+}
+}
+return false;
+}
+
 void changeCellItems(SfxItemSet& rItemSet, model::ColorSet const& rColorSet)
 {
 const SfxPoolItem* pItem = nullptr;
@@ -75,6 +97,20 @@ void changeCellItems(SfxItemSet& rItemSet, model::ColorSet 
const& rColorSet)
 }
 }
 }
+if (rItemSet.HasItem(ATTR_BORDER, ))
+{
+auto const* pBoxItem = static_cast(pItem);
+SvxBoxItem rNewItem(*pBoxItem);
+bool bChanged = false;
+
+bChanged = changeBorderLine(rNewItem.GetBottom(), rColorSet) || 
bChanged;
+bChanged = changeBorderLine(rNewItem.GetTop(), rColorSet) || bChanged;
+bChanged = changeBorderLine(rNewItem.GetLeft(), rColorSet) || bChanged;
+bChanged = changeBorderLine(rNewItem.GetRight(), rColorSet) || 
bChanged;
+
+if (bChanged)
+rItemSet.Put(rNewItem);
+}
 }
 } // end anonymous ns
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-08-12 Thread Caolán McNamara (via logerrit)
 sc/source/filter/inc/workbookhelper.hxx |   48 +++
 sc/source/filter/oox/stylesbuffer.cxx   |   97 +++-
 sc/source/filter/oox/workbookhelper.cxx |8 ++
 3 files changed, 115 insertions(+), 38 deletions(-)

New commits:
commit bf2734bbe3c35b0ecbf1a24a77824ffd61a71f3f
Author: Caolán McNamara 
AuthorDate: Thu Aug 10 21:49:59 2023 +0100
Commit: Noel Grandin 
CommitDate: Sat Aug 12 22:00:09 2023 +0200

xlsx with a lot of comments repeatedly calls OutputDevice::HasGlyphs

on the same font over and over again getting the same results

Change-Id: I0c301e3fd4c1838645c25d4f6f7b330acc988135
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155569
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
(cherry picked from commit e3caea16a9a1ac6749f38cfdbf463184f64e64df)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155592
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Noel Grandin 

diff --git a/sc/source/filter/inc/workbookhelper.hxx 
b/sc/source/filter/inc/workbookhelper.hxx
index 0234c50252ff..ba046e40dab9 100644
--- a/sc/source/filter/inc/workbookhelper.hxx
+++ b/sc/source/filter/inc/workbookhelper.hxx
@@ -21,10 +21,14 @@
 
 #include 
 #include 
+#include 
 
+#include 
 #include 
 #include 
 
+#include 
+
 namespace oox::drawingml::chart { class ChartConverter; }
 namespace rtl { template  class Reference; }
 
@@ -57,6 +61,22 @@ class ScRangeData;
 
 namespace oox::xls {
 
+enum class FontClassification : sal_uInt8
+{
+None= 0x,
+Asian   = 0x0001,
+Cmplx   = 0x0002,
+Latin   = 0x0004
+};
+
+}
+
+namespace o3tl {
+template<> struct typed_flags : 
is_typed_flags {};
+}
+
+namespace oox::xls {
+
 class ExcelFilter;
 
 /** Functor for case-insensitive string comparison, usable in maps etc. */
@@ -87,6 +107,32 @@ class FormulaBuffer;
 class WorkbookGlobals;
 typedef std::shared_ptr< WorkbookGlobals > WorkbookGlobalsRef;
 
+struct FontDescriptorHash
+{
+size_t operator()( const css::awt::FontDescriptor& rKey) const
+{
+std::size_t seed = rKey.Name.hashCode();
+o3tl::hash_combine(seed, rKey.Height);
+o3tl::hash_combine(seed, rKey.Width);
+o3tl::hash_combine(seed, rKey.StyleName.hashCode());
+o3tl::hash_combine(seed, rKey.Family);
+o3tl::hash_combine(seed, rKey.CharSet);
+o3tl::hash_combine(seed, rKey.Pitch);
+o3tl::hash_combine(seed, rKey.CharacterWidth);
+o3tl::hash_combine(seed, rKey.Weight);
+o3tl::hash_combine(seed, rKey.Slant);
+o3tl::hash_combine(seed, rKey.Underline);
+o3tl::hash_combine(seed, rKey.Strikeout);
+o3tl::hash_combine(seed, rKey.Orientation);
+o3tl::hash_combine(seed, rKey.Kerning);
+o3tl::hash_combine(seed, rKey.WordLineMode);
+o3tl::hash_combine(seed, rKey.Type);
+return seed;
+}
+};
+
+typedef std::unordered_map FontClassificationMap;
+
 /** Helper class to provide access to global workbook data.
 
 All classes derived from this helper class will have access to a singleton
@@ -233,6 +279,8 @@ public:
 PivotCacheBuffer&   getPivotCaches() const;
 /** Returns the collection of pivot tables. */
 PivotTableBuffer&   getPivotTables() const;
+/** Shared cache of Font Classifications to avoid repeated lookups */
+FontClassificationMap& getFontClassificationCache() const;
 
 // converters -
 
diff --git a/sc/source/filter/oox/stylesbuffer.cxx 
b/sc/source/filter/oox/stylesbuffer.cxx
index e0c99ccb7a65..47dd75f34425 100644
--- a/sc/source/filter/oox/stylesbuffer.cxx
+++ b/sc/source/filter/oox/stylesbuffer.cxx
@@ -790,44 +790,65 @@ void Font::finalizeImport()
 if( !maUsedFlags.mbNameUsed )
 return;
 
-PropertySet aDocProps( getDocument() );
-Reference< XDevice > xDevice( aDocProps.getAnyProperty( 
PROP_ReferenceDevice ), UNO_QUERY );
-if( !xDevice.is() )
-return;
-
-Reference< XFont2 > xFont( xDevice->getFont( maApiData.maDesc ), UNO_QUERY 
);
-if( !xFont.is() )
-return;
-
-// #91658# CJK fonts
-bool bHasAsian =
-xFont->hasGlyphs( OUString( u'\x3041' ) ) ||// 3040-309F: Hiragana
-xFont->hasGlyphs( OUString( u'\x30A1' ) ) ||// 30A0-30FF: Katakana
-xFont->hasGlyphs( OUString( u'\x3111' ) ) ||// 3100-312F: Bopomofo
-xFont->hasGlyphs( OUString( u'\x3131' ) ) ||// 3130-318F: Hangul 
Compatibility Jamo
-xFont->hasGlyphs( OUString( u'\x3301' ) ) ||// 3300-33FF: CJK 
Compatibility
-xFont->hasGlyphs( OUString( u'\x3401' ) ) ||// 3400-4DBF: CJK 
Unified Ideographs Extension A
-xFont->hasGlyphs( OUString( u'\x4E01' ) ) ||// 4E00-9FFF: CJK 
Unified Ideographs
-xFont->hasGlyphs( OUString( u'\x7E01' ) ) ||// 4E00-9FFF: CJK 
Unified Ideographs
-

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-08-11 Thread Henry Castro (via logerrit)
 sc/source/ui/view/tabview4.cxx |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit eee7a3c165aaa60e70d0bab9ab29fab71078abbe
Author: Henry Castro 
AuthorDate: Fri Aug 11 09:11:09 2023 -0400
Commit: Henry Castro 
CommitDate: Fri Aug 11 16:21:54 2023 +0200

tdf#155799: sc: fix input formula reference

If the start point reference mark is selected
with mouse direction up, it should extend to show
the correct input formula reference.

Signed-off-by: Henry Castro 
Change-Id: I41f2ea52bf7de341eccadfba80e91fd76a6fd2de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155618
Reviewed-by: Tomaž Vajngerl 
Tested-by: Jenkins CollaboraOffice 

diff --git a/sc/source/ui/view/tabview4.cxx b/sc/source/ui/view/tabview4.cxx
index 442ef9a79654..a7de6bdf67d2 100644
--- a/sc/source/ui/view/tabview4.cxx
+++ b/sc/source/ui/view/tabview4.cxx
@@ -229,9 +229,13 @@ void ScTabView::UpdateRef( SCCOL nCurX, SCROW nCurY, SCTAB 
nCurZ )
 ScRefType eType = aViewData.GetRefType();
 if ( eType == SC_REFTYPE_REF )
 {
+if ((nStartX > nEndX || nStartY > nEndY) &&
+rDoc.HasAttrib(nStartX, nStartY, nTab, HasAttrFlags::Merged))
+rDoc.ExtendMerge( nStartX, nStartY, nStartX, nStartY, nTab );
+
 ScRange aRef(
-aViewData.GetRefStartX(), aViewData.GetRefStartY(), 
aViewData.GetRefStartZ(),
-aViewData.GetRefEndX(), aViewData.GetRefEndY(), 
aViewData.GetRefEndZ() );
+nStartX, nStartY, aViewData.GetRefStartZ(),
+nEndX, nEndY, aViewData.GetRefEndZ() );
 SC_MOD()->SetReference( aRef, rDoc,  );
 ShowRefTip();
 }


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-08-11 Thread Tomaž Vajngerl (via logerrit)
 sc/source/ui/theme/ThemeColorChanger.cxx |   25 ++---
 1 file changed, 22 insertions(+), 3 deletions(-)

New commits:
commit 9533d56cb31e49410f3023da1076dafad2786f7b
Author: Tomaž Vajngerl 
AuthorDate: Thu May 11 23:02:08 2023 +0900
Commit: Miklos Vajna 
CommitDate: Fri Aug 11 09:09:21 2023 +0200

sc: change text and background theme colors for direct attributes

Change-Id: Ia1ef2d151476bb627a0cb999135f6add827fb341
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151675
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 17bc0f05908769f024f3aa49554b96388dd49e96)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155543
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sc/source/ui/theme/ThemeColorChanger.cxx 
b/sc/source/ui/theme/ThemeColorChanger.cxx
index 870ef5b15cb8..2211aa67b554 100644
--- a/sc/source/ui/theme/ThemeColorChanger.cxx
+++ b/sc/source/ui/theme/ThemeColorChanger.cxx
@@ -21,6 +21,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 namespace sc
 {
@@ -33,10 +35,9 @@ ThemeColorChanger::~ThemeColorChanger() = default;
 
 namespace
 {
-void paragraphStyleChange(ScStyleSheet* pStyle, model::ColorSet const& 
rColorSet)
+void changeCellItems(SfxItemSet& rItemSet, model::ColorSet const& rColorSet)
 {
 const SfxPoolItem* pItem = nullptr;
-auto& rItemSet = pStyle->GetItemSet();
 
 if (rItemSet.HasItem(ATTR_FONT_COLOR, ))
 {
@@ -87,9 +88,27 @@ void 
ThemeColorChanger::apply(std::shared_ptr const& pColorSet)
 pStyle = static_cast(pPool->First(SfxStyleFamily::Para));
 while (pStyle)
 {
-paragraphStyleChange(pStyle, *pColorSet);
+auto& rItemSet = pStyle->GetItemSet();
+changeCellItems(rItemSet, *pColorSet);
 pStyle = static_cast(pPool->Next());
 }
+
+// Change Cell / Text attributes
+for (SCTAB nTab = 0; nTab < rDocument.GetTableCount(); nTab++)
+{
+ScDocAttrIterator aAttributeIterator(rDocument, nTab, 0, 0, 
rDocument.MaxCol(),
+ rDocument.MaxRow());
+SCCOL nCol = 0;
+SCROW nRow1 = 0;
+SCROW nRow2 = 0;
+
+while (const ScPatternAttr* pPattern = 
aAttributeIterator.GetNext(nCol, nRow1, nRow2))
+{
+auto* pNonConstPattern = const_cast(pPattern);
+auto& rItemSet = pNonConstPattern->GetItemSet();
+changeCellItems(rItemSet, *pColorSet);
+}
+}
 }
 
 } // end sw namespace


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-08-11 Thread Henry Castro (via logerrit)
 sc/source/ui/app/inputhdl.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit edbf070a6bb6aacfb277140457cf21036b5239e9
Author: Henry Castro 
AuthorDate: Thu Aug 10 15:14:18 2023 -0400
Commit: Tomaž Vajngerl 
CommitDate: Fri Aug 11 08:49:43 2023 +0200

tdf#155799: lok: sc: fix extend reference mark

In the tiled rendering case, the server sends a reference
coordinates to client side, so extend the range end point
reference if merged cells.

Signed-off-by: Henry Castro 
Change-Id: Ie9611aea3f6645a6cf45514939ae6364afac0b1c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155564
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tomaž Vajngerl 

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 6b7cc1935578..b90b1b100be4 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -494,10 +494,15 @@ ReferenceMark ScInputHandler::GetReferenceMark( const 
ScViewData& rViewData, ScD
 {
 SCCOL nCol1 = nX1, nCol2 = nX2;
 SCROW nRow1 = nY1, nRow2 = nY2;
+ScDocument& rDoc = pDocSh->GetDocument();
+
 PutInOrder(nCol1, nCol2);
 PutInOrder(nRow1, nRow2);
+
 if (nCol1 == nCol2 && nRow1 == nRow2)
-pDocSh->GetDocument().ExtendMerge(nCol1, nRow1, nCol2, nRow2, 
nTab);
+rDoc.ExtendMerge(nCol1, nRow1, nCol2, nRow2, nTab);
+else if (rDoc.HasAttrib(nCol2, nRow2, nTab, HasAttrFlags::Merged))
+rDoc.ExtendMerge(nCol2, nRow2, nCol2, nRow2, nTab);
 
 Point aTopLeft = rViewData.GetPrintTwipsPos(nCol1, nRow1);
 Point aBottomRight = rViewData.GetPrintTwipsPos(nCol2 + 1, nRow2 + 1);


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-08-10 Thread Henry Castro (via logerrit)
 sc/source/ui/view/output.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit ebd1a4d6fc3f9ba533a29fa54acf7b3b41c398d5
Author: Henry Castro 
AuthorDate: Wed Aug 9 16:48:42 2023 -0400
Commit: Tomaž Vajngerl 
CommitDate: Thu Aug 10 10:08:47 2023 +0200

tdf#155799: sc: fix paint the reference mark

If a reference mark is initiated with the first click,
the initial range points are the same and extended
if merged cells, but if the user drag more cells
the Range end has to extend if merged cells

Signed-off-by: Henry Castro 
Change-Id: Ife7c4514a9303226b73bff61bd0df689f81af42f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155533
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tomaž Vajngerl 

diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 51bf2151cd9f..14419a362682 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -2011,6 +2011,8 @@ void ScOutputData::DrawRefMark( SCCOL nRefStartX, SCROW 
nRefStartY,
 
 if ( nRefStartX == nRefEndX && nRefStartY == nRefEndY )
 mpDoc->ExtendMerge( nRefStartX, nRefStartY, nRefEndX, nRefEndY, nTab );
+else if (mpDoc->HasAttrib(nRefEndX, nRefEndY, nTab, HasAttrFlags::Merged))
+mpDoc->ExtendMerge(nRefEndX, nRefEndY, nRefEndX, nRefEndY, nTab);
 
 if ( !(nRefStartX <= nVisX2 && nRefEndX >= nVisX1 &&
  nRefStartY <= nVisY2 && nRefEndY >= nVisY1) )


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-08-08 Thread Henry Castro (via logerrit)
 sc/source/ui/view/tabview2.cxx |   20 
 1 file changed, 20 insertions(+)

New commits:
commit 10e80ef6d6eba3a2e5996c8eaee4f5090868072d
Author: Henry Castro 
AuthorDate: Tue Jul 18 15:09:18 2023 -0400
Commit: Tomaž Vajngerl 
CommitDate: Tue Aug 8 14:37:49 2023 +0200

tdf#155799: sc: fix formula reference "key up"

When the formula reference mode is active and it process
the keyboard event UP, it should decrease -1 according
the merge attribute row, col span.

Signed-off-by: Henry Castro 
Change-Id: I278bcd9d52caeb09e4a47336af8c8e9b522397c9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154999
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tomaž Vajngerl 

diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index 480574ec22af..308e734f95a0 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -198,6 +198,8 @@ void moveRefByCell(SCCOL& rNewX, SCROW& rNewY,
SCCOL nMovX, SCROW nMovY, SCTAB nRefTab,
const ScDocument& rDoc)
 {
+SCCOL nOldX = rNewX;
+SCROW nOldY = rNewY;
 bool bSelectLocked = true;
 bool bSelectUnlocked = true;
 const ScTableProtection* pTabProtection = rDoc.GetTabProtection(nRefTab);
@@ -224,6 +226,15 @@ void moveRefByCell(SCCOL& rNewX, SCROW& rNewY,
 }
 if (isCellQualified(, nTempX, rNewY, nRefTab, bSelectLocked, 
bSelectUnlocked))
 rNewX = nTempX;
+
+if (nMovX < 0 && rNewX > 0)
+{
+const ScMergeAttr* pMergeAttr = rDoc.GetAttr(rNewX, rNewY, 
nRefTab, ATTR_MERGE);
+if (pMergeAttr && pMergeAttr->IsMerged() &&
+nOldX >= rNewX &&
+nOldX <= rNewX + pMergeAttr->GetRowMerge() - 1)
+rNewX = rNewX - 1;
+}
 }
 
 if (nMovY)
@@ -240,6 +251,15 @@ void moveRefByCell(SCCOL& rNewX, SCROW& rNewY,
 }
 if (isCellQualified(, rNewX, nTempY, nRefTab, bSelectLocked, 
bSelectUnlocked))
 rNewY = nTempY;
+
+if (nMovY < 0 && rNewY > 0)
+{
+const ScMergeAttr* pMergeAttr = rDoc.GetAttr(rNewX, rNewY, 
nRefTab, ATTR_MERGE);
+if (pMergeAttr && pMergeAttr->IsMerged() &&
+nOldY >= rNewY &&
+nOldY <= rNewY + pMergeAttr->GetRowMerge() - 1)
+rNewY = rNewY - 1;
+}
 }
 
 rDoc.SkipOverlapped(rNewX, rNewY, nRefTab);


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-08-08 Thread Henry Castro (via logerrit)
 sc/source/ui/view/tabview2.cxx |   97 +
 1 file changed, 52 insertions(+), 45 deletions(-)

New commits:
commit 4b8d1c3d9dedf9737f6cd17f59d8a653c2c3468c
Author: Henry Castro 
AuthorDate: Mon Jul 17 09:41:55 2023 -0400
Commit: Tomaž Vajngerl 
CommitDate: Tue Aug 8 14:35:23 2023 +0200

tdf#155799: sc: abstraction "moveRefByCell"

..

Signed-off-by: Henry Castro 
Change-Id: Ib00e3cddcd4a5dc4ef3d74d3939cdf278f2cb44d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154998
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tomaž Vajngerl 

diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index 8509ac74b8f0..480574ec22af 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -194,6 +194,57 @@ bool checkBoundary(const ScDocument* pDoc, SCCOL& rCol, 
SCROW& rRow)
 return bGood;
 }
 
+void moveRefByCell(SCCOL& rNewX, SCROW& rNewY,
+   SCCOL nMovX, SCROW nMovY, SCTAB nRefTab,
+   const ScDocument& rDoc)
+{
+bool bSelectLocked = true;
+bool bSelectUnlocked = true;
+const ScTableProtection* pTabProtection = rDoc.GetTabProtection(nRefTab);
+if (pTabProtection && pTabProtection->isProtected())
+{
+bSelectLocked   = 
pTabProtection->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS);
+bSelectUnlocked = 
pTabProtection->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS);
+}
+
+moveCursorByProtRule(rNewX, rNewY, nMovX, nMovY, nRefTab, );
+checkBoundary(, rNewX, rNewY);
+
+if (nMovX)
+{
+SCCOL nTempX = rNewX;
+while (rDoc.IsHorOverlapped(nTempX, rNewY, nRefTab))
+{
+if (nMovX > 0)
+++nTempX;
+else
+--nTempX;
+if (!checkBoundary(, nTempX, rNewY))
+break;
+}
+if (isCellQualified(, nTempX, rNewY, nRefTab, bSelectLocked, 
bSelectUnlocked))
+rNewX = nTempX;
+}
+
+if (nMovY)
+{
+SCROW nTempY = rNewY;
+while (rDoc.IsVerOverlapped(rNewX, nTempY, nRefTab))
+{
+if (nMovY > 0)
+++nTempY;
+else
+--nTempY;
+if (!checkBoundary(, rNewX, nTempY))
+break;
+}
+if (isCellQualified(, rNewX, nTempY, nRefTab, bSelectLocked, 
bSelectUnlocked))
+rNewY = nTempY;
+}
+
+rDoc.SkipOverlapped(rNewX, rNewY, nRefTab);
+}
+
 void moveCursorByMergedCell(SCCOL& rCol, SCROW& rRow, SCCOL nMovX, SCROW 
nMovY, SCCOL nStartX,
 SCROW nStartY, SCTAB nTab, const ScDocument* pDoc)
 {
@@ -993,51 +1044,7 @@ void ScTabView::ExpandBlock(SCCOL nMovX, SCROW nMovY, 
ScFollowMode eMode)
 SCROW nNewY = aViewData.GetRefEndY();
 SCTAB nRefTab = aViewData.GetRefEndZ();
 
-bool bSelectLocked = true;
-bool bSelectUnlocked = true;
-const ScTableProtection* pTabProtection = 
rDoc.GetTabProtection(nRefTab);
-if (pTabProtection && pTabProtection->isProtected())
-{
-bSelectLocked   = 
pTabProtection->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS);
-bSelectUnlocked = 
pTabProtection->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS);
-}
-
-moveCursorByProtRule(nNewX, nNewY, nMovX, nMovY, nRefTab, );
-checkBoundary(, nNewX, nNewY);
-
-if (nMovX)
-{
-SCCOL nTempX = nNewX;
-while (rDoc.IsHorOverlapped(nTempX, nNewY, nRefTab))
-{
-if (nMovX > 0)
-++nTempX;
-else
---nTempX;
-if (!checkBoundary(, nTempX, nNewY))
-break;
-}
-if (isCellQualified(, nTempX, nNewY, nRefTab, bSelectLocked, 
bSelectUnlocked))
-nNewX = nTempX;
-}
-
-if (nMovY)
-{
-SCROW nTempY = nNewY;
-while (rDoc.IsVerOverlapped(nNewX, nTempY, nRefTab))
-{
-if (nMovY > 0)
-++nTempY;
-else
---nTempY;
-if (!checkBoundary(, nNewX, nTempY))
-break;
-}
-if (isCellQualified(, nNewX, nTempY, nRefTab, bSelectLocked, 
bSelectUnlocked))
-nNewY = nTempY;
-}
-
-rDoc.SkipOverlapped(nNewX, nNewY, nRefTab);
+moveRefByCell(nNewX, nNewY, nMovX, nMovY, nRefTab, rDoc);
 UpdateRef(nNewX, nNewY, nRefTab);
 SCCOL nTargetCol = nNewX;
 SCROW nTargetRow = nNewY;


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-08-08 Thread Henry Castro (via logerrit)
 sc/source/ui/view/tabview4.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit b24ab6a7f85a126d978e4cf605f780e1e0f7083a
Author: Henry Castro 
AuthorDate: Tue Jul 18 15:15:41 2023 -0400
Commit: Tomaž Vajngerl 
CommitDate: Tue Aug 8 14:32:02 2023 +0200

tdf#155799: sc: fix "UpdateRef"" to update extended merged cells

Extend the merged cell if the current has the attribute "Merged".

Signed-off-by: Henry Castro 
Change-Id: Ia2d5983d89b8661abb683d10d4de8bd0c5adea7d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154993
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tomaž Vajngerl 

diff --git a/sc/source/ui/view/tabview4.cxx b/sc/source/ui/view/tabview4.cxx
index 345ae9335256..442ef9a79654 100644
--- a/sc/source/ui/view/tabview4.cxx
+++ b/sc/source/ui/view/tabview4.cxx
@@ -213,6 +213,9 @@ void ScTabView::UpdateRef( SCCOL nCurX, SCROW nCurY, SCTAB 
nCurZ )
 rDoc.ExtendMerge( nStartX, nStartY, nEndX, nEndY, nTab );
 ScUpdateRect aRect( nStartX, nStartY, nEndX, nEndY );
 
+if (rDoc.HasAttrib(nCurX, nCurY, nCurZ, HasAttrFlags::Merged))
+rDoc.ExtendMerge(nStartX, nStartY, nCurX, nCurY, nCurZ);
+
 aViewData.SetRefEnd( nCurX, nCurY, nCurZ );
 
 nStartX = aViewData.GetRefStartX();


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-08-04 Thread Caolán McNamara (via logerrit)
 sc/source/ui/view/output.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit b95627c7423a93c2492c36189b079cb12f485bb0
Author: Caolán McNamara 
AuthorDate: Tue Aug 1 16:34:56 2023 +0100
Commit: Tomaž Vajngerl 
CommitDate: Fri Aug 4 15:39:52 2023 +0200

cool#6911 draw the note indicator browser-side

Change-Id: I0770641bbd1c6d023cbd14ad9404256cc92892c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155231
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tomaž Vajngerl 

diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 65df06344533..51bf2151cd9f 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -2376,6 +2376,9 @@ void ScOutputData::DrawSparklines(vcl::RenderContext& 
rRenderContext)
 //TODO: moggi Need to check if this can't be written simpler
 void ScOutputData::DrawNoteMarks(vcl::RenderContext& rRenderContext)
 {
+// cool#6911 draw the note indicator browser-side instead
+if (comphelper::LibreOfficeKit::isActive())
+return;
 
 bool bFirst = true;
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-08-04 Thread Henry Castro (via logerrit)
 sc/source/ui/inc/gridwin.hxx  |2 ++
 sc/source/ui/view/gridwin.cxx |   22 +-
 2 files changed, 23 insertions(+), 1 deletion(-)

New commits:
commit 7e4576ad65a0bb3ba2ccaf13d12dcd2ffa47f0b8
Author: Henry Castro 
AuthorDate: Wed Aug 2 16:54:12 2023 -0400
Commit: Caolán McNamara 
CommitDate: Fri Aug 4 09:51:42 2023 +0200

lok: sc: fire "hyperlink clicked" event

The client side has changed the behaviour when
the HYPERLINK formula is clicked, usually in desktop
is fired with Ctrl + Mouse Click, now it is fired
with Mouse Click.

Signed-off-by: Henry Castro 
Change-Id: I08d41170714588d9ee84475991757d8be9b01f07
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155270
Tested-by: Jenkins CollaboraOffice 
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index ddc9815c2052..f5e64372ee14 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -509,6 +509,8 @@ protected:
 void ImpDestroyOverlayObjects();
 
 private:
+SCCOL m_nDownPosX;
+SCROW m_nDownPosY;
 
 #ifdef DBG_UTIL
 void dumpCellProperties();
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 257ca66e6e61..251114e8efc3 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -399,7 +399,9 @@ ScGridWindow::ScGridWindow( vcl::Window* pParent, 
ScViewData& rData, ScSplitPos
 bIsInPaint( false ),
 bNeedsRepaint( false ),
 bAutoMarkVisible( false ),
-bListValButton( false )
+bListValButton( false ),
+m_nDownPosX( -1 ),
+m_nDownPosY( -1 )
 {
 set_id("grid_window");
 switch(eWhich)
@@ -1955,6 +1957,8 @@ void ScGridWindow::HandleMouseButtonDown( const 
MouseEvent& rMEvt, MouseEventSta
 SCROW nPosY;
 mrViewData.GetPosFromPixel( aPos.X(), aPos.Y(), eWhich, nPosX, nPosY );
 SCTAB nTab = mrViewData.GetTabNo();
+m_nDownPosX = nPosX;
+m_nDownPosY = nPosY;
 
 // FIXME: this is to limit the number of rows handled in the Online
 // to 1000; this will be removed again when the performance
@@ -2609,6 +2613,22 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& 
rMEvt )
 }
 mrViewData.GetViewShell()->SelectionChanged();
 
+if (bIsTiledRendering && !bRefMode && !bDouble)
+{
+OUString aName, aUrl, aTarget;
+ScTabViewShell* pViewShell = mrViewData.GetViewShell();
+if (pViewShell && nPosX == m_nDownPosX && nPosY == m_nDownPosY
+&& GetEditUrl(aPos, , , ))
+{
+OString aMsg(aUrl.toUtf8() + " coordinates: " +
+ pViewShell->GetViewData().describeCellCursorAt(nPosX, 
nPosY) + ", " +
+ OString::number(aPos.X() / 
pViewShell->GetViewData().GetPPTX()));
+
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_HYPERLINK_CLICKED, 
aMsg.getStr());
+}
+}
+
+m_nDownPosX = m_nDownPosY = -1;
+
 return;
 }
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-07-28 Thread Caolán McNamara (via logerrit)
 sc/source/ui/app/inputwin.cxx |8 +++-
 sc/source/ui/inc/inputwin.hxx |2 ++
 2 files changed, 9 insertions(+), 1 deletion(-)

New commits:
commit c5b28aa174883f513060e7e5b6142367f49f
Author: Caolán McNamara 
AuthorDate: Wed Jul 26 09:29:18 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Jul 28 09:54:32 2023 +0200

Resolves: tdf#155716 grab focus when context menu is activated

Change-Id: I194aba413d5adf07c8d78823f2f9a086f95cf248
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154925
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index acbb66c41a4a..07a4cd93a836 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1648,7 +1648,7 @@ bool ScTextWnd::CanFocus() const
 return SC_MOD()->IsEditMode();
 }
 
-bool ScTextWnd::MouseButtonDown( const MouseEvent& rMEvt )
+void ScTextWnd::UpdateFocus()
 {
 if (!HasFocus())
 {
@@ -1656,6 +1656,11 @@ bool ScTextWnd::MouseButtonDown( const MouseEvent& rMEvt 
)
 if (CanFocus())
 TextGrabFocus();
 }
+}
+
+bool ScTextWnd::MouseButtonDown( const MouseEvent& rMEvt )
+{
+UpdateFocus();
 
 bool bClickOnSelection = false;
 if (m_xEditView)
@@ -1771,6 +1776,7 @@ bool ScTextWnd::Command( const CommandEvent& rCEvt )
 }
 if (IsMouseCaptured())
 ReleaseMouse();
+UpdateFocus();
 pViewFrm->GetDispatcher()->ExecutePopup("formulabar", 
(), );
 }
 }
diff --git a/sc/source/ui/inc/inputwin.hxx b/sc/source/ui/inc/inputwin.hxx
index f0f69e948843..823c9e177ed8 100644
--- a/sc/source/ui/inc/inputwin.hxx
+++ b/sc/source/ui/inc/inputwin.hxx
@@ -135,6 +135,8 @@ private:
 
 void InitEditEngine();
 
+void UpdateFocus();
+
 rtl::Reference m_xHelper;
 
 typedef ::std::vector< ScAccessibleEditLineTextData* > AccTextDataVector;


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source sd/source sw/source

2023-07-21 Thread Paris Oplopoios (via logerrit)
 sc/source/ui/view/tabvwsh4.cxx   |6 ++
 sd/source/ui/view/drviewsa.cxx   |   10 ++
 sw/source/uibase/uiview/view.cxx |8 
 3 files changed, 24 insertions(+)

New commits:
commit 6c6bb1d434d5c0be2f71470483f3ce56f5210e01
Author: Paris Oplopoios 
AuthorDate: Thu Jul 20 19:49:10 2023 +0300
Commit: Paris Oplopoios 
CommitDate: Sat Jul 22 01:26:20 2023 +0200

Execute notifyViewRenderState on view constructor

notifyViewRenderState should be executed as soon as a view is created in
order to give a view id to the client

Change-Id: I31b7e61599f546bd5ec134775e6235633a6526f3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154681
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Paris Oplopoios 

diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index c0a8ae702257..071017d5da43 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -1805,6 +1805,12 @@ ScTabViewShell::ScTabViewShell( SfxViewFrame* pViewFrame,
 pInputHdl->SetMode(SC_INPUT_NONE);
 }
 }
+
+if (comphelper::LibreOfficeKit::isActive())
+{
+ScModelObj* pModel = 
comphelper::getFromUnoTunnel(GetCurrentDocument());
+SfxLokHelper::notifyViewRenderState(this, pModel);
+}
 }
 
 ScTabViewShell::~ScTabViewShell()
diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx
index 2716bd489ab1..55842c90bdf1 100644
--- a/sd/source/ui/view/drviewsa.cxx
+++ b/sd/source/ui/view/drviewsa.cxx
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -64,7 +65,10 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
+#include 
 #include 
 
 #include 
@@ -130,6 +134,12 @@ DrawViewShell::DrawViewShell( ViewShellBase& 
rViewShellBase, vcl::Window* pParen
 ConfigureAppBackgroundColor();
 SD_MOD()->GetColorConfig().AddListener(this);
 maViewOptions.mnDocBackgroundColor = 
SD_MOD()->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor;
+
+if (comphelper::LibreOfficeKit::isActive())
+{
+SdXImpressDocument* pModel = 
comphelper::getFromUnoTunnel(rViewShellBase.GetCurrentDocument());
+SfxLokHelper::notifyViewRenderState(, pModel);
+}
 }
 
 DrawViewShell::~DrawViewShell()
diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index aff4bb710ade..94d97d8cb07a 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -87,6 +87,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -106,6 +107,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1091,6 +1093,12 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* 
pOldSh )
 m_pWrtShell->InvalidateOutlineContentVisibility();
 
 GetViewFrame()->GetWindow().AddChildEventListener( LINK( this, SwView, 
WindowChildEventListener ) );
+
+if (comphelper::LibreOfficeKit::isActive())
+{
+SwXTextDocument* pModel = 
comphelper::getFromUnoTunnel(GetCurrentDocument());
+SfxLokHelper::notifyViewRenderState(this, pModel);
+}
 }
 
 SwViewGlueDocShell::SwViewGlueDocShell(SwView& rView, SwDocShell& rDocSh)


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-07-18 Thread László Németh (via logerrit)
 sc/source/core/data/table2.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 7b6812c267356a7fb204b393f4625f8ff4fd296e
Author: László Németh 
AuthorDate: Fri Jul 14 18:41:31 2023 +0200
Commit: Szymon Kłos 
CommitDate: Tue Jul 18 11:22:44 2023 +0200

tdf#156286 sc: fix crash with column deletion

Skip negative indices, which caused the crash, when
more columns were deleted, than the remaining columns
before them.

Regression from commit dd8e061406fac581d399da088c7f0187278035dc
"tdf#153437 sc: fix broken formatting without performance regression".

Change-Id: I223e2fbb321fc4bd2ddb7a67a16a64c69e1e7872
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154445
Reviewed-by: Czeber László 
Tested-by: Jenkins
Tested-by: László Németh 
Reviewed-by: László Németh 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154575
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index a4758d088ac0..53ba083929c4 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -400,8 +400,8 @@ void ScTable::DeleteCol(
 {
 for (SCCOL nCol = nStartCol + nSize; nCol < aCol.size(); ++nCol)
 aCol[nCol].SwapCol(aCol[nCol - nSize]);
-// When delete column(s), inicialize the last columns from the default 
attributes
-for (SCCOL nCol = aCol.size() - nSize; nCol < aCol.size(); ++nCol)
+// When delete column(s), initialize the last columns from the default 
attributes
+for (SCCOL nCol = aCol.size() < static_cast(nSize) ? 0 : 
aCol.size() - nSize; nCol < aCol.size(); ++nCol)
 aCol[nCol].Init(nCol, aCol[nCol].GetTab(), rDocument, false);
 }
 else


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-07-14 Thread Szymon Kłos (via logerrit)
 sc/source/core/data/documen2.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f7f6f766e3f43bb5bb5d38f3acf06471e1164a7f
Author: Szymon Kłos 
AuthorDate: Fri Jul 14 10:29:40 2023 +0200
Commit: Michael Meeks 
CommitDate: Fri Jul 14 12:45:22 2023 +0200

lok: don't calculate document area in tile rendering all the time

GetCellArea does the same that GetPrintArea but faster
thanks to caching the results if document wasn't modified.

Change-Id: Ic0c43c3efe046419910a4056f6334099afa3fa45
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154437
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 2faa9cd1c7d0..ec93a74db8ef 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -703,7 +703,7 @@ bool ScDocument::GetDataStart( SCTAB nTab, SCCOL& 
rStartCol, SCROW& rStartRow )
 
 void ScDocument::GetTiledRenderingArea(SCTAB nTab, SCCOL& rEndCol, SCROW& 
rEndRow) const
 {
-bool bHasPrintArea = GetPrintArea(nTab, rEndCol, rEndRow, false);
+bool bHasPrintArea = GetCellArea(nTab, rEndCol, rEndRow);
 
 // we need some reasonable minimal document size
 ScViewData* pViewData = ScDocShell::GetViewData();


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-07-10 Thread Szymon Kłos (via logerrit)
 sc/source/ui/view/viewfun3.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 8a52bd5053f1627a9f73cdb3f30e8c74ec49f0dd
Author: Szymon Kłos 
AuthorDate: Mon Jul 10 11:27:17 2023 +0200
Commit: Henry Castro 
CommitDate: Mon Jul 10 14:40:04 2023 +0200

lok: copy simple selection even when filtered

when selected cells contain data filtered with autofilter
and regular cells after that - we get different type
of selection called SC_MARK_SIMPLE_FILTERED

allow copying that too

Change-Id: I69f91a674f427a7b956fd87b8dc56937b3b55e86
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154239
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Henry Castro 

diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index 64df4aed5f29..567447149937 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -432,7 +432,8 @@ bool ScViewFunc::CopyToClipMultiRange( const ScDocument* 
pInputClipDoc, const Sc
 rtl::Reference ScViewFunc::CopyToTransferable()
 {
 ScRange aRange;
-if ( GetViewData().GetSimpleArea( aRange ) == SC_MARK_SIMPLE )
+auto eMarkType = GetViewData().GetSimpleArea( aRange );
+if ( eMarkType == SC_MARK_SIMPLE || eMarkType == SC_MARK_SIMPLE_FILTERED )
 {
 ScDocument& rDoc = GetViewData().GetDocument();
 ScMarkData& rMark = GetViewData().GetMarkData();


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-07-08 Thread Caolán McNamara (via logerrit)
 sc/source/filter/inc/XclExpChangeTrack.hxx   |   12 
 sc/source/filter/xcl97/XclExpChangeTrack.cxx |   26 ++
 2 files changed, 38 insertions(+)

New commits:
commit 569260f8fa604e0f761d3c3057c959b4b402e930
Author: Caolán McNamara 
AuthorDate: Fri Jun 30 10:21:37 2023 +0100
Commit: Andras Timar 
CommitDate: Sat Jul 8 21:10:41 2023 +0200

crashtesting: assert/crash on export of fdo66241-1.ods to xls

and others, e.g.

ooo101471-3.odf fdo68105-1.ods fdo66241-1.ods
fdo68105-2.ods fdo64646-4.xls ooo101471-2.sxc

Change-Id: I5a639cc6539130bc6a7ada00652d02529544f650
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153767
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/sc/source/filter/inc/XclExpChangeTrack.hxx 
b/sc/source/filter/inc/XclExpChangeTrack.hxx
index 9701ba6e29f5..a6cdeff93cab 100644
--- a/sc/source/filter/inc/XclExpChangeTrack.hxx
+++ b/sc/source/filter/inc/XclExpChangeTrack.hxx
@@ -378,6 +378,9 @@ protected:
 // override to get action size without header, 
called by GetLen()
 virtual std::size_t GetActionByteCount() const = 0;
 
+// true if export would attempt to get the tab 
id of an unknown tab
+virtual boolUsesDeletedTab() const = 0;
+
 // do something before writing the record
 virtual voidPrepareSaveAction( XclExpStream& rStrm ) const;
 // do something after writing the record
@@ -479,6 +482,8 @@ class XclExpChTrCellContent final : public 
XclExpChTrAction, protected XclExpRoo
 const XclExpRoot& rRoot, const ScCellValue& rScCell, 
std::unique_ptr& rpData,
 sal_uInt32& rXclLength1, sal_uInt16& rXclLength2 );
 
+virtual boolUsesDeletedTab() const override;
+
 virtual voidSaveActionData( XclExpStream& rStrm ) const 
override;
 
 public:
@@ -505,6 +510,8 @@ protected:
 
 XclExpChTrInsert( const XclExpChTrInsert& rCopy );
 
+virtual boolUsesDeletedTab() const override;
+
 virtual voidSaveActionData( XclExpStream& rStrm ) const 
override;
 virtual voidPrepareSaveAction( XclExpStream& rStrm ) const 
override;
 virtual voidCompleteSaveAction( XclExpStream& rStrm ) 
const override;
@@ -531,6 +538,9 @@ private:
 SCTAB   nTab;
 
 protected:
+
+virtual boolUsesDeletedTab() const override;
+
 virtual voidSaveActionData( XclExpStream& rStrm ) const 
override;
 
 public:
@@ -553,6 +563,8 @@ class XclExpChTrMoveRange final : public XclExpChTrAction
 ScRange aSourceRange;
 ScRange aDestRange;
 
+virtual boolUsesDeletedTab() const override;
+
 virtual voidSaveActionData( XclExpStream& rStrm ) const 
override;
 virtual voidPrepareSaveAction( XclExpStream& rStrm ) const 
override;
 virtual voidCompleteSaveAction( XclExpStream& rStrm ) 
const override;
diff --git a/sc/source/filter/xcl97/XclExpChangeTrack.cxx 
b/sc/source/filter/xcl97/XclExpChangeTrack.cxx
index 71156df08e04..24da37109d29 100644
--- a/sc/source/filter/xcl97/XclExpChangeTrack.cxx
+++ b/sc/source/filter/xcl97/XclExpChangeTrack.cxx
@@ -717,6 +717,11 @@ void XclExpChTrAction::CompleteSaveAction( XclExpStream& 
/*rStrm*/ ) const
 
 void XclExpChTrAction::Save( XclExpStream& rStrm )
 {
+if (UsesDeletedTab())
+{
+SAL_WARN("sc", "XclExpChTrAction : unable to export position with tab 
of EXC_TAB_DELETED");
+return;
+}
 PrepareSaveAction( rStrm );
 ExcRecord::Save( rStrm );
 if( pAddAction )
@@ -927,6 +932,11 @@ void XclExpChTrCellContent::GetCellData(
 }
 }
 
+bool XclExpChTrCellContent::UsesDeletedTab() const
+{
+return IsDeletedTab(aPosition.Tab());
+}
+
 void XclExpChTrCellContent::SaveActionData( XclExpStream& rStrm ) const
 {
 WriteTabId( rStrm, aPosition.Tab() );
@@ -1117,6 +1127,11 @@ XclExpChTrInsert::~XclExpChTrInsert()
 {
 }
 
+bool XclExpChTrInsert::UsesDeletedTab() const
+{
+return IsDeletedTab(aRange.aStart.Tab());
+}
+
 void XclExpChTrInsert::SaveActionData( XclExpStream& rStrm ) const
 {
 WriteTabId( rStrm, aRange.aStart.Tab() );
@@ -1206,6 +1221,11 @@ XclExpChTrInsertTab::~XclExpChTrInsertTab()
 {
 }
 
+bool XclExpChTrInsertTab::UsesDeletedTab() const
+{
+return IsDeletedTab(nTab);
+}
+
 void XclExpChTrInsertTab::SaveActionData( XclExpStream& rStrm ) const
 {
 WriteTabId( rStrm, nTab );
@@ -1262,6 +1282,12 @@ XclExpChTrMoveRange::~XclExpChTrMoveRange()
 {
 }
 
+bool XclExpChTrMoveRange::UsesDeletedTab() const
+{
+return IsDeletedTab(aDestRange.aStart.Tab()) ||
+   IsDeletedTab(aSourceRange.aStart.Tab());
+}
+
 void 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-07-02 Thread Szymon Kłos (via logerrit)
 sc/source/ui/app/inputwin.cxx |   21 -
 1 file changed, 4 insertions(+), 17 deletions(-)

New commits:
commit e53be4d13c4a328eb4ee0ceb937e4b272ecbde7c
Author: Szymon Kłos 
AuthorDate: Wed Jun 28 15:46:23 2023 +0200
Commit: Henry Castro 
CommitDate: Mon Jul 3 01:09:45 2023 +0200

lok: formulabar: use position sent from client

Change-Id: I0877cd9d5a5ba0319701e50bd5b9e5d63b23becd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153717
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Henry Castro 

diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 6db4bd6773e6..acbb66c41a4a 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1813,23 +1813,10 @@ bool ScTextWnd::Command( const CommandEvent& rCEvt )
 
 sal_Int32 nParaStart, nParaEnd, nPosStart, nPosEnd;
 
-ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
-if (pViewSh && pViewSh->isLOKMobilePhone())
-{
-// We use IME - do not select anything, put cursor at the end
-nParaStart = nParaEnd = 
m_xEditView->GetEditEngine()->GetParagraphCount() ?
-(m_xEditView->GetEditEngine()->GetParagraphCount() - 1) : 0;
-nPosStart = nPosEnd = 
m_xEditView->GetEditEngine()->GetTextLen(nParaStart);
-}
-else
-{
-nParaStart = pParaPoint ? pParaPoint->X() : 0;
-nParaEnd = pParaPoint ? pParaPoint->Y() : 0;
-nPosStart = m_xEditView->GetPosNoField(nParaStart, 
aSelectionStartEnd.X());
-nPosEnd = m_xEditView->GetPosNoField(nParaEnd, 
aSelectionStartEnd.Y());
-
-
-}
+nParaStart = pParaPoint ? pParaPoint->X() : 0;
+nParaEnd = pParaPoint ? pParaPoint->Y() : 0;
+nPosStart = m_xEditView->GetPosNoField(nParaStart, 
aSelectionStartEnd.X());
+nPosEnd = m_xEditView->GetPosNoField(nParaEnd, aSelectionStartEnd.Y());
 
 m_xEditView->SetSelection(ESelection(nParaStart, nPosStart, nParaEnd, 
nPosEnd));
 SC_MOD()->InputSelection( m_xEditView.get() );


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-06-29 Thread Henry Castro (via logerrit)
 sc/source/ui/inc/select.hxx  |   10 -
 sc/source/ui/view/select.cxx |  266 +--
 2 files changed, 138 insertions(+), 138 deletions(-)

New commits:
commit 184b91d397e80bf0ce987e227ec6a561fe6fbe6a
Author: Henry Castro 
AuthorDate: Wed Jun 21 11:15:58 2023 -0400
Commit: Henry Castro 
CommitDate: Thu Jun 29 18:18:23 2023 +0200

sc: prefix m_* ScViewFunctionSet class members

..

Change-Id: Ic16ae0fc6580e350444576a087c333d52296ec5e
Signed-off-by: Henry Castro 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153405
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Caolán McNamara 
(cherry picked from commit 8276b9593a2a9e3a0d5aaeaadd64369667120303)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153658

diff --git a/sc/source/ui/inc/select.hxx b/sc/source/ui/inc/select.hxx
index ea3082f972c6..e1223f91e793 100644
--- a/sc/source/ui/inc/select.hxx
+++ b/sc/source/ui/inc/select.hxx
@@ -40,12 +40,12 @@ public:
 class ScViewFunctionSet : public FunctionSet// View (Gridwin / 
keyboard)
 {
 private:
-ScViewData* pViewData;
-ScViewSelectionEngine*  pEngine;
+ScViewData* m_pViewData;
+ScViewSelectionEngine*  m_pEngine;
 
-boolbAnchor;
-boolbStarted;
-ScAddress   aAnchorPos;
+boolm_bAnchor;
+boolm_bStarted;
+ScAddress   m_aAnchorPos;
 
 ScSplitPos  GetWhich() const;
 
diff --git a/sc/source/ui/view/select.cxx b/sc/source/ui/view/select.cxx
index 772d86df1c66..51ccc7d25a2b 100644
--- a/sc/source/ui/view/select.cxx
+++ b/sc/source/ui/view/select.cxx
@@ -44,27 +44,27 @@ static bool bDidSwitch = false;
 
 // View (Gridwin / keyboard)
 ScViewFunctionSet::ScViewFunctionSet( ScViewData* pNewViewData ) :
-pViewData( pNewViewData ),
-pEngine( nullptr ),
-bAnchor( false ),
-bStarted( false )
+m_pViewData( pNewViewData ),
+m_pEngine( nullptr ),
+m_bAnchor( false ),
+m_bStarted( false )
 {
-OSL_ENSURE(pViewData, "ViewData==0 at FunctionSet");
+OSL_ENSURE(m_pViewData, "ViewData==0 at FunctionSet");
 }
 
 ScSplitPos ScViewFunctionSet::GetWhich() const
 {
-if (pEngine)
-return pEngine->GetWhich();
+if (m_pEngine)
+return m_pEngine->GetWhich();
 else
-return pViewData->GetActivePart();
+return m_pViewData->GetActivePart();
 }
 
 sal_uLong ScViewFunctionSet::CalcUpdateInterval( const Size& rWinSize, const 
Point& rEffPos,
  bool bLeftScroll, bool 
bTopScroll, bool bRightScroll, bool bBottomScroll )
 {
 sal_uLong nUpdateInterval = SELENG_AUTOREPEAT_INTERVAL_MAX;
-vcl::Window* pWin = pEngine->GetWindow();
+vcl::Window* pWin = m_pEngine->GetWindow();
 tools::Rectangle aScrRect = pWin->GetDesktopRectPixel();
 Point aRootPos = pWin->OutputToAbsoluteScreenPixel(Point(0,0));
 if (bRightScroll)
@@ -124,7 +124,7 @@ sal_uLong ScViewFunctionSet::CalcUpdateInterval( const 
Size& rWinSize, const Poi
 }
 
 #ifdef _WIN32
-ScTabViewShell* pViewShell = pViewData->GetViewShell();
+ScTabViewShell* pViewShell = m_pViewData->GetViewShell();
 bool bRefMode = pViewShell && pViewShell->IsRefInputMode();
 if (bRefMode && nUpdateInterval < SC_SELENG_REFMODE_UPDATE_INTERVAL_MIN)
 // Lower the update interval during ref mode, because re-draw can be
@@ -139,25 +139,25 @@ sal_uLong ScViewFunctionSet::CalcUpdateInterval( const 
Size& rWinSize, const Poi
 
 void ScViewFunctionSet::SetSelectionEngine( ScViewSelectionEngine* pSelEngine )
 {
-pEngine = pSelEngine;
+m_pEngine = pSelEngine;
 }
 
 // Drag & Drop
 void ScViewFunctionSet::BeginDrag()
 {
-SCTAB nTab = pViewData->GetTabNo();
+SCTAB nTab = m_pViewData->GetTabNo();
 
 SCCOL nPosX;
 SCROW nPosY;
-if (pEngine)
+if (m_pEngine)
 {
-Point aMPos = pEngine->GetMousePosPixel();
-pViewData->GetPosFromPixel( aMPos.X(), aMPos.Y(), GetWhich(), nPosX, 
nPosY );
+Point aMPos = m_pEngine->GetMousePosPixel();
+m_pViewData->GetPosFromPixel( aMPos.X(), aMPos.Y(), GetWhich(), nPosX, 
nPosY );
 }
 else
 {
-nPosX = pViewData->GetCurX();
-nPosY = pViewData->GetCurY();
+nPosX = m_pViewData->GetCurX();
+nPosY = m_pViewData->GetCurY();
 }
 
 ScModule* pScMod = SC_MOD();
@@ -165,24 +165,24 @@ void ScViewFunctionSet::BeginDrag()
 if (bRefMode)
 return;
 
-pViewData->GetView()->FakeButtonUp( GetWhich() );   // ButtonUp is 
swallowed
+m_pViewData->GetView()->FakeButtonUp( GetWhich() );   // ButtonUp is 
swallowed
 
-ScMarkData& rMark = pViewData->GetMarkData();
+ScMarkData& rMark = m_pViewData->GetMarkData();
 rMark.MarkToSimple();
 if ( !rMark.IsMarked() || rMark.IsMultiMarked() )
 return;
 
 ScDocumentUniquePtr pClipDoc(new 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-06-28 Thread Henry Castro (via logerrit)
 sc/source/filter/inc/condformatbuffer.hxx |2 ++
 sc/source/filter/oox/condformatbuffer.cxx |5 +
 sc/source/filter/oox/extlstcontext.cxx|2 +-
 3 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit c9518e47f90994cf75adcc77e32ffa034b2f416f
Author: Henry Castro 
AuthorDate: Mon Jun 26 10:43:34 2023 -0400
Commit: Caolán McNamara 
CommitDate: Wed Jun 28 09:41:42 2023 +0200

sc: filter: oox: fix crash delete ScDatabarFormatData

Unfortunately, the instance of "ScDatabarFormatData" is
deleted before finalizeImport is called.

The "maEntries" is not usable, the global format buffer is
required to hold the reference.

 #1 0x7f2ef19081c0 in oox::xls::CondFormatBuffer::finalizeImport() 
co-23.05-asan/sc/source/filter/oox/condformatbuffer.cxx:1322:23
#2 0x7f2ef1ba in 
oox::xls::WorksheetGlobals::finalizeWorksheetImport() 
co-23.05-asan/sc/source/filter/oox/worksheethelper.cxx:942:22
#3 0x7f2ef58d030e in 
sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource
 const&) co-23.05-asan/sax/source/fastparser/fastparser.cxx:910:36
#4 0x7f2ef23f0e46 in 
oox::core::FastParser::parseStream(com::sun::star::xml::sax::InputSource 
const&, bool) co-23.05-asan/oox/source/core/fastparser.cxx:121:15
#5 0x7f2ef23f1544 in

Signed-off-by: Henry Castro 
Change-Id: Ieb3840cc10372867d5462a19d9efa9771f633437
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153600
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/filter/inc/condformatbuffer.hxx 
b/sc/source/filter/inc/condformatbuffer.hxx
index e62917678b9a..9c8896dbf22a 100644
--- a/sc/source/filter/inc/condformatbuffer.hxx
+++ b/sc/source/filter/inc/condformatbuffer.hxx
@@ -307,6 +307,7 @@ public:
 CondFormatRef   importCondFormatting( SequenceInputStream& rStrm );
 ExtCfDataBarRuleRef createExtCfDataBarRule(ScDataBarFormatData* pTarget);
 std::vector< std::unique_ptr >& importExtCondFormat();
+std::vector >& importExtFormatEntries();
 
 /** Converts an OOXML condition operator token to the API constant. */
 static sal_Int32convertToApiOperator( sal_Int32 nToken );
@@ -324,6 +325,7 @@ private:
 CondFormatVec   maCondFormats;  /// All conditional formatting in 
a sheet.
 ExtCfDataBarRuleVecmaCfRules;  /// All external 
conditional formatting rules in a sheet.
 std::vector< std::unique_ptr > maExtCondFormats;
+std::vector > maExtFormatEntries;
 sal_Int32 mnNonPrioritizedRuleNextPriority = 1048576;
 };
 
diff --git a/sc/source/filter/oox/condformatbuffer.cxx 
b/sc/source/filter/oox/condformatbuffer.cxx
index 17747df22461..b9f7bceec0e9 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -1376,6 +1376,11 @@ std::vector< std::unique_ptr >& 
CondFormatBuffer::importExtCond
 return maExtCondFormats;
 }
 
+std::vector >& 
CondFormatBuffer::importExtFormatEntries()
+{
+return maExtFormatEntries;
+}
+
 sal_Int32 CondFormatBuffer::convertToApiOperator( sal_Int32 nToken )
 {
 switch( nToken )
diff --git a/sc/source/filter/oox/extlstcontext.cxx 
b/sc/source/filter/oox/extlstcontext.cxx
index 3209c846f9ce..58e4c7931729 100644
--- a/sc/source/filter/oox/extlstcontext.cxx
+++ b/sc/source/filter/oox/extlstcontext.cxx
@@ -174,7 +174,7 @@ ContextHandlerRef 
ExtConditionalFormattingContext::onCreateContext(sal_Int32 nEl
 {
 auto pFormat = 
std::make_unique(());
 pFormat->SetDataBarData(pInfo);
-maEntries.push_back(std::move(pFormat));
+
getCondFormats().importExtFormatEntries().push_back(std::move(pFormat));
 }
 }
 else


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-06-26 Thread Caolán McNamara (via logerrit)
 sc/source/filter/inc/XclExpChangeTrack.hxx   |7 +++
 sc/source/filter/xcl97/XclExpChangeTrack.cxx |   23 ++-
 2 files changed, 29 insertions(+), 1 deletion(-)

New commits:
commit 6f7231d51a8f671efb2c94424139e90084e22f88
Author: Caolán McNamara 
AuthorDate: Sun Jun 25 11:54:07 2023 +0100
Commit: Michael Meeks 
CommitDate: Mon Jun 26 17:06:51 2023 +0200

crashtesting: crash seen on exporting fdo66241-1.ods to xlsx

Change-Id: I730bd782ddf67555c40651aed1442465574a1c01
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153524
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/sc/source/filter/inc/XclExpChangeTrack.hxx 
b/sc/source/filter/inc/XclExpChangeTrack.hxx
index 9d007ba368f3..9701ba6e29f5 100644
--- a/sc/source/filter/inc/XclExpChangeTrack.hxx
+++ b/sc/source/filter/inc/XclExpChangeTrack.hxx
@@ -28,6 +28,7 @@
 #include "xestring.hxx"
 #include "excrecds.hxx"
 #include "xlformula.hxx"
+#include "xllink.hxx"
 #include "xeformula.hxx"
 
 class ExcXmlRecord : public ExcRecord
@@ -365,6 +366,7 @@ protected:
 static inline void  Write2DAddress( XclExpStream& rStrm, const 
ScAddress& rAddress );
 static inline void  Write2DRange( XclExpStream& rStrm, const 
ScRange& rRange );
 inline sal_uInt16   GetTabId( SCTAB nTabId ) const;
+inline bool IsDeletedTab( SCTAB nTab ) const;
 inline void WriteTabId( XclExpStream& rStrm, SCTAB nTabId 
) const;
 
 // save header data, call SaveActionData()
@@ -421,6 +423,11 @@ inline void XclExpChTrAction::Write2DRange( XclExpStream& 
rStrm, const ScRange&
 << static_cast(rRange.aEnd.Col());
 }
 
+inline bool XclExpChTrAction::IsDeletedTab(SCTAB nTab) const
+{
+return rTabInfo.GetXclTab(nTab) == EXC_TAB_DELETED;
+}
+
 inline sal_uInt16 XclExpChTrAction::GetTabId( SCTAB nTab ) const
 {
 return rIdBuffer.GetId( rTabInfo.GetXclTab( nTab ) );
diff --git a/sc/source/filter/xcl97/XclExpChangeTrack.cxx 
b/sc/source/filter/xcl97/XclExpChangeTrack.cxx
index 57fd143bf659..71156df08e04 100644
--- a/sc/source/filter/xcl97/XclExpChangeTrack.cxx
+++ b/sc/source/filter/xcl97/XclExpChangeTrack.cxx
@@ -573,7 +573,7 @@ void XclExpChTrTabIdBuffer::InitFillup()
 
 sal_uInt16 XclExpChTrTabIdBuffer::GetId( sal_uInt16 nIndex ) const
 {
-OSL_ENSURE( nIndex < nBufSize, "XclExpChTrTabIdBuffer::GetId - out of 
range" );
+assert(nIndex < nBufSize && "XclExpChTrTabIdBuffer::GetId - out of range");
 return pBuffer[ nIndex ];
 }
 
@@ -1025,6 +1025,13 @@ static void lcl_WriteCell( XclExpXmlStream& rStrm, 
sal_Int32 nElement, const ScA
 
 void XclExpChTrCellContent::SaveXml( XclExpXmlStream& rRevisionLogStrm )
 {
+if (IsDeletedTab(aPosition.Tab()))
+{
+// seen on attempt to export tdf66241-1.ods to xlsx
+SAL_WARN("sc", "XclExpChTrCellContent: unable to export position with 
tab of EXC_TAB_DELETED");
+return;
+}
+
 sax_fastparser::FSHelperPtr pStream = rRevisionLogStrm.GetCurrentStream();
 pStream->startElement( XML_rcc,
 XML_rId,OString::number(GetActionNumber()),
@@ -1155,6 +1162,13 @@ static const char* lcl_GetAction( sal_uInt16 nOpCode )
 
 void XclExpChTrInsert::SaveXml( XclExpXmlStream& rRevisionLogStrm )
 {
+if (IsDeletedTab(aRange.aStart.Tab()))
+{
+// seen on attempt to export tdf66241-1.ods to xlsx
+SAL_WARN("sc", "XclExpChTrCellContent: unable to export position with 
tab of EXC_TAB_DELETED");
+return;
+}
+
 sax_fastparser::FSHelperPtr pStream = rRevisionLogStrm.GetCurrentStream();
 pStream->startElement( XML_rrc,
 XML_rId,OString::number(GetActionNumber()),
@@ -1279,6 +1293,13 @@ std::size_t XclExpChTrMoveRange::GetActionByteCount() 
const
 
 void XclExpChTrMoveRange::SaveXml( XclExpXmlStream& rRevisionLogStrm )
 {
+if (IsDeletedTab(aDestRange.aStart.Tab()) || 
IsDeletedTab(aSourceRange.aStart.Tab()))
+{
+// seen on attempt to export tdf66241-1.ods to xlsx
+SAL_WARN("sc", "XclExpChTrCellContent: unable to export position with 
tab of EXC_TAB_DELETED");
+return;
+}
+
 sax_fastparser::FSHelperPtr pStream = rRevisionLogStrm.GetCurrentStream();
 
 pStream->startElement( XML_rm,


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-06-21 Thread Caolán McNamara (via logerrit)
 sc/source/filter/excel/xiname.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 8b692c486d7c7f7addd3788ffe0514b8ba13cc63
Author: Caolán McNamara 
AuthorDate: Sun Jan 29 20:59:44 2023 +
Commit: Caolán McNamara 
CommitDate: Wed Jun 21 14:08:59 2023 +0200

crashtesting: crash in ReadQsiforum-mso-en4-30276.xls

on duplicate names where during import an existing ScRangeData using the
name is deleted on inserting a new one, leaving a XclImpName behind that
still references the deleted ScRangeData. Reverse the order of lookup
of XclImpName so we find the duplicate that references the valid
ScRangeData first.

likely also

forums/xls/forum-mso-en4-69844.xls
forums/xls/forum-mso-en4-69589.xls
forums/xls/forum-mso-en4-69308.xls

see also:

commit 657b3c889ae107d9ccaaab569929a3a1abde3200
Date:   Sat Jan 21 00:08:29 2012 -0500

fdo#44831: Named range should overwrite existing name.

When inserting a new named range, it should overwrite any existing
name if one exists.

Change-Id: I275663cacc34a2b85080c038dc5a199563f3547c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146310
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
(cherry picked from commit ea093514e4fc3a66f57e07486863c22e32db4245)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153348
Reviewed-by: Michael Meeks 
Tested-by: Jenkins CollaboraOffice 

diff --git a/sc/source/filter/excel/xiname.cxx 
b/sc/source/filter/excel/xiname.cxx
index d498dfba492c..cd9e92dfaa93 100644
--- a/sc/source/filter/excel/xiname.cxx
+++ b/sc/source/filter/excel/xiname.cxx
@@ -291,8 +291,15 @@ const XclImpName* XclImpNameManager::FindName( 
std::u16string_view rXclName, SCT
 {
 const XclImpName* pGlobalName = nullptr;   // a found global name
 const XclImpName* pLocalName = nullptr;// a found local name
-for( const auto& rxName : maNameList )
+// If a duplicate name is seen by ScRangeName::insert then the existing
+// name is erased and the new one inserted, so in the case of duplicates
+// the last one seen is valid and the others invalid. So do this lookup in
+// reverse in order to return the XclImpName* that references the valid
+// entry (see tdf#44831 for the insert behavior and 
'forum-mso-en4-30276.xls'
+// for an example of this problem)
+for (auto itName = maNameList.rbegin(); itName != maNameList.rend(); 
++itName)
 {
+const auto& rxName = *itName;
 if( rxName->GetXclName() == rXclName )
 {
 if( rxName->GetScTab() == nScTab )


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-06-21 Thread Caolán McNamara (via logerrit)
 sc/source/core/tool/interpr1.cxx |   10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 48145dddb6265920a20ac70683d5d2f73f7b2b4b
Author: Caolán McNamara 
AuthorDate: Tue Feb 7 10:30:33 2023 +
Commit: Caolán McNamara 
CommitDate: Wed Jun 21 12:30:27 2023 +0200

crashtesting: crash in ScInterpreter::ScCountIfs

seen on importing forum-mso-en4-253817.xls and others

Error: attempt to advance a dereferenceable (start-of-sequence) iterator
which falls outside its valid range.

presumably since:

commit 7674399aac661eb503d7badc53b9a4d68bd9839d
Date:   Fri May 27 19:51:40 2022 +0200

try to range-reduce even COUNTIFS if not matching empty cells

bodge this to fill in 0 for missing ranges

Change-Id: If77d8ab887859f11b240975bb837a27785f500a1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146604
Tested-by: Jenkins
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 
(cherry picked from commit e7897ce47e415e46eb36687f911a9a4b09ca6b8a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153376
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Noel Grandin 
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 7283002f328d..1fbe376edff1 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -6134,8 +6134,14 @@ void ScInterpreter::IterateParametersIfs( 
double(*ResultFunc)( const sc::ParamIf
 {
 newConditions.insert( newConditions.end(), 
nStartRowDiff, 0 );
 SCCOL oldCol = col - ( nCol1 + nStartColDiff );
-auto it = vConditions.begin() + oldCol * 
nDimensionRows;
-newConditions.insert( newConditions.end(), it, it + 
nDimensionRows );
+size_t nIndex = oldCol * nDimensionRows;
+if (nIndex < vConditions.size())
+{
+auto it = vConditions.begin() + nIndex;
+newConditions.insert( newConditions.end(), it, it 
+ nDimensionRows );
+}
+else
+newConditions.insert( newConditions.end(), 
nDimensionRows, 0 );
 newConditions.insert( newConditions.end(), 
-nEndRowDiff, 0 );
 }
 for(; col <= nCol2; ++col)


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-06-20 Thread Henry Castro (via logerrit)
 sc/source/ui/view/viewdata.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit f5d668d50ec409051165a3044c3afd89985e365f
Author: Henry Castro 
AuthorDate: Tue May 16 09:50:20 2023 -0400
Commit: Henry Castro 
CommitDate: Tue Jun 20 15:07:53 2023 +0200

lok: sc: reset RTL if it is changed

Reset the LOKSpecialFlags, otherwise the
selection engine select wrong lines.

Signed-off-by: Henry Castro 
Change-Id: I94e33cc3e293330d9a3480bd3838a20c1d94d15f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151841
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153323

diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 8970606face0..e400f1b314ff 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -1626,8 +1626,8 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich,
 pEditView[eWhich]->SetLOKSpecialOutputArea(aPTwipsRect);
 }
 
-if (bLOKLayoutRTL)
-pEditView[eWhich]->SetLOKSpecialFlags(LOKSpecialFlags::LayoutRTL);
+if (bLOKActive && pEditView[eWhich]->HasLOKSpecialPositioning())
+pEditView[eWhich]->SetLOKSpecialFlags(bLOKLayoutRTL ? 
LOKSpecialFlags::LayoutRTL : LOKSpecialFlags::NONE);
 
 tools::Rectangle aOutputArea = pWin->PixelToLogic( aPixRect, 
GetLogicMode() );
 pEditView[eWhich]->SetOutputArea( aOutputArea );


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-06-19 Thread Henry Castro (via logerrit)
 sc/source/filter/oox/condformatbuffer.cxx |   17 +
 1 file changed, 9 insertions(+), 8 deletions(-)

New commits:
commit f451e05d997870bf5eb250bc9d4dc8c39ce1aa85
Author: Henry Castro 
AuthorDate: Mon Jun 19 11:41:52 2023 -0400
Commit: Henry Castro 
CommitDate: Mon Jun 19 23:27:05 2023 +0200

sc: filter: oox: fix setting value to color scale

The COLORSCALE_VALUE setValue method reset the mpCell
that contains formula.

Signed-off-by: Henry Castro 
Change-Id: Idbbfcdc5bce78542ce671753d9a70dcd375e7966
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153280
Tested-by: Jenkins CollaboraOffice 

diff --git a/sc/source/filter/oox/condformatbuffer.cxx 
b/sc/source/filter/oox/condformatbuffer.cxx
index 42d932908191..17747df22461 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -1486,16 +1486,17 @@ void ExtCfDataBarRule::finalizeImport()
 else if (maModel.maColorScaleType == "formula")
 pEntry->SetType(COLORSCALE_FORMULA);
 else if (maModel.maColorScaleType == "num")
-pEntry->SetType(COLORSCALE_VALUE);
-
-if (!maModel.msScaleTypeValue.isEmpty())
 {
-sal_Int32 nSize = 0;
-rtl_math_ConversionStatus eStatus = 
rtl_math_ConversionStatus_Ok;
-double fValue = 
rtl::math::stringToDouble(maModel.msScaleTypeValue, '.', '\0', , 
);
-if (eStatus == rtl_math_ConversionStatus_Ok && nSize == 
maModel.msScaleTypeValue.getLength())
+pEntry->SetType(COLORSCALE_VALUE);
+if (!maModel.msScaleTypeValue.isEmpty())
 {
-pEntry->SetValue(fValue);
+sal_Int32 nSize = 0;
+rtl_math_ConversionStatus eStatus = 
rtl_math_ConversionStatus_Ok;
+double fValue = 
rtl::math::stringToDouble(maModel.msScaleTypeValue, '.', '\0', , 
);
+if (eStatus == rtl_math_ConversionStatus_Ok && nSize == 
maModel.msScaleTypeValue.getLength())
+{
+pEntry->SetValue(fValue);
+}
 }
 }
 break;


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-06-19 Thread Jaume Pujantell Traserra (via logerrit)
 sc/source/ui/app/inputhdl.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 71227a281b4069f7718df9c064e3b237bab1a486
Author: Jaume Pujantell Traserra 
AuthorDate: Fri Jun 16 09:01:27 2023 +0200
Commit: Andras Timar 
CommitDate: Mon Jun 19 20:07:45 2023 +0200

fix crash on LOKIT spelling dialog

Update active view before trying to access it's selection.

Change-Id: Ic83d335216304f7122005e447f5bd1c1484d0eb2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153167
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 6a84353d6b13..85fef841d116 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -4270,6 +4270,7 @@ void ScInputHandler::NotifyChange( const ScInputHdlState* 
pState,
 
 if (comphelper::LibreOfficeKit::isActive() && 
pActiveViewSh)
 {
+UpdateActiveView();
 EditView* pActiveView = pTopView ? pTopView : 
pTableView;
 ESelection aSel = pActiveView ? 
pActiveView->GetSelection() : ESelection();
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-06-16 Thread Caolán McNamara (via logerrit)
 sc/source/filter/oox/condformatbuffer.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b56cc148ec30ecbddf32a733fdd13d1bf68b
Author: Caolán McNamara 
AuthorDate: Wed Jun 14 15:37:08 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Jun 16 09:42:52 2023 +0200

cid#1532384 Out-of-bounds read

sizeof returns num of bytes, not num of elements

Change-Id: I9dea109e5f322d93ee10680f120b15554efa92e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153070
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Henry Castro 
(cherry picked from commit 631f99be735735fd3422516441f18bff7782972c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153029
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/filter/oox/condformatbuffer.cxx 
b/sc/source/filter/oox/condformatbuffer.cxx
index c83f4676ba54..42d932908191 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -267,7 +267,7 @@ static ::Color IndexedColors[] = {
 else if (rAttribs.hasAttribute(XML_indexed))
 {
 sal_uInt32 nIndexed = rAttribs.getUnsigned(XML_indexed, 0);
-if (nIndexed < sizeof(IndexedColors))
+if (nIndexed < std::size(IndexedColors))
 nColor = IndexedColors[nIndexed];
 }
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-06-03 Thread Noel Grandin (via logerrit)
 sc/source/core/data/table2.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit cea4168db118f1f545772fd0d0aecf99512d401b
Author: Noel Grandin 
AuthorDate: Fri Jun 2 20:51:53 2023 +0200
Commit: Noel Grandin 
CommitDate: Sat Jun 3 13:04:07 2023 +0200

remove unnecessary ScPatternAttr copy

slightly speeds up loading document with large number of patterns

Change-Id: I1b82145fb0f8a62da0d5a46a43594f7085ce2c22
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152564
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit c01fa7ff3bcd3447ea190bcc1833beb7c48a8803)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152535
Tested-by: Jenkins CollaboraOffice 

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 47b3d1634c77..9a163e25b74e 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -2907,8 +2907,7 @@ namespace
 std::vector aData(rOrigData);
 for (size_t nIdx = 0; nIdx < aData.size(); ++nIdx)
 {
-ScPatternAttr aNewPattern(*aData[nIdx].pPattern);
-aData[nIdx].pPattern = ()->Put(aNewPattern);
+aData[nIdx].pPattern = 
()->Put(*aData[nIdx].pPattern);
 }
 return aData;
 }


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-06-02 Thread Caolán McNamara (via logerrit)
 sc/source/core/tool/viewopti.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit f1ff0918b11ea2f15267759af8412f208ee39783
Author: Caolán McNamara 
AuthorDate: Fri Jun 2 11:10:05 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Jun 2 12:35:38 2023 +0200

set default aDocCol in ctor to avoid white text on white bg in calc

for the case that ScModule::ConfigurationChanged doesn't get called yet
we want the bg to start with its default color otherwise I get white
text on white background

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

diff --git a/sc/source/core/tool/viewopti.cxx b/sc/source/core/tool/viewopti.cxx
index 9861dd0f3feb..46f3d13227e8 100644
--- a/sc/source/core/tool/viewopti.cxx
+++ b/sc/source/core/tool/viewopti.cxx
@@ -21,10 +21,12 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
 #include 
+#include 
 #include 
 
 using namespace utl;
@@ -112,6 +114,8 @@ void ScViewOptions::SetDefaults()
 
 aGridCol = SC_STD_GRIDCOLOR;
 
+aDocCol  = 
SC_MOD()->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor;
+
 aGridOpt.SetDefaults();
 }
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-05-22 Thread Henry Castro (via logerrit)
 sc/source/filter/inc/condformatbuffer.hxx |1 +
 sc/source/filter/oox/condformatbuffer.cxx |   18 +++---
 2 files changed, 16 insertions(+), 3 deletions(-)

New commits:
commit 805c4cddd82d08e803fb921728f3f0b6a1b30ee9
Author: Henry Castro 
AuthorDate: Tue Mar 28 17:55:17 2023 -0400
Commit: Henry Castro 
CommitDate: Tue May 23 01:01:45 2023 +0200

sc: filter: oox: only insert conditional format if has items

Otherwise, the empty conditional format will exists.

Signed-off-by: Henry Castro 
Change-Id: I99d83bd50ce4c12ef9be6924cba31b8847c0ad07
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149720
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151978
Tested-by: Jenkins CollaboraOffice 

diff --git a/sc/source/filter/inc/condformatbuffer.hxx 
b/sc/source/filter/inc/condformatbuffer.hxx
index 9d3cc83fc953..e62917678b9a 100644
--- a/sc/source/filter/inc/condformatbuffer.hxx
+++ b/sc/source/filter/inc/condformatbuffer.hxx
@@ -202,6 +202,7 @@ class CondFormat final : public WorksheetHelper
 friend class CondFormatBuffer;
 public:
 explicitCondFormat( const WorksheetHelper& rHelper );
+~CondFormat();
 
 /** Imports settings from the conditionalFormatting element. */
 voidimportConditionalFormatting( const AttributeList& 
rAttribs );
diff --git a/sc/source/filter/oox/condformatbuffer.cxx 
b/sc/source/filter/oox/condformatbuffer.cxx
index 1d5e55fdbc1b..c83f4676ba54 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -1099,6 +1099,12 @@ CondFormat::CondFormat( const WorksheetHelper& rHelper ) 
:
 {
 }
 
+CondFormat::~CondFormat()
+{
+if (!mbReadyForFinalize && mpFormat)
+delete mpFormat;
+}
+
 void CondFormat::importConditionalFormatting( const AttributeList& rAttribs )
 {
 getAddressConverter().convertToCellRangeList( maModel.maRanges, 
rAttribs.getString( XML_sqref, OUString() ), getSheetIndex(), true );
@@ -1137,10 +1143,16 @@ void CondFormat::finalizeImport()
 ScDocument& rDoc = getScDocument();
 mpFormat->SetRange(maModel.maRanges);
 maRules.forEachMem( ::finalizeImport );
-SCTAB nTab = maModel.maRanges.GetTopLeftCorner().Tab();
-sal_Int32 nIndex = 
getScDocument().AddCondFormat(std::unique_ptr(mpFormat), 
nTab);
 
-rDoc.AddCondFormatData( maModel.maRanges, nTab, nIndex );
+if (mpFormat->size() > 0)
+{
+SCTAB nTab = maModel.maRanges.GetTopLeftCorner().Tab();
+sal_Int32 nIndex = 
getScDocument().AddCondFormat(std::unique_ptr(mpFormat), 
nTab);
+
+rDoc.AddCondFormatData( maModel.maRanges, nTab, nIndex );
+}
+else
+mbReadyForFinalize = false;
 }
 
 CondFormatRuleRef CondFormat::createRule()


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-05-22 Thread Henry Castro (via logerrit)
 sc/source/ui/view/viewdata.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4864bc29dade0c3eedd3192476e7c206dc4eedff
Author: Henry Castro 
AuthorDate: Fri May 19 15:22:59 2023 -0400
Commit: Henry Castro 
CommitDate: Mon May 22 23:49:48 2023 +0200

lok: sc: disable Value Highlighting

If the document is saved with the option:

View - Value Highlighting

The online client side does not have implemented yet, otherwise
will not paint the cell background.

Signed-off-by: Henry Castro 
Change-Id: I05b1a2ef63602a7bf34f717b87c304d00a8c8efc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152019
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152135

diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 29161ac7e01b..8970606face0 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -3944,7 +3944,7 @@ void ScViewData::ReadUserDataSequence(const uno::Sequence 

 if ( rSetting.Value >>= nTemp16 )
 maOptions.SetObjMode(VOBJ_TYPE_DRAW, (nTemp16 == 1) ? 
VOBJ_MODE_HIDE : VOBJ_MODE_SHOW);
 }
-else if ( sName == SC_UNO_VALUEHIGH )
+else if ( sName == SC_UNO_VALUEHIGH && 
!comphelper::LibreOfficeKit::isActive() )
 maOptions.SetOption(VOPT_SYNTAX, 
ScUnoHelpFunctions::GetBoolFromAny(rSetting.Value));
 else
 {


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-05-22 Thread Henry Castro (via logerrit)
 sc/source/filter/inc/condformatbuffer.hxx  |3 +--
 sc/source/filter/oox/condformatbuffer.cxx  |2 +-
 sc/source/filter/oox/condformatcontext.cxx |5 +++--
 3 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit d695f76f23bbdf072fffa48b3a49604287109d47
Author: Henry Castro 
AuthorDate: Fri Apr 14 14:26:32 2023 -0400
Commit: Henry Castro 
CommitDate: Mon May 22 15:53:46 2023 +0200

sc: filter: oxx: insert more rules same range

If there are rules with the same range to preserve
priority order.


 
  "GO"
 


 
  NOT(ISERROR(SEARCH("R",E11)))
 


 
  NOT(ISERROR(SEARCH("R",E11)))
 


Signed-off-by: Henry Castro 
Change-Id: Ibb98953f0a50140dbde4d52a79fde968095881d1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150436
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151980

diff --git a/sc/source/filter/inc/condformatbuffer.hxx 
b/sc/source/filter/inc/condformatbuffer.hxx
index 81961151beb8..9d3cc83fc953 100644
--- a/sc/source/filter/inc/condformatbuffer.hxx
+++ b/sc/source/filter/inc/condformatbuffer.hxx
@@ -168,7 +168,6 @@ public:
 
 /** Returns the priority of this rule. */
 sal_Int32getPriority() const { return maModel.mnPriority; }
-ColorScaleRule* getCurColorScale() const { return mpColor.get(); }
 
 ColorScaleRule* getColorScale();
 DataBarRule*getDataBar();
@@ -312,7 +311,7 @@ public:
 static sal_Int32convertToApiOperator( sal_Int32 nToken );
 static ScConditionMode convertToInternalOperator( sal_Int32 nToken );
 voidfinalizeImport();
-boolinsertColorScale(CondFormatRef const & xCondFmt, 
CondFormatRuleRef const & xRule);
+boolinsertRule(CondFormatRef const & xCondFmt, 
CondFormatRuleRef const & xRule);
 
 private:
 CondFormatRef   createCondFormat();
diff --git a/sc/source/filter/oox/condformatbuffer.cxx 
b/sc/source/filter/oox/condformatbuffer.cxx
index 4b5ad187daa6..1d5e55fdbc1b 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -1208,7 +1208,7 @@ void CondFormatBuffer::updateImport(const 
ScDataBarFormatData* pTarget)
 }
 }
 
-bool CondFormatBuffer::insertColorScale(CondFormatRef const & xCondFmt, 
CondFormatRuleRef const & xRule)
+bool CondFormatBuffer::insertRule(CondFormatRef const & xCondFmt, 
CondFormatRuleRef const & xRule)
 {
 CondFormatRef xFoundFmt;
 ScRangeList aRanges = xCondFmt->getRanges();
diff --git a/sc/source/filter/oox/condformatcontext.cxx 
b/sc/source/filter/oox/condformatcontext.cxx
index a28b7b12453d..5da1f721ffc6 100644
--- a/sc/source/filter/oox/condformatcontext.cxx
+++ b/sc/source/filter/oox/condformatcontext.cxx
@@ -205,8 +205,9 @@ void CondFormatContext::onEndElement()
 case XLS_TOKEN( cfRule ):
 if (mxCondFmt && mxRule)
 {
-if (!mxRule->getCurColorScale() ||
-!getCondFormats().insertColorScale(mxCondFmt, mxRule))
+ScRangeList aRanges = mxCondFmt->getRanges();
+if ((aRanges.size() == 1 && aRanges.GetCellCount() == 1) ||
+!getCondFormats().insertRule(mxCondFmt, mxRule))
 mxCondFmt->insertRule(mxRule);
 }
 break;


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-05-21 Thread Henry Castro (via logerrit)
 sc/source/filter/inc/condformatbuffer.hxx  |4 
 sc/source/filter/oox/condformatbuffer.cxx  |   25 +
 sc/source/filter/oox/condformatcontext.cxx |4 +++-
 3 files changed, 32 insertions(+), 1 deletion(-)

New commits:
commit ab2d590b0a9df03fcf9f1e559d15cfb29c59b8c8
Author: Henry Castro 
AuthorDate: Tue Mar 28 18:03:21 2023 -0400
Commit: Henry Castro 
CommitDate: Sun May 21 14:01:38 2023 +0200

sc: filter: oox: fix conditional color scale same range

Otherwise, the condition color scale the priority order will be lost.


 
  
   
   
   
   
  
 



 
  
   
   
   
   
  
 


Signed-off-by: Henry Castro 
Change-Id: I33fa73bfe8f0bada1cf79bc07be2e43495a4290c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149721
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151979
Tested-by: Jenkins CollaboraOffice 

diff --git a/sc/source/filter/inc/condformatbuffer.hxx 
b/sc/source/filter/inc/condformatbuffer.hxx
index a1cc7bb81381..81961151beb8 100644
--- a/sc/source/filter/inc/condformatbuffer.hxx
+++ b/sc/source/filter/inc/condformatbuffer.hxx
@@ -148,6 +148,7 @@ private:
 /** Represents a single rule in a conditional formatting. */
 class CondFormatRule final : public WorksheetHelper
 {
+friend class CondFormatBuffer;
 public:
 explicitCondFormatRule( const CondFormat& rCondFormat, 
ScConditionalFormat* pFormat );
 
@@ -167,6 +168,7 @@ public:
 
 /** Returns the priority of this rule. */
 sal_Int32getPriority() const { return maModel.mnPriority; }
+ColorScaleRule* getCurColorScale() const { return mpColor.get(); }
 
 ColorScaleRule* getColorScale();
 DataBarRule*getDataBar();
@@ -310,6 +312,8 @@ public:
 static sal_Int32convertToApiOperator( sal_Int32 nToken );
 static ScConditionMode convertToInternalOperator( sal_Int32 nToken );
 voidfinalizeImport();
+boolinsertColorScale(CondFormatRef const & xCondFmt, 
CondFormatRuleRef const & xRule);
+
 private:
 CondFormatRef   createCondFormat();
 voidupdateImport(const ScDataBarFormatData* pTarget);
diff --git a/sc/source/filter/oox/condformatbuffer.cxx 
b/sc/source/filter/oox/condformatbuffer.cxx
index fede0d344182..4b5ad187daa6 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -1208,6 +1208,31 @@ void CondFormatBuffer::updateImport(const 
ScDataBarFormatData* pTarget)
 }
 }
 
+bool CondFormatBuffer::insertColorScale(CondFormatRef const & xCondFmt, 
CondFormatRuleRef const & xRule)
+{
+CondFormatRef xFoundFmt;
+ScRangeList aRanges = xCondFmt->getRanges();
+
+for (auto& rCondFmt : maCondFormats)
+{
+if (xCondFmt == rCondFmt)
+continue;
+
+if (aRanges == rCondFmt->getRanges())
+{
+xFoundFmt = rCondFmt;
+break;
+}
+}
+
+if (xFoundFmt)
+{
+xRule->mpFormat = xFoundFmt->mpFormat;
+xFoundFmt->insertRule(xRule);
+}
+
+return (bool)xFoundFmt;
+}
 
 void CondFormatBuffer::finalizeImport()
 {
diff --git a/sc/source/filter/oox/condformatcontext.cxx 
b/sc/source/filter/oox/condformatcontext.cxx
index 845d105b7605..a28b7b12453d 100644
--- a/sc/source/filter/oox/condformatcontext.cxx
+++ b/sc/source/filter/oox/condformatcontext.cxx
@@ -205,7 +205,9 @@ void CondFormatContext::onEndElement()
 case XLS_TOKEN( cfRule ):
 if (mxCondFmt && mxRule)
 {
-mxCondFmt->insertRule(mxRule);
+if (!mxRule->getCurColorScale() ||
+!getCondFormats().insertColorScale(mxCondFmt, mxRule))
+mxCondFmt->insertRule(mxRule);
 }
 break;
 }


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-05-21 Thread Henry Castro (via logerrit)
 sc/source/ui/view/gridwin.cxx |   74 --
 1 file changed, 71 insertions(+), 3 deletions(-)

New commits:
commit 9df77234026458c28897479a6db9ff9e9c88788d
Author: Henry Castro 
AuthorDate: Thu Apr 27 17:05:09 2023 -0400
Commit: Henry Castro 
CommitDate: Sun May 21 14:01:02 2023 +0200

lok: sc: fix layout RTL mouse selection

If the Calc is in layout RTL, the edit view mouse
selection does not change.

Signed-off-by: Henry Castro 
Change-Id: I0bd2640dac3cdc96fa247c305c379b2d1a8564ee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150757
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151974
Tested-by: Jenkins CollaboraOffice 

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 9c63aafe70e0..257ca66e6e61 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -50,6 +50,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -346,6 +347,18 @@ static bool lcl_GetHyperlinkCell(
 return bFound;
 }
 
+static void lcl_GetMirror(Point& rPoint, tools::Rectangle& rRect, const 
tools::Long nWidth)
+{
+tools::Long nLeft = rRect.Left();
+tools::Long nRight = rRect.Right();
+tools::Long nMirrorPX = o3tl::convert(nWidth, o3tl::Length::twip, 
o3tl::Length::px);
+tools::Long nMirrorMM = o3tl::convert(nWidth, o3tl::Length::twip, 
o3tl::Length::mm100);
+
+rPoint.setX(nMirrorPX - rPoint.X());
+rRect.SetLeft(nMirrorMM - nRight);
+rRect.SetRight(nMirrorMM - nLeft);
+}
+
 //  WB_DIALOGCONTROL needed for UNO-Controls
 ScGridWindow::ScGridWindow( vcl::Window* pParent, ScViewData& rData, 
ScSplitPos eWhichPos )
 :   DocWindow( pParent, WB_CLIPCHILDREN | WB_DIALOGCONTROL ),
@@ -1851,7 +1864,25 @@ void ScGridWindow::HandleMouseButtonDown( const 
MouseEvent& rMEvt, MouseEventSta
 
 pScMod->SetInputMode( SC_INPUT_TABLE );
 bEEMouse = true;
-pEditView->MouseButtonDown( rMEvt );
+
+if (comphelper::LibreOfficeKit::isActive() && 
rDoc.IsLayoutRTL(mrViewData.GetTabNo()))
+{
+Point aMouse = rMEvt.GetPosPixel();
+tools::Rectangle aOutputArea = pEditView->GetOutputArea();
+comphelper::ScopeGuard aOutputGuard(
+[pEditView, aOutputArea] {
+pEditView->SetOutputArea(aOutputArea);
+});
+
+lcl_GetMirror(aMouse, aOutputArea, 
mrViewData.getLOKVisibleArea().GetWidth());
+pEditView->SetOutputArea(aOutputArea);
+
+MouseEvent aEvent(aMouse, rMEvt.GetClicks(), rMEvt.GetMode(),
+  rMEvt.GetButtons(), rMEvt.GetModifier());
+pEditView->MouseButtonDown( aEvent );
+}
+else
+pEditView->MouseButtonDown( rMEvt );
 return;
 }
 }
@@ -2119,7 +2150,25 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& 
rMEvt )
 SCCOL   nEditCol;
 SCROW   nEditRow;
 mrViewData.GetEditView( eWhich, pEditView, nEditCol, nEditRow );
-pEditView->MouseButtonUp( rMEvt );
+
+if (comphelper::LibreOfficeKit::isActive() && 
rDoc.IsLayoutRTL(mrViewData.GetTabNo()))
+{
+Point aMouse = rMEvt.GetPosPixel();
+tools::Rectangle aOutputArea = pEditView->GetOutputArea();
+comphelper::ScopeGuard aOutputGuard(
+[pEditView, aOutputArea] {
+pEditView->SetOutputArea(aOutputArea);
+});
+
+lcl_GetMirror(aMouse, aOutputArea, 
mrViewData.getLOKVisibleArea().GetWidth());
+pEditView->SetOutputArea(aOutputArea);
+
+MouseEvent aEvent(aMouse, rMEvt.GetClicks(), rMEvt.GetMode(),
+  rMEvt.GetButtons(), rMEvt.GetModifier());
+pEditView->MouseButtonUp( aEvent );
+}
+else
+pEditView->MouseButtonUp( rMEvt );
 
 if ( rMEvt.IsMiddle() &&
  GetSettings().GetMouseSettings().GetMiddleButtonAction() == 
MouseMiddleButtonAction::PasteSelection )
@@ -2612,7 +2661,26 @@ void ScGridWindow::MouseMove( const MouseEvent& rMEvt )
 SCCOL   nEditCol;
 SCROW   nEditRow;
 mrViewData.GetEditView( eWhich, pEditView, nEditCol, nEditRow );
-pEditView->MouseMove( rMEvt );
+
+if (comphelper::LibreOfficeKit::isActive() && 
mrViewData.GetDocument().IsLayoutRTL(mrViewData.GetTabNo()))
+{
+Point aMouse = rMEvt.GetPosPixel();
+tools::Rectangle aOutputArea = pEditView->GetOutputArea();
+comphelper::ScopeGuard aOutputGuard(
+[pEditView, aOutputArea] {
+pEditView->SetOutputArea(aOutputArea);
+});
+
+lcl_GetMirror(aMouse, aOutputArea, 
mrViewData.getLOKVisibleArea().GetWidth());
+

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-05-20 Thread Henry Castro (via logerrit)
 sc/source/ui/view/gridwin4.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 1ede9695bbbddaaf1561364d7c2d2b5c30c207d3
Author: Henry Castro 
AuthorDate: Thu Apr 27 16:34:54 2023 -0400
Commit: Henry Castro 
CommitDate: Sat May 20 22:23:07 2023 +0200

lok: sc: restore edit output area

The edit view output area is modified after the draw,
restore it so the mouse can handle selection at layout RTL.

Signed-off-by: Henry Castro 
Change-Id: I94dd9db385a3a9c60f015027894338504b4ce533
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151146
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151972
Tested-by: Jenkins CollaboraOffice 

diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index b6590530d44a..086456daaae1 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -34,6 +34,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -1192,6 +1193,11 @@ void ScGridWindow::DrawContent(OutputDevice , 
const ScTableInfo& rTableI
 // Avoid sending wrong cursor/selection messages 
by the 'other' view, as the output-area is going
 // to be tweaked temporarily to match the current 
view's zoom.
 SuppressEditViewMessagesGuard 
aGuard(*pOtherEditView);
+comphelper::ScopeGuard aOutputGuard(
+[pOtherEditView, aOrigOutputArea, bLokRTL] {
+if (bLokRTL && aOrigOutputArea != 
pOtherEditView->GetOutputArea())
+
pOtherEditView->SetOutputArea(aOrigOutputArea);
+});
 
 aEditRect = rDevice.PixelToLogic(aEditRect);
 if (bIsTiledRendering)


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-05-19 Thread Henry Castro (via logerrit)
 sc/source/filter/oox/condformatbuffer.cxx |   19 +++
 1 file changed, 11 insertions(+), 8 deletions(-)

New commits:
commit 779f8ec53a6395e7b97b93978d0f196b1f332f89
Author: Henry Castro 
AuthorDate: Tue Mar 28 11:28:05 2023 -0400
Commit: Henry Castro 
CommitDate: Fri May 19 13:12:48 2023 +0200

sc: filter: oox: fix conditional color scale empty value \"\"

Signed-off-by: Henry Castro 
Change-Id: I115c3731db85267d115efd24739470bffaeace40
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149718
Tested-by: Andras Timar 
Reviewed-by: Andras Timar 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151976
Tested-by: Jenkins CollaboraOffice 

diff --git a/sc/source/filter/oox/condformatbuffer.cxx 
b/sc/source/filter/oox/condformatbuffer.cxx
index c1b7b6d84c9d..fede0d344182 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -116,15 +116,18 @@ void SetCfvoData( ColorScaleRuleModelEntry* pEntry, const 
AttributeList& rAttrib
 OUString aType = rAttribs.getString( XML_type, OUString() );
 OUString aVal = rAttribs.getString(XML_val, OUString());
 
-double nVal = 0.0;
-bool bVal = isValue(aVal, nVal);
-if( !bVal || aType == "formula" )
-{
-pEntry->maFormula = aVal;
-}
-else
+if (aVal != "\"\"")
 {
-pEntry->mnVal = nVal;
+double nVal = 0.0;
+bool bVal = isValue(aVal, nVal);
+if( !bVal || aType == "formula" )
+{
+pEntry->maFormula = aVal;
+}
+else
+{
+pEntry->mnVal = nVal;
+}
 }
 
 if (aType == "num")


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-05-18 Thread Henry Castro (via logerrit)
 sc/source/filter/inc/condformatbuffer.hxx  |2 +-
 sc/source/filter/oox/condformatbuffer.cxx  |1 -
 sc/source/filter/oox/condformatcontext.cxx |6 ++
 3 files changed, 7 insertions(+), 2 deletions(-)

New commits:
commit dc3d0f58f1dfff8082e4faf0916103b6557f4079
Author: Henry Castro 
AuthorDate: Tue Mar 28 17:48:19 2023 -0400
Commit: Henry Castro 
CommitDate: Fri May 19 01:18:18 2023 +0200

sc: filter: oox: do not insert rule too early

The  tag is a good place to do a post check
the conditional format sanity.

Signed-off-by: Henry Castro 
Change-Id: Id6e99c81011040ec47034e993490fae5c71d7e04
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149719
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151977
Tested-by: Jenkins CollaboraOffice 

diff --git a/sc/source/filter/inc/condformatbuffer.hxx 
b/sc/source/filter/inc/condformatbuffer.hxx
index d5d5ebac2ab5..a1cc7bb81381 100644
--- a/sc/source/filter/inc/condformatbuffer.hxx
+++ b/sc/source/filter/inc/condformatbuffer.hxx
@@ -219,9 +219,9 @@ public:
 const ScRangeList& getRanges() const { return maModel.maRanges; }
 
 voidsetReadyForFinalize() { mbReadyForFinalize = true; }
+voidinsertRule( CondFormatRuleRef const & xRule );
 private:
 CondFormatRuleRef   createRule();
-voidinsertRule( CondFormatRuleRef const & xRule );
 
 private:
 typedef RefMap< sal_Int32, CondFormatRule > CondFormatRuleMap;
diff --git a/sc/source/filter/oox/condformatbuffer.cxx 
b/sc/source/filter/oox/condformatbuffer.cxx
index 2960610f34dd..c1b7b6d84c9d 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -1107,7 +1107,6 @@ CondFormatRuleRef CondFormat::importCfRule( const 
AttributeList& rAttribs )
 {
 CondFormatRuleRef xRule = createRule();
 xRule->importCfRule( rAttribs );
-insertRule( xRule );
 return xRule;
 }
 
diff --git a/sc/source/filter/oox/condformatcontext.cxx 
b/sc/source/filter/oox/condformatcontext.cxx
index 2f3ae391ab71..845d105b7605 100644
--- a/sc/source/filter/oox/condformatcontext.cxx
+++ b/sc/source/filter/oox/condformatcontext.cxx
@@ -202,6 +202,12 @@ void CondFormatContext::onEndElement()
 if(mxCondFmt)
 mxCondFmt->setReadyForFinalize();
 break;
+case XLS_TOKEN( cfRule ):
+if (mxCondFmt && mxRule)
+{
+mxCondFmt->insertRule(mxRule);
+}
+break;
 }
 }
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-05-18 Thread shehr (via logerrit)
 sc/source/core/data/validat.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3a869a4ba79795715e91bd3c24e177148e6d238b
Author: shehr 
AuthorDate: Wed May 17 16:18:42 2023 +0500
Commit: Andras Timar 
CommitDate: Thu May 18 20:33:41 2023 +0200

JSDialog:  Validity message dialog is tunneled #6327

Change-Id: I83b181b5b613fa8c973f673e1afdc6ee12422545
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151886
Reviewed-by: Szymon Kłos 
Tested-by: Jenkins
(cherry picked from commit 0d2cdb780609b5ead22f1e82347240e06dac2afa)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151915
Tested-by: Jenkins CollaboraOffice 

diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx
index 009bc0eaebe7..befdbb40831d 100644
--- a/sc/source/core/data/validat.cxx
+++ b/sc/source/core/data/validat.cxx
@@ -406,7 +406,7 @@ bool ScValidationData::DoError(weld::Window* pParent, const 
OUString& rInput,
 }
 
 std::unique_ptr 
xBox(Application::CreateMessageDialog(pParent, eType,
-  eStyle, aMessage));
+  eStyle, aMessage, 
SfxViewShell::Current()));
 xBox->set_title(aTitle);
 xBox->SetInstallLOKNotifierHdl(LINK(nullptr, ScValidationData, 
InstallLOKNotifierHdl));
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-05-17 Thread Henry Castro (via logerrit)
 sc/source/filter/oox/extlstcontext.cxx |   18 +++---
 1 file changed, 15 insertions(+), 3 deletions(-)

New commits:
commit 5318e31dfff2994e9f447aea9127a1da8ebc015a
Author: Henry Castro 
AuthorDate: Fri Mar 17 11:07:14 2023 -0400
Commit: Henry Castro 
CommitDate: Wed May 17 17:05:22 2023 +0200

sc: filter: oox: insert a new entry ScDataBarFormat if Id attribute...

does not exist:


 
  
   0
  
  
   1
  
  
  
  
  
  
 


Signed-off-by: Henry Castro 
Change-Id: Ie2c1ba2c85d9eead963f4d9b1684d72b64fe815d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149069
Tested-by: Jenkins CollaboraOffice 

diff --git a/sc/source/filter/oox/extlstcontext.cxx 
b/sc/source/filter/oox/extlstcontext.cxx
index 5328accac5c8..3209c846f9ce 100644
--- a/sc/source/filter/oox/extlstcontext.cxx
+++ b/sc/source/filter/oox/extlstcontext.cxx
@@ -165,11 +165,23 @@ ContextHandlerRef 
ExtConditionalFormattingContext::onCreateContext(sal_Int32 nEl
 if (aType == "dataBar")
 {
 // an ext entry does not need to have an existing corresponding 
entry
+ScDataBarFormatData* pInfo;
 ExtLst::const_iterator aExt = getExtLst().find( aId );
-if(aExt == getExtLst().end())
-return nullptr;
+if (aExt == getExtLst().end())
+{
+pInfo = new ScDataBarFormatData();
+if (pInfo)
+{
+auto pFormat = 
std::make_unique(());
+pFormat->SetDataBarData(pInfo);
+maEntries.push_back(std::move(pFormat));
+}
+}
+else
+{
+pInfo = aExt->second;
+}
 
-ScDataBarFormatData* pInfo = aExt->second;
 if (!pInfo)
 {
 return nullptr;


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-05-17 Thread Henry Castro (via logerrit)
 sc/source/filter/inc/condformatbuffer.hxx |2 ++
 sc/source/filter/oox/condformatbuffer.cxx |   12 
 2 files changed, 14 insertions(+)

New commits:
commit cb58d4c19873e755c17927e82d31e28faa4fa432
Author: Henry Castro 
AuthorDate: Fri Mar 17 15:07:42 2023 -0400
Commit: Henry Castro 
CommitDate: Wed May 17 15:18:59 2023 +0200

sc: filter: oox: update databar format before clone

The ScDataBarFormatData should update from import (finalizeImport)
before cloning, otherwise it loose data.

Signed-off-by: Henry Castro 
Change-Id: I4af8b79e93eed8091bf01244bacac1d12e591c45
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149068
Tested-by: Jenkins CollaboraOffice 

diff --git a/sc/source/filter/inc/condformatbuffer.hxx 
b/sc/source/filter/inc/condformatbuffer.hxx
index cdc8d4727baf..d5d5ebac2ab5 100644
--- a/sc/source/filter/inc/condformatbuffer.hxx
+++ b/sc/source/filter/inc/condformatbuffer.hxx
@@ -271,6 +271,7 @@ public:
 void importAxisColor(  const AttributeList& rAttribs );
 void importCfvo(  const AttributeList& rAttribs );
 ExCfRuleModel& getModel() { return maModel; }
+const ScDataBarFormatData* GetDataBarData() { return mpTarget; }
 };
 
 class ExtCfCondFormat
@@ -311,6 +312,7 @@ public:
 voidfinalizeImport();
 private:
 CondFormatRef   createCondFormat();
+voidupdateImport(const ScDataBarFormatData* pTarget);
 
 private:
 typedef RefVector< CondFormat > CondFormatVec;
diff --git a/sc/source/filter/oox/condformatbuffer.cxx 
b/sc/source/filter/oox/condformatbuffer.cxx
index 5e3e0d4a18b5..2960610f34dd 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -1197,6 +1197,16 @@ public:
 
 }
 
+void CondFormatBuffer::updateImport(const ScDataBarFormatData* pTarget)
+{
+for ( const auto& rRule : maCfRules )
+{
+if ( rRule && rRule->GetDataBarData() == pTarget )
+rRule->finalizeImport();
+}
+}
+
+
 void CondFormatBuffer::finalizeImport()
 {
 std::unordered_set aDoneExtCFs;
@@ -1224,6 +1234,8 @@ void CondFormatBuffer::finalizeImport()
 for (const auto& rxEntry : rEntries)
 {
 CondFormatRuleRef xRule = rCondFormat.createRule();
+if (ScDataBarFormat *pData = 
dynamic_cast(rxEntry.get()))
+updateImport(pData->GetDataBarData());
 ScFormatEntry* pNewEntry = rxEntry->Clone(pDoc);
 sal_Int32 nPriority = rPriorities[nEntryIdx];
 if (nPriority == -1)


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-05-16 Thread Henry Castro (via logerrit)
 sc/source/filter/oox/extlstcontext.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit c3d7e44b27f3e30a0d078150c70403374b4cd583
Author: Henry Castro 
AuthorDate: Fri Mar 17 11:03:36 2023 -0400
Commit: Henry Castro 
CommitDate: Wed May 17 01:24:25 2023 +0200

sc: filter: oox: add missing formula if it is a text ...

conditional format:


  NOT(ISERROR(SEARCH("Done",C1)))
  
  
   
  
  
   


   
  
 


Signed-off-by: Henry Castro 
Change-Id: I4da117a1a122b3895788645dcd5de3e36cdcad0f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149067
Tested-by: Jenkins CollaboraOffice 

diff --git a/sc/source/filter/oox/extlstcontext.cxx 
b/sc/source/filter/oox/extlstcontext.cxx
index 2646f0969958..5328accac5c8 100644
--- a/sc/source/filter/oox/extlstcontext.cxx
+++ b/sc/source/filter/oox/extlstcontext.cxx
@@ -274,6 +274,12 @@ void ExtConditionalFormattingContext::onEndElement()
 break;
 case XLS14_TOKEN( cfRule ):
 {
+if (IsSpecificTextCondMode(maModel.eOperator) && nFormulaCount == 
1)
+{
+maModel.aFormula = aChars;
+maModel.eOperator = ScConditionMode::Direct;
+}
+
 getStyles().getExtDxfs().forEachMem( ::finalizeImport );
 maModel.aStyle = getStyles().createExtDxfStyle(rStyleIdx);
 rStyleIdx++;


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-05-16 Thread Henry Castro (via logerrit)
 sc/source/filter/html/htmlexp.cxx |   23 ++-
 1 file changed, 22 insertions(+), 1 deletion(-)

New commits:
commit fdc0a082420d511fd0561ba087744518ccade665
Author: Henry Castro 
AuthorDate: Thu May 11 16:29:55 2023 -0400
Commit: Henry Castro 
CommitDate: Wed May 17 00:30:26 2023 +0200

tdf#154477: sc: filter: html: fix missing color scale conditional format

When copying a range cell to an external application that request
html data, the color scale conditional format does not have an
associate a set attribute.

Signed-off-by: Henry Castro 
Change-Id: I82b466a2100abc5070e92f844dc706d9b015c2e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151840
Tested-by: Jenkins CollaboraOffice 

diff --git a/sc/source/filter/html/htmlexp.cxx 
b/sc/source/filter/html/htmlexp.cxx
index 16db15316121..98b2c980f304 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -65,6 +65,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 
 #include 
@@ -881,10 +883,27 @@ void ScHTMLExport::WriteTables()
 
 void ScHTMLExport::WriteCell( sc::ColumnBlockPosition& rBlockPos, SCCOL nCol, 
SCROW nRow, SCTAB nTab )
 {
+std::optional aColorScale;
 ScAddress aPos( nCol, nRow, nTab );
 ScRefCellValue aCell(*pDoc, aPos, rBlockPos);
 const ScPatternAttr* pAttr = pDoc->GetPattern( nCol, nRow, nTab );
 const SfxItemSet* pCondItemSet = pDoc->GetCondResult( nCol, nRow, nTab, 
 );
+if (!pCondItemSet)
+{
+ScConditionalFormatList* pCondList = pDoc->GetCondFormList(nTab);
+const ScCondFormatItem& rCondItem = pAttr->GetItem(ATTR_CONDITIONAL);
+const ScCondFormatIndexes& rCondIndex = rCondItem.GetCondFormatData();
+if (rCondIndex.size() > 0)
+{
+ScConditionalFormat* pCondFmt = 
pCondList->GetFormat(rCondIndex[0]);
+if (pCondFmt)
+{
+const ScColorScaleFormat* pEntry = dynamic_cast(pCondFmt->GetEntry(0));
+if (pEntry)
+aColorScale = pEntry->GetColor(aPos);
+}
+}
+}
 
 const ScMergeFlagAttr& rMergeFlagAttr = pAttr->GetItem( ATTR_MERGE_FLAG, 
pCondItemSet );
 if ( rMergeFlagAttr.IsOverlapped() )
@@ -1023,7 +1042,9 @@ void ScHTMLExport::WriteCell( sc::ColumnBlockPosition& 
rBlockPos, SCCOL nCol, SC
 ATTR_BACKGROUND, pCondItemSet );
 
 Color aBgColor;
-if ( rBrushItem.GetColor().GetAlpha() == 0 )
+if ( aColorScale )
+aBgColor = *aColorScale;
+else if ( rBrushItem.GetColor().GetAlpha() == 0 )
 aBgColor = aHTMLStyle.aBackgroundColor; // No unwanted background color
 else
 aBgColor = rBrushItem.GetColor();


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-05-16 Thread Henry Castro (via logerrit)
 sc/source/filter/inc/condformatbuffer.hxx |1 +
 sc/source/filter/inc/extlstcontext.hxx|4 +++-
 sc/source/filter/oox/condformatbuffer.cxx |   13 +
 sc/source/filter/oox/extlstcontext.cxx|   28 
 4 files changed, 45 insertions(+), 1 deletion(-)

New commits:
commit 147527b53f414e2583ecc4d524681351fab2f696
Author: Henry Castro 
AuthorDate: Fri Mar 17 10:47:31 2023 -0400
Commit: Henry Castro 
CommitDate: Tue May 16 18:08:14 2023 +0200

sc: filter: oox: Add a missing tag child of the parent tag "cfvo"


 
  0
 
 
  1
 
 
 
 
 
 


Signed-off-by: Henry Castro 
Change-Id: Ie98507e11a5cdeb0d1adc77a44fd79edb2f26d6a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149066
Tested-by: Jenkins CollaboraOffice 

diff --git a/sc/source/filter/inc/condformatbuffer.hxx 
b/sc/source/filter/inc/condformatbuffer.hxx
index 1180b1e0aa74..cdc8d4727baf 100644
--- a/sc/source/filter/inc/condformatbuffer.hxx
+++ b/sc/source/filter/inc/condformatbuffer.hxx
@@ -242,6 +242,7 @@ struct ExCfRuleModel
 ::Color mnNegativeColor;
 OUString maAxisPosition; // DataBar
 OUString maColorScaleType; // Cfvo
+OUString msScaleTypeValue; // Cfvo
 bool mbGradient; // DataBar
 bool mbIsLower; // Cfvo
 };
diff --git a/sc/source/filter/inc/extlstcontext.hxx 
b/sc/source/filter/inc/extlstcontext.hxx
index 8635c6029523..077ebdbebf8e 100644
--- a/sc/source/filter/inc/extlstcontext.hxx
+++ b/sc/source/filter/inc/extlstcontext.hxx
@@ -32,11 +32,13 @@ public:
 
 virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 
nElement, const AttributeList& rAttribs ) override;
 virtual voidonStartElement( const AttributeList& rAttribs ) 
override;
+virtual voidonCharacters( const OUString& rChars ) override;
+virtual voidonEndElement() override;
 
 private:
 ScDataBarFormatData* mpTarget;
-
 bool mbFirstEntry;
+ExtCfDataBarRuleRef mpRule;
 };
 
 struct ExtCondFormatRuleModel
diff --git a/sc/source/filter/oox/condformatbuffer.cxx 
b/sc/source/filter/oox/condformatbuffer.cxx
index da99d8ab645e..5e3e0d4a18b5 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -1434,6 +1434,19 @@ void ExtCfDataBarRule::finalizeImport()
 pEntry->SetType(COLORSCALE_PERCENT);
 else if (maModel.maColorScaleType == "formula")
 pEntry->SetType(COLORSCALE_FORMULA);
+else if (maModel.maColorScaleType == "num")
+pEntry->SetType(COLORSCALE_VALUE);
+
+if (!maModel.msScaleTypeValue.isEmpty())
+{
+sal_Int32 nSize = 0;
+rtl_math_ConversionStatus eStatus = 
rtl_math_ConversionStatus_Ok;
+double fValue = 
rtl::math::stringToDouble(maModel.msScaleTypeValue, '.', '\0', , 
);
+if (eStatus == rtl_math_ConversionStatus_Ok && nSize == 
maModel.msScaleTypeValue.getLength())
+{
+pEntry->SetValue(fValue);
+}
+}
 break;
 }
 case UNKNOWN: // nothing to do
diff --git a/sc/source/filter/oox/extlstcontext.cxx 
b/sc/source/filter/oox/extlstcontext.cxx
index 760ba26c1727..2646f0969958 100644
--- a/sc/source/filter/oox/extlstcontext.cxx
+++ b/sc/source/filter/oox/extlstcontext.cxx
@@ -80,6 +80,7 @@ void ExtCfRuleContext::onStartElement( const AttributeList& 
rAttribs )
 xRule->importCfvo( rAttribs );
 xRule->getModel().mbIsLower = mbFirstEntry;
 mbFirstEntry = false;
+mpRule = xRule;
 break;
 }
 default:
@@ -87,6 +88,33 @@ void ExtCfRuleContext::onStartElement( const AttributeList& 
rAttribs )
 }
 }
 
+void ExtCfRuleContext::onCharacters( const OUString& rChars )
+{
+switch( getCurrentElement() )
+{
+case XM_TOKEN( f ):
+{
+if (mpRule)
+{
+mpRule->getModel().msScaleTypeValue = rChars;
+}
+}
+break;
+}
+}
+
+void ExtCfRuleContext::onEndElement()
+{
+switch( getCurrentElement() )
+{
+case XLS14_TOKEN( cfvo ):
+{
+mpRule.reset();
+break;
+}
+}
+}
+
 namespace {
 bool IsSpecificTextCondMode(ScConditionMode eMode)
 {


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-05-15 Thread Henry Castro (via logerrit)
 sc/source/filter/oox/condformatbuffer.cxx |   76 ++
 1 file changed, 76 insertions(+)

New commits:
commit 4c04779cfdac58eebffb2fabc4a500e000bd437a
Author: Henry Castro 
AuthorDate: Fri Mar 17 10:40:23 2023 -0400
Commit: Henry Castro 
CommitDate: Mon May 15 15:13:43 2023 +0200

sc: filter: oox: add missing attribute "indexed"


 
 
 
 
 


Signed-off-by: Henry Castro 
Change-Id: If7f6c8c902e4cd0d775f1014acad3dcd19f13f28
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149065
Tested-by: Jenkins CollaboraOffice 

diff --git a/sc/source/filter/oox/condformatbuffer.cxx 
b/sc/source/filter/oox/condformatbuffer.cxx
index 63e75170a367..da99d8ab645e 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -170,6 +170,76 @@ void ColorScaleRule::importCfvo( const AttributeList& 
rAttribs )
 
 namespace {
 
+// 
https://learn.microsoft.com/en-us/dotnet/api/documentformat.openxml.spreadsheet.indexedcolors?view=openxml-2.8.1
+static ::Color IndexedColors[] = {
+0x,
+0x00FF,
+0x00FF,
+0xFF00,
+0x00FF,
+0x0000,
+0x00FF00FF,
+0x,
+0x,
+0x00FF,
+0x00FF,
+0xFF00,
+0x00FF,
+0x0000,
+0x00FF00FF,
+0x,
+0x0080,
+0x8000,
+0x0080,
+0x00808000,
+0x00800080,
+0x8080,
+0x00C0C0C0,
+0x00808080,
+0x00FF,
+0x00993366,
+0x00CC,
+0x00CC,
+0x00660066,
+0x00FF8080,
+0x66CC,
+0x00FF,
+0x0080,
+0x00FF00FF,
+0x0000,
+0x,
+0x00800080,
+0x0080,
+0x8080,
+0x00FF,
+0xCCFF,
+0x00CC,
+0x00CCFFCC,
+0x0099,
+0x0099CCFF,
+0x00FF99CC,
+0x00CC99FF,
+0x00FFCC99,
+0x003366FF,
+0x0033,
+0x0099CC00,
+0x00FFCC00,
+0x00FF9900,
+0x00FF6600,
+0x0099,
+0x00969696,
+0x3366,
+0x00339966,
+0x3300,
+0x0000,
+0x00993300,
+0x00993366,
+0x0099,
+0x0033,
+0x, // System Foreground ?
+0x, // System Background ?
+};
+
 ::Color importOOXColor(const AttributeList& rAttribs, const ThemeBuffer& 
rThemeBuffer, const GraphicHelper& rGraphicHelper)
 {
 ::Color nColor;
@@ -191,6 +261,12 @@ namespace {
 
 nColor = rThemeBuffer.getColorByIndex( nThemeIndex );
 }
+else if (rAttribs.hasAttribute(XML_indexed))
+{
+sal_uInt32 nIndexed = rAttribs.getUnsigned(XML_indexed, 0);
+if (nIndexed < sizeof(IndexedColors))
+nColor = IndexedColors[nIndexed];
+}
 
 ::Color aColor;
 double nTint = rAttribs.getDouble(XML_tint, 0.0);


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-05-12 Thread Henry Castro (via logerrit)
 sc/source/filter/excel/xihelper.cxx  |6 ++
 sc/source/filter/inc/worksheethelper.hxx |4 +++-
 sc/source/filter/oox/sheetdatabuffer.cxx |4 +++-
 sc/source/filter/oox/worksheethelper.cxx |6 +-
 4 files changed, 17 insertions(+), 3 deletions(-)

New commits:
commit 6dc5ff3f455703b43c8748c709ca94248b38a2f1
Author: Henry Castro 
AuthorDate: Tue Feb 28 09:50:28 2023 -0400
Commit: Henry Castro 
CommitDate: Fri May 12 19:14:45 2023 +0200

sc: filter: excel: import cell multi-line text

The excel document, if the cell has multi-line text and
the property wrap text is off, the paragraphs are rendered
all in a single line.

Signed-off-by: Henry Castro 
Change-Id: I3b5c82dde2616887e51ad6e3dfe91d100482f747
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148004
Tested-by: Jenkins CollaboraOffice 

diff --git a/sc/source/filter/excel/xihelper.cxx 
b/sc/source/filter/excel/xihelper.cxx
index 3552e8d65f1b..e095d22018ac 100644
--- a/sc/source/filter/excel/xihelper.cxx
+++ b/sc/source/filter/excel/xihelper.cxx
@@ -238,10 +238,16 @@ void XclImpStringHelper::SetToDocument(
 const OUString& aStr = rString.GetText();
 if (aStr.indexOf('\n') != -1 || aStr.indexOf('\r') != -1)
 {
+const XclImpXFBuffer& rXFBuffer = rRoot.GetXFBuffer();
+const XclImpXF* pXF = rXFBuffer.GetXF( nXFIndex );
+bool bSingleLine = pXF ? !pXF->GetLineBreak() : false;
+
 // Multiline content.
 ScFieldEditEngine& rEngine = rDoc.getDoc().GetEditEngine();
+rEngine.SetSingleLine(bSingleLine);
 rEngine.SetTextCurrentDefaults(aStr);
 rDoc.setEditCell(rPos, rEngine.CreateTextObject());
+rEngine.SetSingleLine(false);
 }
 else
 {
diff --git a/sc/source/filter/inc/worksheethelper.hxx 
b/sc/source/filter/inc/worksheethelper.hxx
index 3a44dc2e105e..4081d248e32b 100644
--- a/sc/source/filter/inc/worksheethelper.hxx
+++ b/sc/source/filter/inc/worksheethelper.hxx
@@ -262,7 +262,9 @@ public:
 /** Inserts a rich-string cell directly into the Calc sheet. */
 void putRichString(
 const ScAddress& rAddress,
-RichString& rString, const oox::xls::Font* pFirstPortionFont );
+RichString& rString,
+const oox::xls::Font* pFirstPortionFont,
+bool bSingleLine = false);
 
 /** Inserts a formula cell directly into the Calc sheet. */
 void putFormulaTokens(
diff --git a/sc/source/filter/oox/sheetdatabuffer.cxx 
b/sc/source/filter/oox/sheetdatabuffer.cxx
index 280c39f70c10..133da920832e 100644
--- a/sc/source/filter/oox/sheetdatabuffer.cxx
+++ b/sc/source/filter/oox/sheetdatabuffer.cxx
@@ -120,6 +120,8 @@ void SheetDataBuffer::setStringCell( const CellModel& 
rModel, const RichStringRe
 {
 OSL_ENSURE( rxString, "SheetDataBuffer::setStringCell - missing rich 
string object" );
 const oox::xls::Font* pFirstPortionFont = getStyles().getFontFromCellXf( 
rModel.mnXfId ).get();
+const Xf* pXf = getStyles().getCellXf( rModel.mnXfId ).get();
+bool bSingleLine = pXf ? !rxString->isPreserveSpace() && 
!pXf->getAlignment().getModel().mbWrapText : false;
 OUString aText;
 if( rxString->extractPlainString( aText, pFirstPortionFont ) )
 {
@@ -127,7 +129,7 @@ void SheetDataBuffer::setStringCell( const CellModel& 
rModel, const RichStringRe
 }
 else
 {
-putRichString( rModel.maCellAddr, *rxString, pFirstPortionFont );
+putRichString( rModel.maCellAddr, *rxString, pFirstPortionFont, 
bSingleLine );
 setCellFormat( rModel );
 }
 }
diff --git a/sc/source/filter/oox/worksheethelper.cxx 
b/sc/source/filter/oox/worksheethelper.cxx
index 7bf652107475..5d7fd342e334 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -1596,12 +1596,16 @@ void WorksheetHelper::setCellFormulaValue(
 getFormulaBuffer().setCellFormulaValue(rAddress, rValueStr, nCellType);
 }
 
-void WorksheetHelper::putRichString( const ScAddress& rAddress, RichString& 
rString, const oox::xls::Font* pFirstPortionFont )
+void WorksheetHelper::putRichString( const ScAddress& rAddress, RichString& 
rString, const oox::xls::Font* pFirstPortionFont, bool bSingleLine )
 {
 ScEditEngineDefaulter& rEE = getEditEngine();
 
+rEE.SetSingleLine(bSingleLine);
+
 // The cell will own the text object instance returned from convert().
 getDocImport().setEditCell(rAddress, rString.convert(rEE, 
pFirstPortionFont));
+
+rEE.SetSingleLine(false);
 }
 
 void WorksheetHelper::putFormulaTokens( const ScAddress& rAddress, const 
ApiTokenSequence& rTokens )


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-05-12 Thread Henry Castro (via logerrit)
 sc/source/filter/inc/xistyle.hxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 5acb082c884bdc407784477ae08b4a4d080db88e
Author: Henry Castro 
AuthorDate: Tue Feb 28 09:44:27 2023 -0400
Commit: Henry Castro 
CommitDate: Fri May 12 17:46:28 2023 +0200

sc: filter: excel: add getter function LineBreak

Signed-off-by: Henry Castro 
Change-Id: I17646ed53f663fd72a10437d7a3a4407df0c176e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148003
Tested-by: Jenkins CollaboraOffice 

diff --git a/sc/source/filter/inc/xistyle.hxx b/sc/source/filter/inc/xistyle.hxx
index 1d0f0e04c5b1..b4e5250dc37f 100644
--- a/sc/source/filter/inc/xistyle.hxx
+++ b/sc/source/filter/inc/xistyle.hxx
@@ -387,6 +387,7 @@ public:
 /** Reads an XF record. */
 voidReadXF( XclImpStream& rStrm );
 
+bool GetLineBreak() const { return maAlignment.mbLineBreak; }
 sal_uInt8GetHorAlign() const { return maAlignment.mnHorAlign; }
 sal_uInt16   GetFontIndex() const { return mnXclFont; }
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-05-12 Thread Henry Castro (via logerrit)
 sc/source/filter/inc/richstring.hxx|7 ++-
 sc/source/filter/oox/richstring.cxx|   12 +++-
 sc/source/filter/oox/richstringcontext.cxx |4 +++-
 3 files changed, 20 insertions(+), 3 deletions(-)

New commits:
commit f3ea85cc9cd25ad58068fc6922137132bd978a81
Author: Henry Castro 
AuthorDate: Tue May 9 17:43:48 2023 -0400
Commit: Henry Castro 
CommitDate: Fri May 12 13:22:26 2023 +0200

sc: filter: oox: fix preserve space, single line case

The unit test testPreserveTextWhitespace2XLSX fails
when a single line is enabled

Test name: ScExportTest::testPreserveTextWhitespace2XLSX
equality assertion failed
- Expected: 1
- Actual  : 0
- In <>, XPath '/x:sst/x:si[2]/x:r[1]/x:t' number of nodes is incorrect

In order to fix, the single line cell should not be enabled and
import the attribute:

abc

Signed-off-by: Henry Castro 
Change-Id: I380ba8726c03abc40bdc745ea74eceb80fec6e54
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151599
Tested-by: Jenkins CollaboraOffice 
(cherry picked from commit 2dd86aa3f365057494bf41f4da7f2f410ea3bf2e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151615

diff --git a/sc/source/filter/inc/richstring.hxx 
b/sc/source/filter/inc/richstring.hxx
index 7c233507b419..b74e3036f473 100644
--- a/sc/source/filter/inc/richstring.hxx
+++ b/sc/source/filter/inc/richstring.hxx
@@ -208,7 +208,7 @@ class RichString
 public:
 
 /** Appends and returns an index of a portion object for a plain string (t 
element). */
-sal_Int32 importText();
+sal_Int32 importText(const AttributeList& rAttribs);
 /** Appends and returns an index of a portion object for a new formatting 
run (r element). */
 sal_Int32 importRun();
 /** Appends and returns a phonetic text object for a new phonetic run (rPh 
element). */
@@ -236,6 +236,10 @@ public:
 
 RichStringPortion& getPortion(sal_Int32 nPortionIdx) { return 
maTextPortions[nPortionIdx]; }
 
+voidsetAttributes(const AttributeList& rAttribs);
+
+boolisPreserveSpace() const { return mbPreserveSpace; }
+
 private:
 /** Creates, appends, and returns a new empty string portion. */
 sal_Int32 createPortion();
@@ -253,6 +257,7 @@ private:
 std::vector  maTextPortions; /// String portions with 
font data.
 std::unique_ptr mxPhonSettings; /// Phonetic settings 
for this string.
 PhoneticVector  maPhonPortions; /// Phonetic text portions.
+bool mbPreserveSpace = false;
 };
 
 typedef std::shared_ptr< RichString > RichStringRef;
diff --git a/sc/source/filter/oox/richstring.cxx 
b/sc/source/filter/oox/richstring.cxx
index a9b272d62a9a..bda5960e42b1 100644
--- a/sc/source/filter/oox/richstring.cxx
+++ b/sc/source/filter/oox/richstring.cxx
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -403,8 +404,10 @@ void PhoneticPortionModelList::importPortions( 
SequenceInputStream& rStrm )
 }
 }
 
-sal_Int32 RichString::importText()
+sal_Int32 RichString::importText(const AttributeList& rAttribs)
 {
+setAttributes(rAttribs);
+
 return createPortion();
 }
 
@@ -413,6 +416,13 @@ sal_Int32 RichString::importRun()
 return createPortion();
 }
 
+void  RichString::setAttributes(const AttributeList& rAttribs)
+{
+auto aAttrSpace = rAttribs.getString(oox::NMSP_xml | oox::XML_space);
+if (aAttrSpace && *aAttrSpace == "preserve")
+mbPreserveSpace = true;
+}
+
 RichStringPhoneticRef RichString::importPhoneticRun( const AttributeList& 
rAttribs )
 {
 RichStringPhoneticRef xPhonetic = createPhonetic();
diff --git a/sc/source/filter/oox/richstringcontext.cxx 
b/sc/source/filter/oox/richstringcontext.cxx
index 280ac293a390..0c83fff2e9f3 100644
--- a/sc/source/filter/oox/richstringcontext.cxx
+++ b/sc/source/filter/oox/richstringcontext.cxx
@@ -33,7 +33,7 @@ ContextHandlerRef RichStringContext::onCreateContext( 
sal_Int32 nElement, const
 switch( nElement )
 {
 case XLS_TOKEN( t ):
-mnPortionIdx = mxString->importText();
+mnPortionIdx = mxString->importText(rAttribs);
 return this;// collect text in onCharacters()
 case XLS_TOKEN( r ):
 mnPortionIdx = mxString->importRun();
@@ -57,6 +57,7 @@ ContextHandlerRef RichStringContext::onCreateContext( 
sal_Int32 nElement, const
 break;
 
 case XLS_TOKEN( t ):
+mxString->setAttributes(rAttribs);
 return this;// collect portion text in onCharacters()
 }
 break;
@@ -65,6 +66,7 @@ ContextHandlerRef RichStringContext::onCreateContext( 
sal_Int32 nElement, const
 switch( nElement )
 {
 case XLS_TOKEN( t ):
+mxString->setAttributes(rAttribs);
 return this;// collect phonetic 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source sc/uiconfig sd/source sw/source sw/uiconfig

2023-05-05 Thread Attila Szűcs (via logerrit)
 sc/source/ui/navipi/navipi.cxx   |6 ++
 sc/uiconfig/scalc/ui/navigatorpanel.ui   |2 +-
 sd/source/ui/dlg/navigatr.cxx|6 ++
 sw/source/uibase/utlui/navipi.cxx|   29 -
 sw/uiconfig/swriter/ui/navigatorpanel.ui |2 +-
 5 files changed, 38 insertions(+), 7 deletions(-)

New commits:
commit fa93ddc87b86432ab68e43353cd872439895898f
Author: Attila Szűcs 
AuthorDate: Thu May 4 16:59:54 2023 +0200
Commit: Szymon Kłos 
CommitDate: Fri May 5 10:01:10 2023 +0200

LOK: Navi-10 hide not needed controls

Hide controls we dont need in navigator now.

Change-Id: Ibf6843be2976bcd4d90e67130dd0cc08d0988c0b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151397
Tested-by: Szymon Kłos 
Reviewed-by: Szymon Kłos 

diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index 6340c1a80f33..1934b14ca374 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -423,6 +423,12 @@ ScNavigatorDlg::ScNavigatorDlg(SfxBindings* pB, 
weld::Widget* pParent, SfxNaviga
 else
 eNavMode = NAV_LMODE_AREAS;
 SetListMode(eNavMode);
+
+if(comphelper::LibreOfficeKit::isActive())
+{
+m_xBuilder->weld_container("gridbuttons")->hide();
+m_xLbDocuments->hide();
+}
 }
 
 weld::Window* ScNavigatorDlg::GetFrameWeld() const
diff --git a/sc/uiconfig/scalc/ui/navigatorpanel.ui 
b/sc/uiconfig/scalc/ui/navigatorpanel.ui
index 9e02f0ba5588..a5b9b3038be6 100644
--- a/sc/uiconfig/scalc/ui/navigatorpanel.ui
+++ b/sc/uiconfig/scalc/ui/navigatorpanel.ui
@@ -101,7 +101,7 @@
 12
 
   
-  
+  
 True
 False
 True
diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx
index cdc2db1f5a81..459051b9aed4 100644
--- a/sd/source/ui/dlg/navigatr.cxx
+++ b/sd/source/ui/dlg/navigatr.cxx
@@ -48,6 +48,7 @@
 #include 
 
 #include 
+#include 
 
 /**
  * SdNavigatorWin - FloatingWindow
@@ -93,6 +94,11 @@ SdNavigatorWin::SdNavigatorWin(weld::Widget* pParent, 
SfxBindings* pInBindings,
 mxToolbox->connect_key_press(LINK(this, SdNavigatorWin, KeyInputHdl));
 mxTlbObjects->connect_key_press(LINK(this, SdNavigatorWin, KeyInputHdl));
 mxLbDocs->connect_key_press(LINK(this, SdNavigatorWin, KeyInputHdl));
+if(comphelper::LibreOfficeKit::isActive())
+{
+mxToolbox->hide();
+mxLbDocs->hide();
+}
 }
 
 void SdNavigatorWin::FirstFocus()
diff --git a/sw/source/uibase/utlui/navipi.cxx 
b/sw/source/uibase/utlui/navipi.cxx
index fc92d2d6edda..4f60ba96e874 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -49,6 +49,8 @@
 
 #include 
 
+#include 
+
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::frame;
 
@@ -682,6 +684,14 @@ SwNavigationPI::SwNavigationPI(weld::Widget* pParent,
 m_xDocListBox->set_accessible_name(m_aStatusArr[3]);
 
 m_aExpandedSize = m_xContainer->get_preferred_size();
+
+if(comphelper::LibreOfficeKit::isActive())
+{
+m_xBuilder->weld_container("gridcontent16")->hide();
+m_xDocListBox->hide();
+m_xGlobalBox->hide();
+m_xGlobalToolBox->hide();
+}
 }
 
 weld::Window* SwNavigationPI::GetFrameWeld() const
@@ -765,12 +775,15 @@ void SwNavigationPI::NotifyItemUpdate(sal_uInt16 nSID, 
SfxItemState /*eState*/,
 }
 else if (nSID == FN_STAT_PAGE)
 {
-SwView *pActView = GetCreateView();
-if(pActView)
+if(!comphelper::LibreOfficeKit::isActive())
 {
-SwWrtShell  = pActView->GetWrtShell();
-m_xEdit->set_max(rSh.GetPageCnt());
-m_xEdit->set_width_chars(3);
+SwView *pActView = GetCreateView();
+if(pActView)
+{
+SwWrtShell  = pActView->GetWrtShell();
+m_xEdit->set_max(rSh.GetPageCnt());
+m_xEdit->set_width_chars(3);
+}
 }
 }
 }
@@ -1045,6 +1058,12 @@ void SwNavigationPI::SetRegionDropMode(RegionMode 
nNewMode)
 
 void SwNavigationPI::ToggleTree()
 {
+if (comphelper::LibreOfficeKit::isActive())
+{
+m_xGlobalTree->HideTree();
+return;
+}
+
 bool bGlobalDoc = IsGlobalDoc();
 if (!IsGlobalMode() && bGlobalDoc)
 {
diff --git a/sw/uiconfig/swriter/ui/navigatorpanel.ui 
b/sw/uiconfig/swriter/ui/navigatorpanel.ui
index f38518649c9a..71718d71d572 100644
--- a/sw/uiconfig/swriter/ui/navigatorpanel.ui
+++ b/sw/uiconfig/swriter/ui/navigatorpanel.ui
@@ -244,7 +244,7 @@
 6
 12
 
-  
+  
 True
 False
 True


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-05-03 Thread Dennis Francis (via logerrit)
 sc/source/core/data/validat.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 2f6d1cefc184fda3ba292f1718b034202989d7b3
Author: Dennis Francis 
AuthorDate: Wed May 3 13:00:09 2023 +0530
Commit: Henry Castro 
CommitDate: Wed May 3 15:10:40 2023 +0200

sc: use the current cell's numfmt to format...

to format the values in the validation list when the items are numbers.
This is better than applying no formatting since we lost track of the
source formatting when values are passed through a matrix.

Change-Id: I06432bd93ef8d01181dd16d2f5ee99eb0477c094
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151313
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Henry Castro 

diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx
index 8fb0f9f7924a..009bc0eaebe7 100644
--- a/sc/source/core/data/validat.cxx
+++ b/sc/source/core/data/validat.cxx
@@ -856,6 +856,7 @@ bool ScValidationData::GetSelectionFromFormula(
 rMatch = -1;
 
 SvNumberFormatter* pFormatter = GetDocument()->GetFormatTable();
+sal_uInt32 nDestFormat = pDocument->GetNumberFormat(rPos.Col(), 
rPos.Row(), rPos.Tab());
 
 SCSIZE  nCol, nRow, nCols, nRows, n = 0;
 pValues->GetDimensions( nCols, nRows );
@@ -957,7 +958,7 @@ bool ScValidationData::GetSelectionFromFormula(
 }
 else
 {
-pFormatter->GetInputLineString( nMatVal.fVal, 0, 
aValStr );
+pFormatter->GetInputLineString( nMatVal.fVal, 
nDestFormat, aValStr );
 }
 }
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-05-02 Thread Henry Castro (via logerrit)
 sc/source/ui/view/gridwin.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b9fe22a7be3c3e9bb9ae4adea812c0ea9f78d5bc
Author: Henry Castro 
AuthorDate: Tue Apr 4 16:18:24 2023 -0400
Commit: Aron Budea 
CommitDate: Tue May 2 22:51:54 2023 +0200

lok: sc: fix RTL auto fill rectangle

In the RTL case, the positive X axis is changed from
right to left, otherwise the auto fill rectangle overlay
will get negative coordinates.

Signed-off-by: Henry Castro 
Change-Id: If4918f02d185fc19e5ab4e8a273c443c69dc7206
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150034
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 
(cherry picked from commit 27dc2814941423d202053cf65bbf755e403c6044)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150172
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Aron Budea 

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 7dcd718fd1b6..9c63aafe70e0 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -6555,7 +6555,7 @@ void ScGridWindow::UpdateAutoFillOverlay()
 tools::Long nSizeYPix;
 mrViewData.GetMergeSizePixel( nX, nY, nSizeXPix, nSizeYPix );
 
-if (bLayoutRTL)
+if (bLayoutRTL && !comphelper::LibreOfficeKit::isActive())
 aFillPos.AdjustX( -(nSizeXPix - 2 + (aFillHandleSize.Width() / 2)) );
 else
 aFillPos.AdjustX(nSizeXPix - (aFillHandleSize.Width() / 2) );


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-04-06 Thread Szymon Kłos (via logerrit)
 sc/source/ui/inc/tabview.hxx   |2 ++
 sc/source/ui/view/tabview2.cxx |9 +
 2 files changed, 11 insertions(+)

New commits:
commit 780e46839357c1940ac93edb3c3e1a417bd1dd44
Author: Szymon Kłos 
AuthorDate: Fri Feb 17 10:47:53 2023 +0100
Commit: Szymon Kłos 
CommitDate: Thu Apr 6 10:58:14 2023 +0200

lok: setup LOK notifier for invalid range error

Change-Id: I63fc6fcdec873a9d0c8d54dd6a6f3783f2c15251
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147200
Reviewed-by: Henry Castro 
Tested-by: Jenkins CollaboraOffice 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150043
Tested-by: Szymon Kłos 
Reviewed-by: Szymon Kłos 

diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index ca3918aae325..3f270770ec89 100644
--- a/sc/source/ui/inc/tabview.hxx
+++ b/sc/source/ui/inc/tabview.hxx
@@ -260,6 +260,8 @@ private:
 
 voidSetZoomPercentFromCommand(sal_uInt16 nZoomPercent);
 
+DECL_STATIC_LINK(ScTabView, InstallLOKNotifierHdl, void*, 
vcl::ILibreOfficeKitNotifier*);
+
 protected:
 voidUpdateHeaderWidth( const ScVSplitPos* pWhich = nullptr,
 const SCROW* pPosY = nullptr );
diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index 400ea89b6106..6b1cfef156f7 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -1443,6 +1443,11 @@ void ScTabView::MakeDrawLayer()
 }
 }
 
+IMPL_STATIC_LINK_NOARG(ScTabView, InstallLOKNotifierHdl, void*, 
vcl::ILibreOfficeKitNotifier*)
+{
+return GetpApp();
+}
+
 void ScTabView::ErrorMessage(TranslateId pGlobStrId)
 {
 if ( SC_MOD()->IsInExecuteDrop() )
@@ -1468,6 +1473,10 @@ void ScTabView::ErrorMessage(TranslateId pGlobStrId)
 m_xMessageBox.reset(Application::CreateMessageDialog(pParent,
  VclMessageType::Info, 
VclButtonsType::Ok,
  ScResId(pGlobStrId)));
+
+if (comphelper::LibreOfficeKit::isActive())
+m_xMessageBox->SetInstallLOKNotifierHdl(LINK(this, ScTabView, 
InstallLOKNotifierHdl));
+
 weld::Window* pGrabOnClose = bFocus ? pParent : nullptr;
 m_xMessageBox->runAsync(m_xMessageBox, [this, pGrabOnClose](sal_Int32 
/*nResult*/) {
 m_xMessageBox.reset();


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source vcl/jsdialog

2023-03-16 Thread Szymon Kłos (via logerrit)
 sc/source/ui/pagedlg/tphfedit.cxx |2 +-
 vcl/jsdialog/enabled.cxx  |2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 719c5931a12714e67e90c0bcfd055b12c0075323
Author: Szymon Kłos 
AuthorDate: Tue Mar 14 15:53:52 2023 +0100
Commit: Szymon Kłos 
CommitDate: Thu Mar 16 08:25:54 2023 +

jsdialog: enable Insert header footer

Change-Id: Ib6f1cd1ffac5479ae9cdf1e47fe0cb69abfc8c91
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148889
Tested-by: Szymon Kłos 
Reviewed-by: Szymon Kłos 

diff --git a/sc/source/ui/pagedlg/tphfedit.cxx 
b/sc/source/ui/pagedlg/tphfedit.cxx
index db08e91050a8..8206ffef7f65 100644
--- a/sc/source/ui/pagedlg/tphfedit.cxx
+++ b/sc/source/ui/pagedlg/tphfedit.cxx
@@ -243,7 +243,7 @@ bool ScEditWindow::MouseButtonDown(const MouseEvent& rMEvt)
 bool bRet = WeldEditView::MouseButtonDown(rMEvt);
 if (!bHadFocus)
 {
-assert(HasFocus());
+assert(comphelper::LibreOfficeKit::isActive() || HasFocus());
 GetFocus();
 }
 return bRet;
diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx
index 231d33f36059..a7e750eb56f2 100644
--- a/vcl/jsdialog/enabled.cxx
+++ b/vcl/jsdialog/enabled.cxx
@@ -81,6 +81,8 @@ bool isBuilderEnabled(std::u16string_view rUIFile, bool 
bMobile)
 || rUIFile == u"modules/scalc/ui/fourieranalysisdialog.ui"
 || rUIFile == u"modules/scalc/ui/goalseekdlg.ui"
 || rUIFile == u"modules/scalc/ui/groupdialog.ui"
+|| rUIFile == u"modules/scalc/ui/headerfootercontent.ui"
+|| rUIFile == u"modules/scalc/ui/headerfooterdialog.ui"
 || rUIFile == u"modules/scalc/ui/insertcells.ui"
 || rUIFile == u"modules/scalc/ui/managenamesdialog.ui"
 || rUIFile == u"modules/scalc/ui/movingaveragedialog.ui"


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source sc/uiconfig sc/UIConfig_scalc.mk static/CustomTarget_emscripten_fs_image.mk vcl/jsdialog

2023-03-13 Thread Szymon Kłos (via logerrit)
 sc/UIConfig_scalc.mk |2 
 sc/source/ui/dbgui/validate.cxx  |8 -
 sc/uiconfig/scalc/ui/erroralerttabpage-mobile.ui |  152 ---
 sc/uiconfig/scalc/ui/validationhelptabpage-mobile.ui |  110 -
 sc/uiconfig/scalc/ui/validationhelptabpage.ui|6 
 static/CustomTarget_emscripten_fs_image.mk   |2 
 vcl/jsdialog/enabled.cxx |   13 -
 7 files changed, 12 insertions(+), 281 deletions(-)

New commits:
commit 48059620d89aa234a6529e8d555fa24c315dd98c
Author: Szymon Kłos 
AuthorDate: Mon Mar 13 10:38:10 2023 +0100
Commit: Szymon Kłos 
CommitDate: Mon Mar 13 11:30:11 2023 +

jsdialog: enable data validation dialog

Change-Id: Ide679ada03dff5e62432d77b8c804d667bf2435b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148781
Tested-by: Szymon Kłos 
Reviewed-by: Szymon Kłos 

diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index 13a4b98a6c7c..0696cf11acda 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -124,7 +124,6 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
sc/uiconfig/scalc/ui/dropmenu \
sc/uiconfig/scalc/ui/doubledialog \
sc/uiconfig/scalc/ui/erroralerttabpage \
-   sc/uiconfig/scalc/ui/erroralerttabpage-mobile \
sc/uiconfig/scalc/ui/externaldata \
sc/uiconfig/scalc/ui/exponentialsmoothingdialog \
sc/uiconfig/scalc/ui/filldlg \
@@ -262,7 +261,6 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
sc/uiconfig/scalc/ui/validationdialog \
sc/uiconfig/scalc/ui/validationcriteriapage \
sc/uiconfig/scalc/ui/validationhelptabpage \
-   sc/uiconfig/scalc/ui/validationhelptabpage-mobile \
sc/uiconfig/scalc/ui/warnautocorrect \
sc/uiconfig/scalc/ui/xmlsourcedialog \
sc/uiconfig/scalc/ui/zoombox \
diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx
index d194fdc1070e..a7b02c6a2086 100644
--- a/sc/source/ui/dbgui/validate.cxx
+++ b/sc/source/ui/dbgui/validate.cxx
@@ -691,11 +691,10 @@ IMPL_LINK_NOARG(ScTPValidationValue, CheckHdl, 
weld::Toggleable&, void)
 // Input Help Page
 
 ScTPValidationHelp::ScTPValidationHelp(weld::Container* pPage, 
weld::DialogController* pController, const SfxItemSet& rArgSet)
-: SfxTabPage(pPage, pController, IS_MOBILE ? 
OUString("modules/scalc/ui/validationhelptabpage-mobile.ui")
-: OUString("modules/scalc/ui/validationhelptabpage.ui"), 
"ValidationHelpTabPage", )
+: SfxTabPage(pPage, pController, 
"modules/scalc/ui/validationhelptabpage.ui", "ValidationHelpTabPage", )
 , m_xTsbHelp(m_xBuilder->weld_check_button("tsbhelp"))
 , m_xEdtTitle(m_xBuilder->weld_entry("title"))
-, m_xEdInputHelp(m_xBuilder->weld_text_view("inputhelp"))
+, m_xEdInputHelp(m_xBuilder->weld_text_view("inputhelp_text"))
 {
 
m_xEdInputHelp->set_size_request(m_xEdInputHelp->get_approximate_digit_width() 
* 40, m_xEdInputHelp->get_height_rows(13));
 }
@@ -743,8 +742,7 @@ ScTPValidationError::ScTPValidationError(weld::Container* 
pPage, weld::DialogCon
  const SfxItemSet& rArgSet)
 
 :   SfxTabPage  ( pPage, pController,
-  IS_MOBILE ? 
OUString("modules/scalc/ui/erroralerttabpage-mobile.ui")
-: 
OUString("modules/scalc/ui/erroralerttabpage.ui"), "ErrorAlertTabPage",
+  "modules/scalc/ui/erroralerttabpage.ui", 
"ErrorAlertTabPage",
)
 , m_xTsbShow(m_xBuilder->weld_check_button("tsbshow"))
 , m_xLbAction(m_xBuilder->weld_combo_box("actionCB"))
diff --git a/sc/uiconfig/scalc/ui/erroralerttabpage-mobile.ui 
b/sc/uiconfig/scalc/ui/erroralerttabpage-mobile.ui
deleted file mode 100644
index 74846ac19a62..
--- a/sc/uiconfig/scalc/ui/erroralerttabpage-mobile.ui
+++ /dev/null
@@ -1,152 +0,0 @@
-
-
-
-  
-  
-True
-False
-True
-True
-6
-vertical
-12
-
-  
-Show error _message when invalid 
values are entered
-True
-True
-False
-True
-True
-True
-True
-  
-  
-False
-True
-0
-  
-
-
-  
-  
-True
-False
-True
-True
-6
-12
-
-  
-True
-False
-_Action:
-True
-actionCB
-0
-  
-  
-0
-0
-  
-
-
-  
-True
-False
-_Title:
-True
-erroralert_title
-0
-0
-  
-  
-0
-1
-  
-
-
-  
-True
-True
-True
-in
-
-  
- 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-02-27 Thread Pranam Lashkari (via logerrit)
 sc/source/ui/attrdlg/attrdlg.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit b6fcab0c2e43a726df92b8eaaf13f73a7cf611b4
Author: Pranam Lashkari 
AuthorDate: Fri Feb 24 22:20:11 2023 +0530
Commit: Andras Timar 
CommitDate: Mon Feb 27 16:45:24 2023 +

sc: remove protect cell tab from cell format dialog

Change-Id: I33a32ca756263426abb4dcb733139baf58221554
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147896
Tested-by: Andras Timar 
Reviewed-by: Andras Timar 

diff --git a/sc/source/ui/attrdlg/attrdlg.cxx b/sc/source/ui/attrdlg/attrdlg.cxx
index 734ae94d606f..4e13eae6dea4 100644
--- a/sc/source/ui/attrdlg/attrdlg.cxx
+++ b/sc/source/ui/attrdlg/attrdlg.cxx
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 
 ScAttrDlg::ScAttrDlg(weld::Window* pParent, const SfxItemSet* pCellAttrs)
 : SfxTabDialogController(pParent, "modules/scalc/ui/formatcellsdialog.ui",
@@ -57,7 +58,11 @@ ScAttrDlg::ScAttrDlg(weld::Window* pParent, const 
SfxItemSet* pCellAttrs)
 AddTabPage( "borders",  pFact->GetTabPageCreatorFunc( 
RID_SVXPAGE_BORDER ), nullptr );
 OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BKG ), 
"GetTabPageCreatorFunc fail!");
 AddTabPage( "background",  pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BKG 
), nullptr );
-AddTabPage( "cellprotection" ,  ScTabPageProtection::Create,nullptr );
+
+if (!comphelper::LibreOfficeKit::isActive())
+AddTabPage( "cellprotection" ,  ScTabPageProtection::Create,
nullptr );
+else
+RemoveTabPage( "cellprotection" );
 }
 
 ScAttrDlg::~ScAttrDlg()


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-02-12 Thread Mike Kaganski (via logerrit)
 sc/source/core/tool/interpr2.cxx |   64 ++-
 1 file changed, 31 insertions(+), 33 deletions(-)

New commits:
commit 5b26c90f4e8a2f2b4649e062c40f4c31f6b27eec
Author: Mike Kaganski 
AuthorDate: Fri Feb 10 16:44:37 2023 +0300
Commit: Mike Kaganski 
CommitDate: Mon Feb 13 06:56:41 2023 +

Flatten ScInterpreter::ScStyle

Change-Id: I64c622d2c2ca7eda02e8739657fe345f9be8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146777
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 2844670d2a47c606cbebb99f73389f30154a3c5e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146759
Tested-by: Mike Kaganski 

diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index 707d9c66cb3d..c8015598891f 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -2592,48 +2592,46 @@ void ScInterpreter::ScCurrent()
 void ScInterpreter::ScStyle()
 {
 sal_uInt8 nParamCount = GetByte();
-if (nParamCount >= 1 && nParamCount <= 3)
-{
-OUString aStyle2;   // Template after timer
-if (nParamCount >= 3)
-aStyle2 = GetString().getString();
-tools::Long nTimeOut = 0;  // timeout
-if (nParamCount >= 2)
-nTimeOut = static_cast(GetDouble()*1000.0);
-OUString aStyle1 = GetString().getString(); // Template for immediate
+if (!MustHaveParamCount(nParamCount, 1, 3))
+return;
 
-if (nTimeOut < 0)
-nTimeOut = 0;
+OUString aStyle2;   // Template after timer
+if (nParamCount >= 3)
+aStyle2 = GetString().getString();
+tools::Long nTimeOut = 0;  // timeout
+if (nParamCount >= 2)
+nTimeOut = static_cast(GetDouble()*1000.0);
+OUString aStyle1 = GetString().getString(); // Template for immediate
 
-// Execute request to apply template
-if ( !mrDoc.IsClipOrUndo() )
+if (nTimeOut < 0)
+nTimeOut = 0;
+
+// Execute request to apply template
+if ( !mrDoc.IsClipOrUndo() )
+{
+SfxObjectShell* pShell = mrDoc.GetDocumentShell();
+if (pShell)
 {
-SfxObjectShell* pShell = mrDoc.GetDocumentShell();
-if (pShell)
+// notify object shell directly!
+bool bNotify = true;
+if (aStyle2.isEmpty())
 {
-// notify object shell directly!
-bool bNotify = true;
-if (aStyle2.isEmpty())
-{
-const ScStyleSheet* pStyle = mrDoc.GetStyle(aPos.Col(), 
aPos.Row(), aPos.Tab());
+const ScStyleSheet* pStyle = mrDoc.GetStyle(aPos.Col(), 
aPos.Row(), aPos.Tab());
 
-if (pStyle && pStyle->GetName() == aStyle1)
-bNotify = false;
-}
+if (pStyle && pStyle->GetName() == aStyle1)
+bNotify = false;
+}
 
-if (bNotify)
-{
-ScRange aRange(aPos);
-ScAutoStyleHint aHint( aRange, aStyle1, nTimeOut, aStyle2 
);
-pShell->Broadcast( aHint );
-}
+if (bNotify)
+{
+ScRange aRange(aPos);
+ScAutoStyleHint aHint( aRange, aStyle1, nTimeOut, aStyle2 );
+pShell->Broadcast( aHint );
 }
 }
-
-PushDouble(0.0);
 }
-else
-PushIllegalParameter();
+
+PushDouble(0.0);
 }
 
 static ScDdeLink* lcl_GetDdeLink( const sfx2::LinkManager* pLinkMgr,


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-02-12 Thread Mike Kaganski (via logerrit)
 sc/source/core/data/stlpool.cxx |   10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 5e44a7f22de9f690e5289b3edd926d0b48db5277
Author: Mike Kaganski 
AuthorDate: Fri Feb 10 13:25:53 2023 +0300
Commit: Mike Kaganski 
CommitDate: Mon Feb 13 06:56:12 2023 +

tdf#153514: try to find exact match, even when searching case-insensitively

Change-Id: Ib3bec382ef80a9078ffde8612c395cb0154fd476
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146747
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 2a984c77ccb1aa77d9bbd02218d4dc76aaff4a9e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146758
Tested-by: Mike Kaganski 

diff --git a/sc/source/core/data/stlpool.cxx b/sc/source/core/data/stlpool.cxx
index 5ca89c37a510..b08b6c2203c9 100644
--- a/sc/source/core/data/stlpool.cxx
+++ b/sc/source/core/data/stlpool.cxx
@@ -408,14 +408,20 @@ ScStyleSheet* ScStyleSheetPool::FindCaseIns( const 
OUString& rName, SfxStyleFami
 CaseInsensitiveNamePredicate aPredicate(rName, eFam);
 std::vector aFoundPositions = 
GetIndexedStyleSheets().FindPositionsByPredicate(aPredicate);
 
+ScStyleSheet* first = nullptr; // first case insensitive match found
 for (const auto& rPos : aFoundPositions)
 {
 SfxStyleSheetBase *pFound = GetStyleSheetByPositionInIndex(rPos);
 // we do not know what kind of sheets we have.
 if (pFound->isScStyleSheet())
-return static_cast(pFound);
+{
+if (pFound->GetName() == rName) // exact case sensitive match
+return static_cast(pFound);
+if (!first)
+first = static_cast(pFound);
+}
 }
-return nullptr;
+return first;
 }
 
 void ScStyleSheetPool::setAllParaStandard()


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-02-10 Thread Mike Kaganski (via logerrit)
 sc/source/ui/docshell/autostyl.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit c8b72a80bc6cf392868fefd408884fcfa85bf886
Author: Mike Kaganski 
AuthorDate: Thu Feb 9 16:06:04 2023 +0300
Commit: Mike Kaganski 
CommitDate: Fri Feb 10 14:52:57 2023 +

Related: tdf#153510 Avoid modification of iterated container

A crash is seen when resizing a document locally; the problem is
range-based for loop, which indirectly modifies its range:

  sclo.dll!ScAutoStyleList::AddInitial(const ScRange & rRange, const 
rtl::OUString & rStyle1, unsigned __int64 nTimeout, const rtl::OUString & 
rStyle2) Line 81 C++
  sclo.dll!ScDocShell::Notify(SfxBroadcaster & __formal, const SfxHint & 
rHint) Line 685C++
  svllo.dll!SfxBroadcaster::Broadcast(const SfxHint & rHint) Line 41C++
  sclo.dll!ScInterpreter::ScStyle() Line 2628   C++
  sclo.dll!ScInterpreter::Interpret() Line 4441 C++
  sclo.dll!ScFormulaCell::InterpretTail(ScInterpreterContext & rContext, 
ScFormulaCell::ScInterpretTailParameter eTailParam) Line 1947  C++
  sclo.dll!ScFormulaCell::Interpret(long nStartOffset, long nEndOffset) 
Line 1619   C++
  sclo.dll!ScFormulaCell::MaybeInterpret() Line 470 C++
  sclo.dll!ScFormulaCell::IsValue() Line 2763   C++
  sclo.dll!ScConditionEntry::Interpret(const ScAddress & rPos) Line 670 C++
  sclo.dll!ScConditionEntry::IsCellValid(ScRefCellValue & rCell, const 
ScAddress & rPos) Line 1238  C++
  sclo.dll!ScConditionalFormat::GetData(ScRefCellValue & rCell, const 
ScAddress & rPos) Line 1836   C++
  sclo.dll!`anonymous 
namespace'::handleConditionalFormat(ScConditionalFormatList & rCondFormList, 
const o3tl::sorted_vector,o3tl::find_unique,1> & rCondFormats, ScCellInfo * pInfo, ScTableInfo * 
pTableInfo, ScStyleSheetPool * pStlPool, const ScAddress & rAddr, bool & 
bHidden, bool & bHideFormula, bool bTabProtect) Line 297C++
  sclo.dll!ScDocument::FillInfo(ScTableInfo & rTabInfo, short nCol1, long 
nRow1, short nCol2, long nRow2, short nTab, double fColScale, double fRowScale, 
bool bPageMode, bool bFormulaMode, const ScMarkData * pMarkData) Line 569 
C++
  sclo.dll!ScGridWindow::Draw(short nX1, long nY1, short nX2, long nY2, 
ScUpdateMode eMode) Line 556C++
  sclo.dll!ScGridWindow::Paint(OutputDevice & __formal, const 
tools::Rectangle & rRect) Line 458C++
  vcllo.dll!PaintHelper::DoPaint(const vcl::Region * pRegion) Line 313  C++
  vcllo.dll!vcl::Window::ImplCallPaint(const vcl::Region * pRegion, 
ImplPaintFlags nPaintFlags) Line 617C++
  vcllo.dll!PaintHelper::~PaintHelper() Line 553C++
  vcllo.dll!vcl::Window::ImplCallPaint(const vcl::Region * pRegion, 
ImplPaintFlags nPaintFlags) Line 623C++
  vcllo.dll!PaintHelper::~PaintHelper() Line 553C++
  vcllo.dll!vcl::Window::ImplCallPaint(const vcl::Region * pRegion, 
ImplPaintFlags nPaintFlags) Line 623C++
  vcllo.dll!PaintHelper::~PaintHelper() Line 553C++
  vcllo.dll!vcl::Window::ImplCallPaint(const vcl::Region * pRegion, 
ImplPaintFlags nPaintFlags) Line 623C++
  vcllo.dll!PaintHelper::~PaintHelper() Line 553C++
  vcllo.dll!vcl::Window::ImplCallPaint(const vcl::Region * pRegion, 
ImplPaintFlags nPaintFlags) Line 623C++
  vcllo.dll!PaintHelper::~PaintHelper() Line 553C++
  vcllo.dll!vcl::Window::ImplCallPaint(const vcl::Region * pRegion, 
ImplPaintFlags nPaintFlags) Line 623C++
  vcllo.dll!vcl::Window::ImplCallOverlapPaint() Line 646C++
  vcllo.dll!vcl::Window::ImplHandlePaintHdl(Timer * __formal) Line 668  C++
  vcllo.dll!vcl::Window::LinkStubImplHandlePaintHdl(void * instance, Timer 
* data) Line 648 C++
  vcllo.dll!Link::Call(Timer * data) Line 111 C++
  vcllo.dll!Timer::Invoke(Timer * arg) Line 81  C++
  vcllo.dll!vcl::Window::ImplHandleResizeTimerHdl(Timer * __formal) Line 
684C++
  vcllo.dll!vcl::Window::LinkStubImplHandleResizeTimerHdl(void * instance, 
Timer * data) Line 674   C++
  vcllo.dll!Link::Call(Timer * data) Line 111 C++
  vcllo.dll!Timer::Invoke(Timer * arg) Line 81  C++
  vcllo.dll!vcl::Window::GetSizePixel() Line 2420   C++
  sclo.dll!ScTabView::GetGridWidth(ScHSplitPos eWhich) Line 3032C++
  sclo.dll!ScViewData::CellsAtX(short nPosX, short nDir, ScHSplitPos 
eWhichX, unsigned short nScrSizeX) Line 2634   C++
  sclo.dll!ScViewData::VisibleCellsX(ScHSplitPos eWhichX) Line 2710 C++
  sclo.dll!ScTabView::PaintArea(short nStartCol, long nStartRow, short 
nEndCol, long nEndRow, ScUpdateMode eMode) Line 2386 C++
  sclo.dll!ScTabViewShell::Notify(SfxBroadcaster & rBC, const SfxHint & 
rHint) Line 63  C++
  svllo.dll!SfxBroadcaster::Broadcast(const SfxHint & rHint) Line 41C++
  sclo.dll!ScDocShell::PostPaint(const ScRangeList & rRanges, 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source

2023-01-28 Thread Henry Castro (via logerrit)
 sc/source/ui/view/gridwin.cxx |   13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

New commits:
commit 78568d4baac8b84b5d9cb50704b3e62b67ab1178
Author: Henry Castro 
AuthorDate: Wed Dec 14 11:40:16 2022 -0400
Commit: Andras Timar 
CommitDate: Sat Jan 28 09:24:18 2023 +

lok:sc: do not generate extra mouseup events

In tiled rendering case, the client side always will
send the pair mousedown/mouseup events to server side,
it is not necessary to generate extra mouseup events
when the mouse tracking has ended, otherwise the selection
engine will receive two mouseup events and wrong selection
states.

Signed-off-by: Henry Castro 
Change-Id: I99983de9591e26f6e5327fff63c45e682cbf1999
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144168
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145611
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 547338589298..ca863a848a38 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -2879,11 +2879,14 @@ void ScGridWindow::Tracking( const TrackingEvent& rTEvt 
)
 }
 else if ( rTEvt.IsTrackingEnded() )
 {
-// MouseButtonUp always with matching buttons (eg for test tool, # 
63148 #)
-// The tracking event will indicate if it was completed and not 
canceled.
-MouseEvent aUpEvt( rMEvt.GetPosPixel(), rMEvt.GetClicks(),
-rMEvt.GetMode(), nButtonDown, rMEvt.GetModifier() 
);
-MouseButtonUp( aUpEvt );
+if (!comphelper::LibreOfficeKit::isActive())
+{
+// MouseButtonUp always with matching buttons (eg for test tool, # 
63148 #)
+// The tracking event will indicate if it was completed and not 
canceled.
+MouseEvent aUpEvt( rMEvt.GetPosPixel(), rMEvt.GetClicks(),
+   rMEvt.GetMode(), nButtonDown, 
rMEvt.GetModifier() );
+MouseButtonUp( aUpEvt );
+}
 }
 else
 MouseMove( rMEvt );