[Libreoffice-commits] core.git: sc/source sc/uiconfig

2023-12-06 Thread Balazs Varga (via logerrit)
 sc/source/ui/inc/tpview.hxx   |   12 +
 sc/source/ui/optdlg/tpview.cxx|   91 ++
 sc/uiconfig/scalc/ui/scgeneralpage.ui |  283 +++---
 3 files changed, 325 insertions(+), 61 deletions(-)

New commits:
commit 4022666087f317f9c5f9c966307bcbe85ee5e1b6
Author: Balazs Varga 
AuthorDate: Wed Dec 6 23:29:47 2023 +0100
Commit: Balazs Varga 
CommitDate: Thu Dec 7 08:34:24 2023 +0100

tdf#158464 - UI: Part 47 - Unify lockdown behavior of Options dialog

for Calc - General Page.

Change-Id: I2ff8edd0fb10a3f388459d842c79b157bc3861f1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160407
Tested-by: Jenkins
Reviewed-by: Balazs Varga 

diff --git a/sc/source/ui/inc/tpview.hxx b/sc/source/ui/inc/tpview.hxx
index 72f3b7668732..6854f77c5eb0 100644
--- a/sc/source/ui/inc/tpview.hxx
+++ b/sc/source/ui/inc/tpview.hxx
@@ -81,22 +81,34 @@ class ScTpLayoutOptions : public SfxTabPage
 ScDocument *pDoc;
 
 std::unique_ptr m_xUnitLB;
+std::unique_ptr m_xUnitImg;
 std::unique_ptr m_xTabMF;
+std::unique_ptr m_xTabImg;
 
 std::unique_ptr m_xAlwaysRB;
 std::unique_ptr m_xRequestRB;
 std::unique_ptr m_xNeverRB;
+std::unique_ptr m_xUpdateLinksImg;
 
 std::unique_ptr m_xAlignCB;
+std::unique_ptr m_xAlignImg;
 std::unique_ptr m_xAlignLB;
 std::unique_ptr m_xEditModeCB;
+std::unique_ptr m_xEditModeImg;
 std::unique_ptr m_xFormatCB;
+std::unique_ptr m_xFormatImg;
 std::unique_ptr m_xExpRefCB;
+std::unique_ptr m_xExpRefImg;
 std::unique_ptr m_xSortRefUpdateCB;
+std::unique_ptr m_xSortRefUpdateImg;
 std::unique_ptr m_xMarkHdrCB;
+std::unique_ptr m_xMarkHdrImg;
 std::unique_ptr m_xReplWarnCB;
+std::unique_ptr m_xReplWarnImg;
 std::unique_ptr m_xLegacyCellSelectionCB;
+std::unique_ptr m_xLegacyCellSelectionImg;
 std::unique_ptr m_xEnterPasteModeCB;
+std::unique_ptr m_xEnterPasteModeImg;
 
 DECL_LINK(MetricHdl, weld::ComboBox&, void );
 DECL_LINK( AlignHdl, weld::Toggleable&, void );
diff --git a/sc/source/ui/optdlg/tpview.cxx b/sc/source/ui/optdlg/tpview.cxx
index 4b8595899f04..8640e187c5f7 100644
--- a/sc/source/ui/optdlg/tpview.cxx
+++ b/sc/source/ui/optdlg/tpview.cxx
@@ -32,6 +32,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 ScTpContentOptions::ScTpContentOptions(weld::Container* pPage, 
weld::DialogController* pController, const SfxItemSet&  rArgSet)
 : SfxTabPage(pPage, pController, "modules/scalc/ui/tpviewpage.ui", 
"TpViewPage", )
@@ -318,20 +321,32 @@ ScTpLayoutOptions::ScTpLayoutOptions(weld::Container* 
pPage, weld::DialogControl
 : SfxTabPage(pPage, pController, "modules/scalc/ui/scgeneralpage.ui", 
"ScGeneralPage", )
 , pDoc(nullptr)
 , m_xUnitLB(m_xBuilder->weld_combo_box("unitlb"))
+, m_xUnitImg(m_xBuilder->weld_widget("lockunitlb"))
 , m_xTabMF(m_xBuilder->weld_metric_spin_button("tabmf", FieldUnit::CM))
+, m_xTabImg(m_xBuilder->weld_widget("locktabmf"))
 , m_xAlwaysRB(m_xBuilder->weld_radio_button("alwaysrb"))
 , m_xRequestRB(m_xBuilder->weld_radio_button("requestrb"))
 , m_xNeverRB(m_xBuilder->weld_radio_button("neverrb"))
+, m_xUpdateLinksImg(m_xBuilder->weld_widget("lockupdatelinks"))
 , m_xAlignCB(m_xBuilder->weld_check_button("aligncb"))
+, m_xAlignImg(m_xBuilder->weld_widget("lockaligncb"))
 , m_xAlignLB(m_xBuilder->weld_combo_box("alignlb"))
 , m_xEditModeCB(m_xBuilder->weld_check_button("editmodecb"))
+, m_xEditModeImg(m_xBuilder->weld_widget("lockeditmodecb"))
 , m_xFormatCB(m_xBuilder->weld_check_button("formatcb"))
+, m_xFormatImg(m_xBuilder->weld_widget("lockformatcb"))
 , m_xExpRefCB(m_xBuilder->weld_check_button("exprefcb"))
+, m_xExpRefImg(m_xBuilder->weld_widget("lockexprefcb"))
 , m_xSortRefUpdateCB(m_xBuilder->weld_check_button("sortrefupdatecb"))
+, m_xSortRefUpdateImg(m_xBuilder->weld_widget("locksortrefupdatecb"))
 , m_xMarkHdrCB(m_xBuilder->weld_check_button("markhdrcb"))
+, m_xMarkHdrImg(m_xBuilder->weld_widget("lockmarkhdrcb"))
 , m_xReplWarnCB(m_xBuilder->weld_check_button("replwarncb"))
+, m_xReplWarnImg(m_xBuilder->weld_widget("lockreplwarncb"))
 , 
m_xLegacyCellSelectionCB(m_xBuilder->weld_check_button("legacy_cell_selection_cb"))
+, m_xLegacyCellSelectionImg(m_xBuilder->weld_widget("locklegacy_cell"))
 , m_xEnterPasteModeCB(m_xBuilder->weld_check_button("enter_paste_mode_cb"))
+, m_xEnterPasteModeImg(m_xBuilder->weld_widget("lockenter_paste"))
 {
 SetExchangeSupport();
 
@@ -530,11 +545,33 @@ voidScTpLayoutOptions::Reset( const SfxItemSet* 
rCoreSet )
 }
 ::SetFieldUnit(*m_xTabMF, eFieldUnit);
 }
-m_xUnitLB->save_value();
+
+bool bReadOnly = false;
+MeasurementSystem eSys = 
ScGlobal::getLocaleData().getMeasurementSystemEnum();
+if (eSys == MeasurementSystem::Metric)
+{
+bReadOnly = 

[Libreoffice-commits] core.git: sc/source

2023-12-05 Thread Eike Rathke (via logerrit)
 sc/source/core/tool/refupdat.cxx |   19 ---
 1 file changed, 12 insertions(+), 7 deletions(-)

New commits:
commit f35b540279b00575ff79eda1c65fb0f8caad86bf
Author: Eike Rathke 
AuthorDate: Tue Dec 5 20:58:49 2023 +0100
Commit: Eike Rathke 
CommitDate: Tue Dec 5 22:40:50 2023 +0100

Resolves: tdf#158223 Revert "fix" for tdf#156174 and follow-up

... introducing a real fix.

commit 94ca402cd1fe2fd9776d08448f7216b7f638e69a
CommitDate: Tue Jul 25 15:04:01 2023 +0200

tdf#156174 sc DBData: fix regression of database ranges

just cured a symptom by removing a condition that shouldn't had been
removed, instead of getting to the real cause of an odd reference
update.

Shrinking the end of a sheet reference range and thus moving it one
before the previously referenced relative position is only possible if
the deleted sheet actually touches the referenced range, which here the
start value points to and thus checking ref>=start+delta is not
necessary and subtracting 1 even harms. This is different from deleting
columns or rows where the start value points behind the deleted area of
moving the following area.

Change-Id: If9ae5dd6f6ae5cd248ad5d999f1aa7577d4ec035
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160374
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/sc/source/core/tool/refupdat.cxx b/sc/source/core/tool/refupdat.cxx
index e05a14d0137f..95f738c4ed84 100644
--- a/sc/source/core/tool/refupdat.cxx
+++ b/sc/source/core/tool/refupdat.cxx
@@ -25,12 +25,12 @@
 #include 
 
 template< typename R, typename S, typename U >
-static bool lcl_MoveStart( R& rRef, U nStart, S nDelta, U nMask )
+static bool lcl_MoveStart( R& rRef, U nStart, S nDelta, U nMask, bool bShrink 
= true )
 {
 bool bCut = false;
 if ( rRef >= nStart )
 rRef = sal::static_int_cast( rRef + nDelta );
-else if ( nDelta < 0 && rRef >= nStart + nDelta )
+else if ( nDelta < 0 && bShrink && rRef >= nStart + nDelta )
 rRef = nStart + nDelta; //TODO: limit ???
 if ( rRef < 0 )
 {
@@ -46,12 +46,12 @@ static bool lcl_MoveStart( R& rRef, U nStart, S nDelta, U 
nMask )
 }
 
 template< typename R, typename S, typename U >
-static bool lcl_MoveEnd( R& rRef, U nStart, S nDelta, U nMask )
+static bool lcl_MoveEnd( R& rRef, U nStart, S nDelta, U nMask, bool bShrink = 
true )
 {
 bool bCut = false;
 if ( rRef >= nStart )
 rRef = sal::static_int_cast( rRef + nDelta );
-else if ( nDelta < 0 && rRef >= nStart + nDelta )
+else if ( nDelta < 0 && bShrink && rRef >= nStart + nDelta )
 rRef = nStart + nDelta - 1; //TODO: limit ???
 if (rRef < 0)
 {
@@ -284,9 +284,14 @@ ScRefUpdateRes ScRefUpdate::Update( const ScDocument* 
pDoc, UpdateRefMode eUpdat
 SCTAB nMaxTab = pDoc->GetTableCount() - 1;
 nMaxTab = sal::static_int_cast(nMaxTab + nDz);  // 
adjust to new count
 bool bExp = (bExpand && IsExpand( theTab1, theTab2, nTab1, nDz ));
-bCut1 = lcl_MoveStart( theTab1, nTab1, nDz, nMaxTab );
-bCut2 = lcl_MoveEnd( theTab2, nTab1, nDz, nMaxTab );
-if ( bCut1 || bCut2 )
+bCut1 = lcl_MoveStart( theTab1, nTab1, nDz, nMaxTab, false 
/*bShrink*/);
+bCut2 = lcl_MoveEnd( theTab2, nTab1, nDz, nMaxTab, false 
/*bShrink*/);
+if ( theTab2 < theTab1 )
+{
+eRet = UR_INVALID;
+theTab2 = theTab1;
+}
+else if ( bCut1 || bCut2 )
 eRet = UR_UPDATED;
 if ( bExp )
 {


[Libreoffice-commits] core.git: 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 5b4a705f7477da2b546d0658e46e96f4e69017e4
Author: Aron Budea 
AuthorDate: Sun Dec 3 19:33:28 2023 +1030
Commit: Caolán McNamara 
CommitDate: Mon Dec 4 21:36:55 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 
(cherry picked from commit 67cdcf1ab2d2977fa79f9ecd7935ad8f3a8b4377)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160181
Tested-by: Jenkins

diff --git a/sc/source/ui/docshell/docfunc.cxx 
b/sc/source/ui/docshell/docfunc.cxx
index 7ad32d4963b9..1a8d902bea19 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: 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 c822a05625da33479527e11a80fe44d3d7b504c8
Author: Aron Budea 
AuthorDate: Sun Dec 3 19:22:17 2023 +1030
Commit: Caolán McNamara 
CommitDate: Mon Dec 4 21:28:46 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 
(cherry picked from commit 4d30910523bccb3b965f254401e6341af2ee8704)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160182
Tested-by: Jenkins

diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index 788aac9af86e..96546d11a5fe 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: sc/source sdext/source sd/source

2023-12-04 Thread Julien Nabet (via logerrit)
 sc/source/core/data/SolverSettings.cxx|4 +++-
 sc/source/ui/namedlg/namemgrtable.cxx |   12 ++--
 sd/source/filter/eppt/pptx-epptooxml.cxx  |6 +-
 sdext/source/pdfimport/tree/pdfiprocessor.cxx |1 +
 4 files changed, 19 insertions(+), 4 deletions(-)

New commits:
commit cdb180e767ebf2011414f4a5ba7213752474ee36
Author: Julien Nabet 
AuthorDate: Sun Dec 3 21:23:03 2023 +0100
Commit: Caolán McNamara 
CommitDate: Mon Dec 4 10:46:28 2023 +0100

cid#1546332 Using invalid iterator

and :

cid#1546327 Using invalid iterator
cid#1546289 Using invalid iterator
cid#1546284 Using invalid iterator

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

diff --git a/sc/source/core/data/SolverSettings.cxx 
b/sc/source/core/data/SolverSettings.cxx
index bbeeca7bd4cf..ac2d2aa24aeb 100644
--- a/sc/source/core/data/SolverSettings.cxx
+++ b/sc/source/core/data/SolverSettings.cxx
@@ -339,7 +339,9 @@ void SolverSettings::SaveSolverSettings()
  */
 bool SolverSettings::ReadParamValue(SolverParameter eParam, OUString& rValue, 
bool bRemoveQuotes)
 {
-OUString sRange = m_mNamedRanges.find(eParam)->second;
+const auto iter = m_mNamedRanges.find(eParam);
+assert(iter != m_mNamedRanges.end());
+OUString sRange = iter->second;
 ScRangeData* pRangeData
 = 
m_pRangeName->findByUpperName(ScGlobal::getCharClass().uppercase(sRange));
 if (pRangeData)
diff --git a/sc/source/ui/namedlg/namemgrtable.cxx 
b/sc/source/ui/namedlg/namemgrtable.cxx
index fa4b3ff4ef47..5b2330665374 100644
--- a/sc/source/ui/namedlg/namemgrtable.cxx
+++ b/sc/source/ui/namedlg/namemgrtable.cxx
@@ -83,9 +83,17 @@ const ScRangeData* ScRangeManagerTable::findRangeData(const 
ScRangeNameLine& rLi
 {
 const ScRangeName* pRangeName;
 if (rLine.aScope == maGlobalString)
-pRangeName = _RangeMap.find(STR_GLOBAL_RANGE_NAME)->second;
+{
+const auto iter = m_RangeMap.find(STR_GLOBAL_RANGE_NAME);
+assert(iter != m_RangeMap.end());
+pRangeName = >second;
+}
 else
-pRangeName = _RangeMap.find(rLine.aScope)->second;
+{
+const auto iter = m_RangeMap.find(rLine.aScope);
+assert(iter != m_RangeMap.end());
+pRangeName = >second;
+}
 
 return 
pRangeName->findByUpperName(ScGlobal::getCharClass().uppercase(rLine.aName));
 }
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 6cb5e277ee87..ae8ccc063cf2 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -2317,9 +2317,13 @@ void 
PowerPointExport::WritePlaceholderReferenceShapes(PowerPointShapeExport& rD
 && aAny == true))
 {
 if ((xShape = GetReferencedPlaceholderXShape(SlideNumber, ePageType)))
+{
+const auto iter = maPlaceholderShapeToIndexMap.find(xShape);
+assert(iter != maPlaceholderShapeToIndexMap.end());
 rDML.WritePlaceholderReferenceShape(SlideNumber,
-
maPlaceholderShapeToIndexMap.find(xShape)->second,
+iter->second,
 ePageType, mXPagePropSet);
+}
 }
 
 if (ePageType == LAYOUT
diff --git a/sdext/source/pdfimport/tree/pdfiprocessor.cxx 
b/sdext/source/pdfimport/tree/pdfiprocessor.cxx
index 7967a74a67cf..bf590c544334 100644
--- a/sdext/source/pdfimport/tree/pdfiprocessor.cxx
+++ b/sdext/source/pdfimport/tree/pdfiprocessor.cxx
@@ -471,6 +471,7 @@ const FontAttributes& PDFIProcessor::getFont( sal_Int32 
nFontId ) const
 IdToFontMap::const_iterator it = m_aIdToFont.find( nFontId );
 if( it == m_aIdToFont.end() )
 it = m_aIdToFont.find( 0 );
+assert(it != m_aIdToFont.end());
 return it->second;
 }
 


[Libreoffice-commits] core.git: sc/source

2023-12-01 Thread Armin Le Grand (allotropia) (via logerrit)
 sc/source/ui/view/output3.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c89c4ebe4924b0bc5b038bf2f114e1306caf1133
Author: Armin Le Grand (allotropia) 
AuthorDate: Fri Dec 1 11:10:40 2023 +0100
Commit: Armin Le Grand 
CommitDate: Fri Dec 1 13:11:30 2023 +0100

Prefer checked ptr to SdrPageView over unchecked

Change-Id: I1610cb82681e415ba6e4a741ad46e5aa90148989
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160201
Tested-by: Jenkins
Reviewed-by: Armin Le Grand 

diff --git a/sc/source/ui/view/output3.cxx b/sc/source/ui/view/output3.cxx
index 2fc317b85094..bc6efec65400 100644
--- a/sc/source/ui/view/output3.cxx
+++ b/sc/source/ui/view/output3.cxx
@@ -240,7 +240,7 @@ void ScOutputData::DrawSelectiveObjects(SdrLayerID nLayer)
 "ScOutputData::DrawSelectiveObjects: More than one 
SdrPageView, still using 1st one (!)");
 SdrPageWindow* 
patchedPageWindow(pPageView->GetPageWindow(0));
 assert(nullptr != patchedPageWindow && "SdrPageWindow 
*must* exist when 0 != PageWindowCount()");
-SdrPaintWindow temporaryPaintWindow(*pDrawView, *mpDev);
+SdrPaintWindow temporaryPaintWindow(*pLocalDrawView, 
*mpDev);
 SdrPaintWindow* 
previousPaintWindow(patchedPageWindow->patchPaintWindow(temporaryPaintWindow));
 
pPageView->DrawLayer(sal::static_int_cast(nLayer), mpDev);
 patchedPageWindow->unpatchPaintWindow(previousPaintWindow);


[Libreoffice-commits] core.git: sc/source

2023-11-30 Thread Armin Le Grand (allotropia) (via logerrit)
 sc/source/ui/view/output3.cxx |   54 +-
 1 file changed, 53 insertions(+), 1 deletion(-)

New commits:
commit 596c53b06cbb33d312d58572b61e966e913109f3
Author: Armin Le Grand (allotropia) 
AuthorDate: Thu Nov 30 15:33:07 2023 +0100
Commit: Armin Le Grand 
CommitDate: Thu Nov 30 19:52:41 2023 +0100

Make ScOutputData::DrawSelectiveObjects compatible

The implementation was not aware of the used functionality
in the used call to SdrPageView::DrawLayer: The given
OutputDevice is *not* intended to hand over a new render
target, it's used to allow the mechanism(s) to *identify*
one of multiple possibe registered render targets (which are
usually OutputDevice/SystemWindow). It is even the default
to call these method(s) with a nullptr which means to repaint
all registered OutputDevices/SystemWindows. This is no
tooling intended to repaint parts of a View to 'any'
OutputDevice.

This is not very obvious and there are already other places
in the office that do that wrong and never got cleaned-up,
therefore also being fallbacks to not just let those cases
fail, but at least paint something (and give you a warning).

The caveat is that these fallbacks (e.g. in
SdrPageView::DrawLayer) have to use temporary SdrPaintWindow/
SdrPageWindow instances to make the paint work. Especially
when a temporary SdrPageWindow is used an evtl. existing
VC/VOC/OC structure will not be used and with it also not
the existing primitive decompositions.

I thought about bigger changes in PageView/PaintView/
PageWindow/PaintWindow area to sort that out, but this is
- despite being utterly necessary - too expensive for now,
keep a note about this needed change for the future.

For now I will just use an already (also for this purpose
already existing) 'compromize' that will do it for now.

Change-Id: I8c7ccee1deb0d69aad1d2145a7ac2039aca685b4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160155
Tested-by: Jenkins
Reviewed-by: Armin Le Grand 

diff --git a/sc/source/ui/view/output3.cxx b/sc/source/ui/view/output3.cxx
index eec75c39664d..2fc317b85094 100644
--- a/sc/source/ui/view/output3.cxx
+++ b/sc/source/ui/view/output3.cxx
@@ -33,6 +33,8 @@
 #include 
 
 #include 
+#include 
+#include 
 
 // #i72502#
 Point ScOutputData::PrePrintDrawingLayer(tools::Long nLogStX, tools::Long 
nLogStY )
@@ -204,7 +206,57 @@ void ScOutputData::DrawSelectiveObjects(SdrLayerID nLayer)
 
 if(pPageView)
 {
-pPageView->DrawLayer(sal::static_int_cast(nLayer), 
mpDev);
+if (nullptr != pPageView->FindPageWindow(*mpDev))
+{
+// Target OutputDevice is registered for this view
+// (as it should be), we can just render
+
pPageView->DrawLayer(sal::static_int_cast(nLayer), mpDev);
+}
+else if (0 != pPageView->PageWindowCount())
+{
+// We need to temporarily make the target OutputDevice 
being
+// 'known/registered' in the paint mechanism so that
+// SdrPageView::DrawLayer can find it.
+// This situation can occur when someone interprets the
+// OutputDevice parameter that gets handed over to 
DrawLayer
+// (or other SdrPageView repaint methods) to be there to
+// define a new render target.
+// This is *not* the case: This parameter is used to
+// *identify* an already registered target-OutputDevice.
+// The default is even to call with a nullptr -> that 
triggers
+// the repaint for *all* registered OutputDevices/Windows.
+// Since this is a common and known misinterpretation it
+// is good to offer workarounds in the code - there are 
some
+// already.
+// For now - use an already existing 'patch mechanism' and
+// 'smuggle' the unknown/temporary OutputDevice as a
+// temporary SdrPaintWindow to the SdrPageWindow, that is
+// not very expensive.
+// NOTE: Just using the 1st SdrPageWindow here will be OK
+//   in most cases, the splitting of a view is only used
+//   in calc nowadays and should have identical zoom.
+//   Still, trigger a warning...
+OSL_ENSURE(1 == pPageView->PageWindowCount(),
+"ScOutputData::DrawSelectiveObjects: More than one 
SdrPageView, still using 1st one (!)");
+SdrPageWindow* 
patchedPageWindow(pPageView->GetPageWindow(0));
+assert(nullptr != 

[Libreoffice-commits] core.git: sc/source

2023-11-28 Thread Caolán McNamara (via logerrit)
 sc/source/core/data/documen5.cxx|2 +-
 sc/source/core/tool/charthelper.cxx |6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit be77cae912042c8c5fef8a41ccb4c6b2e10f5047
Author: Caolán McNamara 
AuthorDate: Tue Nov 28 09:56:51 2023 +
Commit: Caolán McNamara 
CommitDate: Tue Nov 28 22:29:38 2023 +0100

cid#1555974 silence Unchecked return value

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

diff --git a/sc/source/core/data/documen5.cxx b/sc/source/core/data/documen5.cxx
index b9356b210bf1..0a9a4179f0bc 100644
--- a/sc/source/core/data/documen5.cxx
+++ b/sc/source/core/data/documen5.cxx
@@ -454,7 +454,7 @@ void ScDocument::UpdateChartRef( UpdateRefMode 
eUpdateRefMode,
 uno::Reference xIPObj =
 FindOleObjectByName(pChartListener->GetName());
 
-svt::EmbeddedObjectRef::TryRunningState( xIPObj );
+(void)svt::EmbeddedObjectRef::TryRunningState( xIPObj );
 
 // After the change, chart keeps track of its own data source 
ranges,
 // the listener doesn't need to listen anymore, except the chart 
has
diff --git a/sc/source/core/tool/charthelper.cxx 
b/sc/source/core/tool/charthelper.cxx
index fa33b40314e9..82e11c055077 100644
--- a/sc/source/core/tool/charthelper.cxx
+++ b/sc/source/core/tool/charthelper.cxx
@@ -182,7 +182,7 @@ uno::Reference< chart2::XChartDocument > 
ScChartHelper::GetChartFromSdrObject( c
 uno::Reference< embed::XEmbeddedObject > xIPObj = 
static_cast(pObject)->GetObjRef();
 if( xIPObj.is() )
 {
-svt::EmbeddedObjectRef::TryRunningState( xIPObj );
+(void)svt::EmbeddedObjectRef::TryRunningState( xIPObj );
 uno::Reference< util::XCloseable > xComponent = 
xIPObj->getComponent();
 xReturn.set( uno::Reference< chart2::XChartDocument >( 
xComponent, uno::UNO_QUERY ) );
 }
@@ -294,7 +294,7 @@ void ScChartHelper::AddRangesIfProtectedChart( 
ScRangeListVector& rRangesVector,
 
 bool bDisableDataTableDialog = false;
 sal_Int32 nOldState = xEmbeddedObj->getCurrentState();
-svt::EmbeddedObjectRef::TryRunningState( xEmbeddedObj );
+(void)svt::EmbeddedObjectRef::TryRunningState( xEmbeddedObj );
 uno::Reference< beans::XPropertySet > xProps( 
xEmbeddedObj->getComponent(), uno::UNO_QUERY );
 if ( xProps.is() &&
  ( xProps->getPropertyValue("DisableDataTableDialog") >>= 
bDisableDataTableDialog ) &&
@@ -382,7 +382,7 @@ void ScChartHelper::CreateProtectedChartListenersAndNotify( 
ScDocument& rDoc, co
 if ( xEmbeddedObj.is() && ( nRangeList < nRangeListCount ) 
)
 {
 bool bDisableDataTableDialog = false;
-svt::EmbeddedObjectRef::TryRunningState( xEmbeddedObj 
);
+(void)svt::EmbeddedObjectRef::TryRunningState( 
xEmbeddedObj );
 uno::Reference< beans::XPropertySet > xProps( 
xEmbeddedObj->getComponent(), uno::UNO_QUERY );
 if ( xProps.is() &&
  ( 
xProps->getPropertyValue("DisableDataTableDialog") >>= bDisableDataTableDialog 
) &&


[Libreoffice-commits] core.git: sc/source

2023-11-27 Thread Sahil (via logerrit)
 sc/source/ui/view/gridwin.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit b6f274f3d0a415e84cda45f5929d89130974ee2d
Author: Sahil 
AuthorDate: Tue Nov 21 16:54:57 2023 +0530
Commit: Heiko Tietze 
CommitDate: Mon Nov 27 12:56:31 2023 +0100

tdf#33201 Change default HighlightOverlay color

Change-Id: I734b780808da35cdc58c55ede914f87e96fbdd99
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159778
Tested-by: Jenkins
Reviewed-by: Heiko Tietze 

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 67568e2ce21a..3f4f6b219c67 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -6719,11 +6719,13 @@ void ScGridWindow::UpdateHighlightOverlay()
 }
 }
 
-const Color aHighlight = 
SC_MOD()->GetColorConfig().GetColorValue(svtools::APPBACKGROUND ).nColor;
+const Color aBackgroundColor = 
SC_MOD()->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor;
+Color aHighlightColor = 
Application::GetSettings().GetStyleSettings().GetAccentColor();
+aHighlightColor.Merge(aBackgroundColor, 100);
 
 std::unique_ptr pOverlay(new 
sdr::overlay::OverlaySelection(
 sdr::overlay::OverlayType::Transparent,
-aHighlight,
+aHighlightColor,
 std::move(aRanges),
 false));
 


[Libreoffice-commits] core.git: sc/source sd/source sw/source

2023-11-24 Thread Oliver Specht (via logerrit)
 sc/source/ui/drawfunc/drtxtob.cxx|4 +++-
 sd/source/ui/view/drviews7.cxx   |1 +
 sw/source/uibase/shells/drwtxtex.cxx |7 +--
 3 files changed, 9 insertions(+), 3 deletions(-)

New commits:
commit c47100e478301085ffb1e71bed41b9e5c39377fd
Author: Oliver Specht 
AuthorDate: Tue Nov 21 17:32:23 2023 +0100
Commit: Thorsten Behrens 
CommitDate: Fri Nov 24 15:55:50 2023 +0100

tdf#158294 HTML simple format also added to paste special toolbox

adds the format HTML simple to the paste special toolbox controller
in impress and with draw text selection in calc and writer

Change-Id: Ibdca5d3cd5ab4640320cff3b03b30f6575e8fec8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159791
Tested-by: Jenkins
Tested-by: Gabor Kelemen 
Reviewed-by: Thorsten Behrens 

diff --git a/sc/source/ui/drawfunc/drtxtob.cxx 
b/sc/source/ui/drawfunc/drtxtob.cxx
index 78bafa27f63e..189ae2793a10 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -183,7 +183,7 @@ void ScDrawTextObjectBar::Execute( SfxRequest  )
 if (nFormat == SotClipboardFormatId::STRING)
 pOutView->Paste();
 else
-pOutView->PasteSpecial();
+pOutView->PasteSpecial(nFormat);
 }
 }
 break;
@@ -532,6 +532,8 @@ void ScDrawTextObjectBar::GetClipState( SfxItemSet& rSet )
 aFormats.AddClipbrdFormat( SotClipboardFormatId::RTF );
 if ( aDataHelper.HasFormat( SotClipboardFormatId::RICHTEXT 
) )
 aFormats.AddClipbrdFormat( 
SotClipboardFormatId::RICHTEXT );
+if 
(aDataHelper.HasFormat(SotClipboardFormatId::HTML_SIMPLE))
+
aFormats.AddClipbrdFormat(SotClipboardFormatId::HTML_SIMPLE);
 
 rSet.Put( aFormats );
 }
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index a238ec7fd04b..845bc956ed1b 100644
--- a/sd/source/ui/view/drviews7.cxx
+++ b/sd/source/ui/view/drviews7.cxx
@@ -153,6 +153,7 @@ static ::std::unique_ptr 
GetSupportedClipboardFormats (
 case SotClipboardFormatId::NETSCAPE_BOOKMARK:
 case SotClipboardFormatId::STRING:
 case SotClipboardFormatId::HTML:
+case SotClipboardFormatId::HTML_SIMPLE:
 case SotClipboardFormatId::RTF:
 case SotClipboardFormatId::RICHTEXT:
 case SotClipboardFormatId::EDITENGINE_ODF_TEXT_FLAT:
diff --git a/sw/source/uibase/shells/drwtxtex.cxx 
b/sw/source/uibase/shells/drwtxtex.cxx
index 3d7eecab6f07..a94016747ee8 100644
--- a/sw/source/uibase/shells/drwtxtex.cxx
+++ b/sw/source/uibase/shells/drwtxtex.cxx
@@ -1113,7 +1113,7 @@ void SwDrawTextShell::ExecClpbrd(SfxRequest const )
 if (nFormat == SotClipboardFormatId::STRING)
 pOLV->Paste();
 else
-pOLV->PasteSpecial();
+pOLV->PasteSpecial(nFormat);
 }
 
 break;
@@ -1138,7 +1138,8 @@ void SwDrawTextShell::StateClpbrd(SfxItemSet )
 TransferableDataHelper aDataHelper( 
TransferableDataHelper::CreateFromSystemClipboard( ().GetEditWin() ) );
 const bool bPaste = aDataHelper.HasFormat( SotClipboardFormatId::STRING ) 
||
 aDataHelper.HasFormat( SotClipboardFormatId::RTF ) ||
-aDataHelper.HasFormat( SotClipboardFormatId::RICHTEXT 
);
+aDataHelper.HasFormat( SotClipboardFormatId::RICHTEXT 
) ||
+aDataHelper.HasFormat( 
SotClipboardFormatId::HTML_SIMPLE);
 
 SfxWhichIter aIter(rSet);
 sal_uInt16 nWhich = aIter.FirstWhich();
@@ -1171,6 +1172,8 @@ void SwDrawTextShell::StateClpbrd(SfxItemSet )
 aFormats.AddClipbrdFormat( SotClipboardFormatId::RTF );
 if ( aDataHelper.HasFormat( SotClipboardFormatId::RICHTEXT ) )
 aFormats.AddClipbrdFormat( SotClipboardFormatId::RICHTEXT 
);
+if (aDataHelper.HasFormat(SotClipboardFormatId::HTML_SIMPLE))
+
aFormats.AddClipbrdFormat(SotClipboardFormatId::HTML_SIMPLE);
 
 rSet.Put( aFormats );
 }


[Libreoffice-commits] core.git: sc/source

2023-11-24 Thread Noel Grandin (via logerrit)
 sc/source/filter/xml/XMLCalculationSettingsContext.cxx |9 -
 sc/source/filter/xml/XMLTableShapeImportHelper.cxx |2 
 sc/source/filter/xml/xmlbodyi.cxx  |6 -
 sc/source/filter/xml/xmlcelli.cxx  |6 -
 sc/source/filter/xml/xmlcoli.cxx   |2 
 sc/source/filter/xml/xmlimprt.cxx  |   85 +++--
 sc/source/filter/xml/xmlimprt.hxx  |3 
 sc/source/filter/xml/xmlrowi.cxx   |2 
 sc/source/filter/xml/xmlstyli.cxx  |   70 ++
 sc/source/filter/xml/xmlsubti.cxx  |2 
 sc/source/filter/xml/xmltabi.cxx   |2 
 11 files changed, 87 insertions(+), 102 deletions(-)

New commits:
commit da0ca6a060e7df6fec65af502484ae0fda0d3033
Author: Noel Grandin 
AuthorDate: Thu Nov 23 21:10:23 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Nov 24 12:47:40 2023 +0100

use more concrete UNO in sc

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

diff --git a/sc/source/filter/xml/XMLCalculationSettingsContext.cxx 
b/sc/source/filter/xml/XMLCalculationSettingsContext.cxx
index d5e214b7c20d..645da6c59773 100644
--- a/sc/source/filter/xml/XMLCalculationSettingsContext.cxx
+++ b/sc/source/filter/xml/XMLCalculationSettingsContext.cxx
@@ -25,7 +25,7 @@
 #include 
 #include 
 #include 
-
+#include 
 #include 
 #include 
 
@@ -110,11 +110,8 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL 
ScXMLCalculationSetting
 
 void SAL_CALL ScXMLCalculationSettingsContext::endFastElement( sal_Int32 
/*nElement*/ )
 {
-if (!GetScImport().GetModel().is())
-return;
-
-uno::Reference  xPropertySet 
(GetScImport().GetModel(), uno::UNO_QUERY);
-if (!xPropertySet.is())
+ScModelObj* xPropertySet(GetScImport().GetScModel());
+if (!xPropertySet)
 return;
 
 xPropertySet->setPropertyValue( SC_UNO_CALCASSHOWN, uno::Any(bCalcAsShown) 
);
diff --git a/sc/source/filter/xml/XMLTableShapeImportHelper.cxx 
b/sc/source/filter/xml/XMLTableShapeImportHelper.cxx
index 8a6c4b4c3ca6..003b84a0e488 100644
--- a/sc/source/filter/xml/XMLTableShapeImportHelper.cxx
+++ b/sc/source/filter/xml/XMLTableShapeImportHelper.cxx
@@ -221,7 +221,7 @@ void XMLTableShapeImportHelper::finishShape(
 if (!bNote)
 {
 // any shape other than a note prevents copying the sheet
-ScSheetSaveData* pSheetData = 
comphelper::getFromUnoTunnel(mrImporter.GetModel())->GetSheetSaveData();
+ScSheetSaveData* pSheetData = 
static_cast(mrImporter).GetScModel()->GetSheetSaveData();
 pSheetData->BlockSheet( rTables.GetCurrentSheet() );
 }
 
diff --git a/sc/source/filter/xml/xmlbodyi.cxx 
b/sc/source/filter/xml/xmlbodyi.cxx
index 64c807dfe11e..0b75b50466eb 100644
--- a/sc/source/filter/xml/xmlbodyi.cxx
+++ b/sc/source/filter/xml/xmlbodyi.cxx
@@ -121,7 +121,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL
 ScXMLBodyContext::createFastChildContext( sal_Int32 nElement,
 const uno::Reference< xml::sax::XFastAttributeList > & xAttrList )
 {
-ScSheetSaveData* pSheetData = 
comphelper::getFromUnoTunnel(GetScImport().GetModel())->GetSheetSaveData();
+ScSheetSaveData* pSheetData = 
GetScImport().GetScModel()->GetSheetSaveData();
 if ( pSheetData && pSheetData->HasStartPos() )
 {
 // stream part to copy ends before the next child element
@@ -195,7 +195,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL
 
 void SAL_CALL ScXMLBodyContext::characters(const OUString &)
 {
-ScSheetSaveData* pSheetData = 
comphelper::getFromUnoTunnel(GetScImport().GetModel())->GetSheetSaveData();
+ScSheetSaveData* pSheetData = 
GetScImport().GetScModel()->GetSheetSaveData();
 if ( pSheetData && pSheetData->HasStartPos() )
 {
 // stream part to copy ends before any content (whitespace) within the 
spreadsheet element
@@ -207,7 +207,7 @@ void SAL_CALL ScXMLBodyContext::characters(const OUString &)
 
 void SAL_CALL ScXMLBodyContext::endFastElement(sal_Int32 nElement)
 {
-ScSheetSaveData* pSheetData = 
comphelper::getFromUnoTunnel(GetScImport().GetModel())->GetSheetSaveData();
+ScSheetSaveData* pSheetData = 
GetScImport().GetScModel()->GetSheetSaveData();
 if ( pSheetData && pSheetData->HasStartPos() )
 {
 // stream part to copy ends before the closing tag of spreadsheet 
element
diff --git a/sc/source/filter/xml/xmlcelli.cxx 
b/sc/source/filter/xml/xmlcelli.cxx
index e0968d3ad3dc..6c739dc42304 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -375,7 +375,7 @@ void ScXMLTableRowCellContext::PushFormat(sal_Int32 nBegin, 
sal_Int32 nEnd, cons
 rFmt.maSelection.nEndPos = nEnd;
 
 // Store the used text styles for export.
-

[Libreoffice-commits] core.git: sc/source

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

New commits:
commit 17e362e56f9e15d0214c441e632c91d22e58519d
Author: offtkp 
AuthorDate: Wed Nov 22 17:00:53 2023 +0200
Commit: Paris Oplopoios 
CommitDate: Thu Nov 23 16:13:39 2023 +0100

tdf#158252 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/+/159758
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 344651136876..809ba8520e33 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 
@@ -3142,6 +3143,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)
 {


[Libreoffice-commits] core.git: sc/source

2023-11-20 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 13eb599d8b0f81e4024f4aa2a6dd8b074f80a9df
Author: Michael Meeks 
AuthorDate: Thu Nov 16 19:28:21 2023 +
Commit: Michael Meeks 
CommitDate: Mon Nov 20 14:37:01 2023 +0100

lok: async calc merge-cells popup dialog.

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

diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx
index 45b053f3d33d..52e2aedd9d22 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 b7b615d6608f..bc967d96d47f 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 e052952ff664..e6c89b6a2b9c 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -943,13 +943,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 c2a7bfac2797..42c3ba2a62cd 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 
@@ -1179,7 +1180,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
@@ -1187,7 +1189,7 @@ bool ScViewFunc::MergeCells( bool bApi, bool& 
rDoContents, bool bCenter )
 if (!aTester.IsEditable())
 {
 ErrorMessage(aTester.GetMessageId());
-return false;
+return;
 }
 
 ScMarkData& rMark = GetViewData().GetMarkData();
@@ -1195,7 +1197,7 @@ bool ScViewFunc::MergeCells( bool bApi, bool& 
rDoContents, bool bCenter )
 if (!rMark.IsMarked())
 {
 ErrorMessage(STR_NOMULTISELECT);
-return false;
+return;
 }
 
 ScDocShell* pDocSh = GetViewData().GetDocShell();
@@ -1211,14 +1213,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.
@@ -1241,7 +1243,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 value to the 

[Libreoffice-commits] core.git: sc/source

2023-11-20 Thread Noel Grandin (via logerrit)
 sc/source/ui/inc/viewfunc.hxx  |2 +-
 sc/source/ui/view/cellsh3.cxx  |2 +-
 sc/source/ui/view/formatsh.cxx |8 
 sc/source/ui/view/tabvwsha.cxx |2 +-
 sc/source/ui/view/viewfun2.cxx |2 +-
 sc/source/ui/view/viewfunc.cxx |   28 ++--
 6 files changed, 22 insertions(+), 22 deletions(-)

New commits:
commit a7de97bc7b83790907bd6fdfb7a319e2467aba1d
Author: Noel Grandin 
AuthorDate: Mon Nov 20 10:50:18 2023 +0200
Commit: Noel Grandin 
CommitDate: Mon Nov 20 11:58:56 2023 +0100

pass by ref, not pointer, in ScViewFunc::ApplyAttributes

since we always de-ref the input params

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

diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx
index 323e7cbbe793..45b053f3d33d 100644
--- a/sc/source/ui/inc/viewfunc.hxx
+++ b/sc/source/ui/inc/viewfunc.hxx
@@ -172,7 +172,7 @@ public:
 boolInsertName( const OUString& rName, const OUString& rSymbol,
 const OUString& rType );
 
-voidApplyAttributes( const SfxItemSet* pDialogSet, const 
SfxItemSet* pOldSet, bool bAdjustBlockHeight = true );
+voidApplyAttributes( const SfxItemSet& rDialogSet, const 
SfxItemSet& rOldSet, bool bAdjustBlockHeight = true );
 voidApplyAttr( const SfxPoolItem& rAttrItem, bool 
bAdjustBlockHeight = true );
 
 voidApplySelectionPattern( const ScPatternAttr& rAttr,
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index 2b78e258aff0..e052952ff664 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -485,7 +485,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
 if ( pReqArgs->GetItemState( nWhich, true,  ) == 
SfxItemState::SET )
 aNewSet.Put( *pAttr );
 
-pTabViewShell->ApplyAttributes( ,  );
+pTabViewShell->ApplyAttributes( aNewSet, aEmptySet );
 
 rReq.Done();
 }
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 6556062f6c7a..93a456e46b53 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -507,7 +507,7 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq )
 SfxItemPool* pDocPool = 
GetViewData().GetDocument().GetPool();
 SfxItemSetFixed 
aNewSet( *pDocPool );
 aNewSet.Put( *pItem );
-pTabViewShell->ApplyAttributes( ,  );
+pTabViewShell->ApplyAttributes( aNewSet, rOldSet );
 }
 }
 break;
@@ -1179,7 +1179,7 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
 }
 
 aOldSet.Put( rBorderAttr );
-pTabViewShell->ApplyAttributes( ,  );
+pTabViewShell->ApplyAttributes( aNewSet, aOldSet );
 }
 break;
 
@@ -1198,7 +1198,7 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
 
aItem.SetLine(pNewAttrs->Get(ATTR_BORDER_TLBR).GetLine());
 aNewSet.Put(aItem);
 rReq.AppendItem(aItem);
-pTabViewShell->ApplyAttributes(, );
+pTabViewShell->ApplyAttributes(aNewSet, aOldSet);
 }
 }
 else // if( nSlot == SID_ATTR_BORDER_DIAG_BLTR )
@@ -1209,7 +1209,7 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
 
aItem.SetLine(pNewAttrs->Get(ATTR_BORDER_BLTR).GetLine());
 aNewSet.Put(aItem);
 rReq.AppendItem(aItem);
-pTabViewShell->ApplyAttributes(, );
+pTabViewShell->ApplyAttributes(aNewSet, aOldSet);
 }
 }
 
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index dd73c21a5076..84a3acbcdf44 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -622,7 +622,7 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& rReq, 
const OUString 
 UpdateNumberFormatter(*pItem);
 }
 
-ApplyAttributes(pOutSet, pOldSet.get());
+ApplyAttributes(*pOutSet, *pOldSet);
 
 pRequest->Done(*pOutSet);
 }
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index f787d1ec7012..c2a7bfac2797 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -3434,7 +3434,7 @@ void ScViewFunc::SetSelectionFrameLines( const 
SvxBorderLine* pLine,
 aNewSet.Put( aBLTRItem );

[Libreoffice-commits] core.git: sc/source

2023-11-19 Thread Andrea Gelmini (via logerrit)
 sc/source/core/data/attarray.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 97516a3153efcc4996512139b8c80f20b9d246b4
Author: Andrea Gelmini 
AuthorDate: Sun Nov 19 19:46:14 2023 +0100
Commit: Julien Nabet 
CommitDate: Sun Nov 19 20:03:12 2023 +0100

Fix typo

Change-Id: I4a1f624793c0bf2e97ee862b4599aa9c8fb9f9d2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159692
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index c2f3b0b75195..67d0ac67b088 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.cxx
@@ -297,7 +297,7 @@ void ScAttrArray::AddCondFormat( SCROW nStartRow, SCROW 
nEndRow, sal_uInt32 nInd
 // changed to create pNewPattern only if needed, else use already
 // existing pPattern. This shows by example how to avoid that special
 // handling of ATTR_PATTERN/ScPatternAttr in SC and massive
-// incarnations/desctructions of that Item (which contains an ItemSet)
+// incarnations/destructions of that Item (which contains an ItemSet)
 std::unique_ptr pNewPattern;
 if(pPattern)
 {


[Libreoffice-commits] core.git: sc/source

2023-11-19 Thread Sahil Gautam (via logerrit)
 sc/source/ui/view/gridwin4.cxx |4 
 1 file changed, 4 deletions(-)

New commits:
commit b05905dc2da404fd307b4589ca2df424b1bb4d65
Author: Sahil Gautam 
AuthorDate: Sat Nov 18 20:43:07 2023 +0530
Commit: Mike Kaganski 
CommitDate: Sun Nov 19 13:44:36 2023 +0100

tdf#33201 Make Row/column highlight usable

Row/column highlight shouldn't be updated using ScGridWindow::DrawContent
because it would call for highlight refresh even when typing in a cell,
leading to the text being hidden under the highlight.

Change-Id: Ic7cc71bc94629c71e6efdf677b7f34d6c4d0cc93
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159636
Tested-by: Mike Kaganski 
Reviewed-by: Mike Kaganski 

diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 0aede8ad69f8..3639e8287698 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1411,10 +1411,6 @@ void ScGridWindow::DrawContent(OutputDevice , 
const ScTableInfo& rTableI
 
 if (bPage && bInitialPageBreaks)
 SetupInitialPageBreaks(rDoc, nTab);
-
-// redraw highlighting as well
-ScAddress aCell = getViewData().GetCurPos();
-getViewData().GetViewShell()->SetCursor(aCell.Col(), aCell.Row());
 }
 
 


[Libreoffice-commits] core.git: sc/source

2023-11-18 Thread Julien Nabet (via logerrit)
 sc/source/core/tool/dbdata.cxx |8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

New commits:
commit 79d9195b954f7a815ddae9562c59fce4dd7c4351
Author: Julien Nabet 
AuthorDate: Sat Nov 18 15:18:49 2023 +0100
Commit: Julien Nabet 
CommitDate: Sat Nov 18 18:37:46 2023 +0100

Remove useless using + once use of replace pair by std::pair

Change-Id: Id283ac7909f19dabb98886caa1f2960d9098ddbe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159628
Reviewed-by: Julien Nabet 
Tested-by: Jenkins

diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx
index 4b24110658c3..69e28ca62876 100644
--- a/sc/source/core/tool/dbdata.cxx
+++ b/sc/source/core/tool/dbdata.cxx
@@ -42,12 +42,6 @@
 #include 
 #include 
 
-using ::std::unique_ptr;
-using ::std::for_each;
-using ::std::find_if;
-using ::std::remove_if;
-using ::std::pair;
-
 bool ScDBData::less::operator() (const std::unique_ptr& left, const 
std::unique_ptr& right) const
 {
 return ScGlobal::GetTransliteration().compareString(left->GetUpperName(), 
right->GetUpperName()) < 0;
@@ -1260,7 +1254,7 @@ bool 
ScDBCollection::NamedDBs::insert(std::unique_ptr pData)
 if (!pData->GetIndex())
 pData->SetIndex(mrParent.nEntryIndex++);
 
-pair r = m_DBs.insert(std::move(pData));
+std::pair r = m_DBs.insert(std::move(pData));
 
 if (r.second)
 {


[Libreoffice-commits] core.git: sc/source sd/source

2023-11-15 Thread Justin Luth (via logerrit)
 sc/source/ui/inc/editsh.hxx|   12 
 sc/source/ui/inc/tabvwsh.hxx   |6 --
 sc/source/ui/view/editsh.cxx   |   24 ++--
 sc/source/ui/view/gridwin.cxx  |   14 --
 sc/source/ui/view/tabvwshe.cxx |   20 
 sd/source/ui/inc/DrawViewShell.hxx |3 ---
 sd/source/ui/view/drviews4.cxx |7 +--
 7 files changed, 3 insertions(+), 83 deletions(-)

New commits:
commit 61d2d34b882b2b89c6702b04764058931ba70d60
Author: Justin Luth 
AuthorDate: Mon Nov 6 08:19:20 2023 -0500
Commit: Justin Luth 
CommitDate: Wed Nov 15 20:03:56 2023 +0100

tdf#158031 Revert "tdf#140361 use the DisableEditHyperlink state

... as of menu launch time"

This code is now obsolete,
so revert 7.3 commit d9a5302ca8bef90914539c12adb6c81496c28504.
(This cleanly reverted with the relevant portions of
 the following code-refactor commits also reverted.
commit 29489b33b435683021b72cb2bce27aba8cb7a430
commit 68e797402692c5c8abf1b2c4374e12a8d2707d07
)

It was a fine idea, but overly complex, dependent on invalidations,
and hard to re-implement everywhere it would be needed.

Instead, just also check before cursor for a field.

Change-Id: Id570fc4e33611b217eae8b2a2a85aa58e23d9d1a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159013
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sc/source/ui/inc/editsh.hxx b/sc/source/ui/inc/editsh.hxx
index 3777d197..99df24eb78a1 100644
--- a/sc/source/ui/inc/editsh.hxx
+++ b/sc/source/ui/inc/editsh.hxx
@@ -42,12 +42,6 @@ private:
 boolbPastePossible;
 boolbIsInsertMode;
 
-// tdf#140361 at context menu popup time set if the EditHyperlink entry
-// should be disabled and use that state if queried about it if
-// EditHyperlink is dispatched from the menu. So ignoring where the mouse
-// currently happens to be when the menu was dismissed.
-std::optional moAtContextMenu_DisableEditHyperlink;
-
 // These methods did return 'const SvxURLField*' before, but
 // at least for GetFirstURLFieldFromCell this is not safe: The
 // SvxFieldItem accessed there and held in the local temporary
@@ -86,12 +80,6 @@ public:
 voidGetUndoState(SfxItemSet );
 
 OUString GetSelectionText( bool bWholeWord );
-
-/// return true if "Edit Hyperlink" in context menu should be disabled
-bool ShouldDisableEditHyperlink() const;
-/// force "Edit Hyperlink" to true, with the expectation that 
SID_EDIT_HYPERLINK is
-/// later Invalidated to reset it back to its natural value
-void EnableEditHyperlink();
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index cc52a84f8354..b537af6900d2 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -430,12 +430,6 @@ public:
 void ClearFormEditData();
 ScFormEditData* GetFormEditData() { return mpFormEditData.get(); }
 
-/// return true if "Edit Hyperlink" in context menu should be disabled
-bool ShouldDisableEditHyperlink() const;
-/// force "Edit Hyperlink" to true, with the expectation that 
SID_EDIT_HYPERLINK is
-/// later Invalidated to reset it back to its natural value
-void EnableEditHyperlink();
-
 virtual tools::Rectangle getLOKVisibleArea() const override;
 
 const ScDragData& GetDragData() const { return *m_pDragData; }
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 737418d51d4b..3393ca3ad090 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -733,16 +733,6 @@ static void lcl_DisableAll( SfxItemSet& rSet )// 
disable all slots
 }
 }
 
-bool ScEditShell::ShouldDisableEditHyperlink() const
-{
-return !rViewData.HasEditView(rViewData.GetActivePart()) || 
!URLFieldHelper::IsCursorAtURLField(*pEditView);
-}
-
-void ScEditShell::EnableEditHyperlink()
-{
-moAtContextMenu_DisableEditHyperlink = false;
-}
-
 void ScEditShell::GetState( SfxItemSet& rSet )
 {
 // When deactivating the view, edit mode is stopped, but the EditShell is 
left active
@@ -841,18 +831,8 @@ void ScEditShell::GetState( SfxItemSet& rSet )
 case SID_COPY_HYPERLINK_LOCATION:
 case SID_REMOVE_HYPERLINK:
 {
-bool bDisableEditHyperlink;
-if (!moAtContextMenu_DisableEditHyperlink.has_value())
-bDisableEditHyperlink = ShouldDisableEditHyperlink();
-else
-{
-// tdf#140361 if a popup menu was active, use the 
state as of when the popup was launched and then drop
-// moAtContextMenu_DisableEditHyperlink
-bDisableEditHyperlink = 
*moAtContextMenu_DisableEditHyperlink;
-

[Libreoffice-commits] core.git: sc/source

2023-11-15 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 c0df28f957b43f0ecbffdc994ee0702dbe5bc33f
Author: Caolán McNamara 
AuthorDate: Tue Nov 14 17:24:18 2023 +
Commit: Caolán McNamara 
CommitDate: Wed Nov 15 11:08:06 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/+/159433
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 769f4249a4bf..7f75604dc464 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1806,8 +1806,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)
 {
@@ -1824,13 +1823,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);
-OUString sWindowId = OUString::number(nCurrentShellId) + "formulabar";
+(*pData)["text"] = m_aText;
+(*pData)["selection"] = m_aSelection;
+OUString sWindowId = OUString::number(m_nShellId) + "formulabar";
 jsdialog::SendAction(sWindowId, "sc_input_window", std::move(pData));
 }
 
@@ -2815,9 +2836,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();
@@ -4295,7 +4316,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());
 }
@@ -4459,7 +4480,7 @@ void ScInputHandler::InputSelection( const EditView* 
pView )
 {
 EditView* pActiveView = pTopView ? pTopView : pTableView;
 ESelection aSel = pActiveView ? pActiveView->GetSelection() : 
ESelection();
-ScInputHandler::LOKSendFormulabarUpdate(pActiveView, pActiveViewSh, 
GetEditString(), aSel);
+pActiveViewSh->LOKSendFormulabarUpdate(pActiveView, GetEditString(), 

[Libreoffice-commits] core.git: sc/source

2023-11-15 Thread Michael Weghorn (via logerrit)
 sc/source/ui/Accessibility/AccessibleCell.cxx |   14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

New commits:
commit c2165ec33c5549dcc494ad9197727e096678fc3c
Author: Michael Weghorn 
AuthorDate: Tue Nov 14 10:18:37 2023 +0100
Commit: Michael Weghorn 
CommitDate: Wed Nov 15 10:10:07 2023 +0100

tdf#158030 sc a11y: Report cell coords via {row,col}indextext obj attr

Expose the end-user consumable coordinates of a Calc
cell via "rowindextext" and "colindextext" object
attributes. These are specified in the ARIA specification
and the Accessibility Core API Mappings spec suggests to
map them to attributes of the same name for all of AT-SPI2,
IAccessible2 and UIA [1] [2], so no extra mapping is needed
in the platform-specific a11y bridges for now.

Orca git master already contains a commit to
make use of these attributes [3]:

commit 3c056cd7b58aa2cb1b3342c87d052704ef32fa24
Author: Joanmarie Diggs 
Date:   Mon Nov 13 18:19:12 2023 +0100

Look for the rowindextext and colindextext attributes in soffice

We were looking for these attributes only in the web script because
they are ARIA properties. Ultimately we will do this check globally.
In the meantime, if LO Calc exposes these attributes, we can remove
a hack or two. Therefore add support now so that they can prototype.

The attributes are exposed to IAccessible2 and AT-SPI when using
the gtk3 VCL plugin right away.

For qt6, this works with pending Qt changes suggesting to
add support for object attributes [4] [5] and the
corresponding LO change to implement the new interface [6]
(currently via the `CustomAttributes` attribute, might make
sense to introduce separate ones, but that's something to
look into once the pending Qt changes to add a mechanism
have been reviewed).

[1] https://www.w3.org/TR/core-aam-1.2/#ariaRowIndexText
[2] https://www.w3.org/TR/core-aam-1.2/#ariaColIndexText
[3] 
https://gitlab.gnome.org/GNOME/orca/-/commit/3c056cd7b58aa2cb1b3342c87d052704ef32fa24
[4] https://codereview.qt-project.org/c/qt/qtbase/+/517525
[5] https://codereview.qt-project.org/c/qt/qtbase/+/517526
[6] https://gerrit.libreoffice.org/c/core/+/159309

Change-Id: Ib675abafa2028d986b31d64ea7f5a38b1d54fc11
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159411
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx 
b/sc/source/ui/Accessibility/AccessibleCell.cxx
index 27ac67611585..3ac2fdba307f 100644
--- a/sc/source/ui/Accessibility/AccessibleCell.cxx
+++ b/sc/source/ui/Accessibility/AccessibleCell.cxx
@@ -495,7 +495,14 @@ uno::Any SAL_CALL ScAccessibleCell::getExtendedAttributes()
 {
 SolarMutexGuard aGuard;
 
-uno::Any strRet;
+// report row and column index text via attributes as specified in ARIA 
which map
+// to attributes of the same name for AT-SPI2, IAccessible2, UIA
+// https://www.w3.org/TR/core-aam-1.2/#ariaRowIndexText
+// https://www.w3.org/TR/core-aam-1.2/#ariaColIndexText
+const OUString sRowIndexText = maCellAddress.Format(ScRefFlags::ROW_VALID);
+const OUString sColIndexText = maCellAddress.Format(ScRefFlags::COL_VALID);
+OUString sAttributes = "rowindextext:" + sRowIndexText + ";colindextext:" 
+ sColIndexText + ";";
+
 if (mpViewShell)
 {
 OUString strFor = mpViewShell->GetFormula(maCellAddress) ;
@@ -519,9 +526,10 @@ uno::Any SAL_CALL ScAccessibleCell::getExtendedAttributes()
 strFor += "false";
 strFor += ";";
 }
-strRet <<= strFor ;
+sAttributes += strFor ;
 }
-return strRet;
+
+return uno::Any(sAttributes);
 }
 
 // cell has its own ParaIndent property, so when calling character attributes 
on cell, the ParaIndent should replace the ParaLeftMargin if its value is not 
zero.


[Libreoffice-commits] core.git: sc/source

2023-11-13 Thread Eike Rathke (via logerrit)
 sc/source/core/tool/interpr2.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 61d5f971496cb0091f9b37aaafcb87694f3810ea
Author: Eike Rathke 
AuthorDate: Mon Nov 13 17:08:13 2023 +0100
Commit: Eike Rathke 
CommitDate: Mon Nov 13 19:31:38 2023 +0100

Resolves: tdf#127498 Force corrected TIMEVALUE() result

Change-Id: I750a3251c3cf5e8cad4a37c7c4b646c0457f2dbe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159389
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index 8255fe7f76c1..61f88d638a00 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -923,6 +924,7 @@ void ScInterpreter::ScGetTimeValue()
 nFuncFmtType = SvNumFormatType::TIME;
 double fDateVal = rtl::math::approxFloor(fVal);
 double fTimeVal = fVal - fDateVal;
+fTimeVal = ::tools::Duration(fTimeVal).GetInDays();  // force 
corrected
 PushDouble(fTimeVal);
 }
 else


[Libreoffice-commits] core.git: sc/source

2023-11-09 Thread Noel Grandin (via logerrit)
 sc/source/filter/inc/xcl97rec.hxx   |5 +++--
 sc/source/filter/xcl97/xcl97esc.cxx |2 +-
 sc/source/filter/xcl97/xcl97rec.cxx |6 +++---
 3 files changed, 7 insertions(+), 6 deletions(-)

New commits:
commit c32bf48b7446808ffc47472021ec32cb7c70eea7
Author: Noel Grandin 
AuthorDate: Wed Nov 8 13:26:15 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Nov 9 16:32:47 2023 +0100

loplugin:fieldcast in XclObjOle

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

diff --git a/sc/source/filter/inc/xcl97rec.hxx 
b/sc/source/filter/inc/xcl97rec.hxx
index 78d173568e97..57210208ddad 100644
--- a/sc/source/filter/inc/xcl97rec.hxx
+++ b/sc/source/filter/inc/xcl97rec.hxx
@@ -33,6 +33,7 @@ class SdrCaptionObj;
 class SdrTextObj;
 class XclTxo;
 class XclEscherEx;
+class SdrOle2Obj;
 
 class ScURLTransformer : public oox::drawingml::URLTransformer
 {
@@ -237,13 +238,13 @@ class XclObjOle : public XclObj
 {
 private:
 
-const SdrObject&rOleObj;
+const SdrOle2Obj&rOleObj;
 SotStorage* pRootStorage;
 
 virtual voidWriteSubRecs( XclExpStream& rStrm ) override;
 
 public:
-XclObjOle( XclExpObjectManager& rObjMgr, const 
SdrObject& rObj );
+XclObjOle( XclExpObjectManager& rObjMgr, const 
SdrOle2Obj& rObj );
 virtual ~XclObjOle() override;
 
 virtual voidSave( XclExpStream& rStrm ) override;
diff --git a/sc/source/filter/xcl97/xcl97esc.cxx 
b/sc/source/filter/xcl97/xcl97esc.cxx
index 07e3769e65b9..43538de6c889 100644
--- a/sc/source/filter/xcl97/xcl97esc.cxx
+++ b/sc/source/filter/xcl97/xcl97esc.cxx
@@ -217,7 +217,7 @@ EscherExHostAppData* XclEscherEx::StartShape( const 
Reference< XShape >& rxShape
 pCurrXclObj = nullptr; // no metafile or whatsoever
 }
 else// metafile and OLE object
-pCurrXclObj = new XclObjOle( mrObjMgr, *pObj );
+pCurrXclObj = new XclObjOle( mrObjMgr, 
*static_cast(pObj) );
 }
 else// just a metafile
 pCurrXclObj = new XclObjAny( mrObjMgr, rxShape, () 
);
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx 
b/sc/source/filter/xcl97/xcl97rec.cxx
index f9031449bf70..e9ae7bdeba42 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -996,7 +996,7 @@ std::size_t XclTxo::GetLen() const
 
 // --- class XclObjOle ---
 
-XclObjOle::XclObjOle( XclExpObjectManager& rObjMgr, const SdrObject& rObj ) :
+XclObjOle::XclObjOle( XclExpObjectManager& rObjMgr, const SdrOle2Obj& rObj ) :
 XclObj( rObjMgr, EXC_OBJTYPE_PICTURE ),
 rOleObj( rObj ),
 pRootStorage( rObjMgr.GetRoot().GetRootStorage().get() )
@@ -1020,7 +1020,7 @@ void XclObjOle::WriteSubRecs( XclExpStream& rStrm )
 if( !xOleStg.is() )
 return;
 
-uno::Reference < embed::XEmbeddedObject > xObj( static_cast(rOleObj).GetObjRef() );
+uno::Reference < embed::XEmbeddedObject > xObj( rOleObj.GetObjRef() );
 if ( !xObj.is() )
 return;
 
@@ -1051,7 +1051,7 @@ void XclObjOle::WriteSubRecs( XclExpStream& rStrm )
 // OBJFLAGS subrecord, undocumented as usual
 rStrm.StartRecord( EXC_ID_OBJFLAGS, 2 );
 sal_uInt16 nFlags = EXC_OBJ_PIC_MANUALSIZE;
-::set_flag( nFlags, EXC_OBJ_PIC_SYMBOL, static_cast(rOleObj).GetAspect() == embed::Aspects::MSOLE_ICON );
+::set_flag( nFlags, EXC_OBJ_PIC_SYMBOL, rOleObj.GetAspect() == 
embed::Aspects::MSOLE_ICON );
 rStrm << nFlags;
 rStrm.EndRecord();
 


[Libreoffice-commits] core.git: sc/source

2023-11-09 Thread Noel Grandin (via logerrit)
 sc/source/ui/vba/vbaaxes.cxx |   10 +-
 sc/source/ui/vba/vbaaxes.hxx |6 --
 2 files changed, 9 insertions(+), 7 deletions(-)

New commits:
commit 4f505ba25335b1b279ab8164825c3d051cd74757
Author: Noel Grandin 
AuthorDate: Wed Nov 8 13:13:15 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Nov 9 09:10:43 2023 +0100

loplugin:fieldcast in AxisIndexWrapper

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

diff --git a/sc/source/ui/vba/vbaaxes.cxx b/sc/source/ui/vba/vbaaxes.cxx
index 0a377750aa59..66155bccfc43 100644
--- a/sc/source/ui/vba/vbaaxes.cxx
+++ b/sc/source/ui/vba/vbaaxes.cxx
@@ -91,14 +91,14 @@ class AxisIndexWrapper : public ::cppu::WeakImplHelper< 
container::XIndexAccess
 // on each getByIndex
 uno::Reference< uno::XComponentContext > mxContext;
 std::vector< AxesCoordinate > mCoordinates;
-uno::Reference< excel::XChart > mxChart;
+rtl::Reference< ScVbaChart > mxChart;
 public:
-AxisIndexWrapper( uno::Reference< uno::XComponentContext > xContext, 
uno::Reference< excel::XChart > xChart ) : mxContext(std::move( xContext )), 
mxChart(std::move( xChart ))
+AxisIndexWrapper( uno::Reference< uno::XComponentContext > xContext, 
rtl::Reference< ScVbaChart > xChart ) : mxContext(std::move( xContext )), 
mxChart(std::move( xChart ))
 {
 if ( !mxChart.is() )
 return;
 
-ScVbaChart* pChart = static_cast< ScVbaChart* >( mxChart.get() );
+ScVbaChart* pChart = mxChart.get();
 // primary
 bool bBool = false;
 uno::Reference< beans::XPropertySet > xDiagramPropertySet( 
pChart->xDiagramPropertySet() );
@@ -145,7 +145,7 @@ public:
 }
 };
 
-uno::Reference< container::XIndexAccess > createIndexWrapper( const 
uno::Reference< excel::XChart >& xChart, const uno::Reference< 
uno::XComponentContext >& xContext )
+uno::Reference< container::XIndexAccess > createIndexWrapper( const 
rtl::Reference< ScVbaChart >& xChart, const uno::Reference< 
uno::XComponentContext >& xContext )
 {
 return new AxisIndexWrapper( xContext, xChart );
 }
@@ -153,7 +153,7 @@ uno::Reference< container::XIndexAccess > 
createIndexWrapper( const uno::Referen
 }
 
 // #FIXME The collection semantics will never work as this object is not yet 
initialised correctly
-ScVbaAxes::ScVbaAxes( const uno::Reference< XHelperInterface >& xParent,const 
uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< 
excel::XChart >& xChart ) : ScVbaAxes_BASE( xParent, xContext, 
createIndexWrapper( xChart, xContext )), moChartParent( xChart )
+ScVbaAxes::ScVbaAxes( const uno::Reference< XHelperInterface >& xParent,const 
uno::Reference< uno::XComponentContext > & xContext, const rtl::Reference< 
ScVbaChart >& xChart ) : ScVbaAxes_BASE( xParent, xContext, createIndexWrapper( 
xChart, xContext )), moChartParent( xChart )
 {
 }
 
diff --git a/sc/source/ui/vba/vbaaxes.hxx b/sc/source/ui/vba/vbaaxes.hxx
index cb7c48a7fccd..62f39717468c 100644
--- a/sc/source/ui/vba/vbaaxes.hxx
+++ b/sc/source/ui/vba/vbaaxes.hxx
@@ -20,16 +20,18 @@
 
 #include 
 #include 
+#include 
 
 namespace ooo::vba::excel { class XAxis; }
 namespace ooo::vba::excel { class XChart; }
+class ScVbaChart;
 
 typedef CollTestImplHelper< ov::excel::XAxes > ScVbaAxes_BASE;
 class ScVbaAxes : public ScVbaAxes_BASE
 {
-css::uno::Reference< ov::excel::XChart > moChartParent; // not the true 
parent I guess
+rtl::Reference< ScVbaChart > moChartParent; // not the true parent I guess
 public:
-ScVbaAxes( const css::uno::Reference< ov::XHelperInterface >& xParent, 
const css::uno::Reference< css::uno::XComponentContext > & xContext, const 
css::uno::Reference< ov::excel::XChart >& xChart );
+ScVbaAxes( const css::uno::Reference< ov::XHelperInterface >& xParent, 
const css::uno::Reference< css::uno::XComponentContext > & xContext, const 
rtl::Reference< ScVbaChart >& xChart );
 // XEnumerationAccess
 virtual css::uno::Type SAL_CALL getElementType() override;
 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL 
createEnumeration() override;


[Libreoffice-commits] core.git: sc/source

2023-11-08 Thread Noel Grandin (via logerrit)
 sc/source/ui/vba/vbawindow.cxx |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit a984289075a46b600052269d7aa5682e8906ce10
Author: Noel Grandin 
AuthorDate: Wed Nov 8 12:23:04 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Nov 9 06:23:45 2023 +0100

loplugin:fieldcast in SelectedSheetsEnumAccess

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

diff --git a/sc/source/ui/vba/vbawindow.cxx b/sc/source/ui/vba/vbawindow.cxx
index 9bc913dcc2b2..bd0ebd463500 100644
--- a/sc/source/ui/vba/vbawindow.cxx
+++ b/sc/source/ui/vba/vbawindow.cxx
@@ -100,13 +100,14 @@ class SelectedSheetsEnumAccess : public 
SelectedSheets_BASE
 uno::Reference< uno::XComponentContext > m_xContext;
 NameIndexHash namesToIndices;
 Sheets sheets;
-uno::Reference< frame::XModel > m_xModel;
+rtl::Reference< ScModelObj > m_xModel;
 public:
-SelectedSheetsEnumAccess( uno::Reference< uno::XComponentContext > 
xContext, uno::Reference< frame::XModel > xModel ):m_xContext(std::move( 
xContext )), m_xModel(std::move( xModel ))
+SelectedSheetsEnumAccess( uno::Reference< uno::XComponentContext > 
xContext, const uno::Reference< frame::XModel > & xModel 
):m_xContext(std::move( xContext ))
 {
-ScModelObj* pModel = static_cast< ScModelObj* >( m_xModel.get() );
+ScModelObj* pModel = static_cast< ScModelObj* >( xModel.get() );
 if ( !pModel )
 throw uno::RuntimeException("Cannot obtain current document" );
+m_xModel = pModel;
 ScDocShell* pDocShell = 
static_cast(pModel->GetEmbeddedObject());
 if ( !pDocShell )
 throw uno::RuntimeException("Cannot obtain docshell" );
@@ -118,8 +119,7 @@ public:
 SCTAB nIndex = 0;
 const ScMarkData& rMarkData = pViewShell->GetViewData().GetMarkData();
 sheets.reserve( nTabCount );
-uno::Reference  xSpreadSheet( m_xModel, 
uno::UNO_QUERY_THROW );
-uno::Reference  xIndex( 
xSpreadSheet->getSheets(), uno::UNO_QUERY_THROW );
+uno::Reference  xIndex( 
m_xModel->getSheets(), uno::UNO_QUERY_THROW );
 for (const auto& rTab : rMarkData)
 {
 if (rTab >= nTabCount)


[Libreoffice-commits] core.git: 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 233495f76c45d2425052fb3685c04f448e85466b
Author: Caolán McNamara 
AuthorDate: Fri Nov 3 11:46:32 2023 +
Commit: Caolán McNamara 
CommitDate: Fri Nov 3 13:46:34 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/+/158892
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 6cedb9617ec5..de2ce3679cca 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -2606,7 +2606,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 );
@@ -2701,7 +2701,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);
 }
 }
 
@@ -2748,6 +2748,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;
@@ -2757,8 +2759,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())
 {
@@ -2804,7 +2809,7 @@ void ScInputHandler::DataChanged( bool bFromTopNotify, 
bool bSetModified )
 }
 }
 
-if (comphelper::LibreOfficeKit::isActive() && pActiveViewSh && pInputWin)
+if (bUpdateKit)
 {
 UpdateActiveView();
 if (pActiveView)
@@ -4269,10 +4274,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;
@@ -4428,7 +4438,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 ed3fe521d94b..945a1d8973cc 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 (e.g. when editing a 
formula
 // and 

[Libreoffice-commits] core.git: 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 ceef5a9c39be2b2b16c800f1d92a6b7bf968d8ed
Author: offtkp 
AuthorDate: Wed Nov 1 19:14:44 2023 +0200
Commit: Paris Oplopoios 
CommitDate: Wed Nov 1 21:54:03 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/+/158703
Reviewed-by: Paris Oplopoios 
Tested-by: Jenkins

diff --git a/sc/source/core/data/colorscale.cxx 
b/sc/source/core/data/colorscale.cxx
index b205d35adb6e..eff6d050b13b 100644
--- a/sc/source/core/data/colorscale.cxx
+++ b/sc/source/core/data/colorscale.cxx
@@ -1337,11 +1337,11 @@ constexpr OUString a3Flags[] = {
 };
 
 constexpr OUString 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 OUString 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 OUString a3Stars[] = {


[Libreoffice-commits] core.git: 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 edbc3a09edcf58a4738b4648811a065f3f55bc7c
Author: offtkp 
AuthorDate: Wed Nov 1 18:52:35 2023 +0200
Commit: Paris Oplopoios 
CommitDate: Wed Nov 1 20:17:01 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/+/158702
Tested-by: Jenkins
Reviewed-by: Paris Oplopoios 

diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx
index 2e268239b048..9a8675fcd190 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: sc/source

2023-11-01 Thread Noel Grandin (via logerrit)
 sc/source/ui/docshell/datastream.cxx|   11 +--
 sc/source/ui/docshell/docsh.cxx |2 +-
 sc/source/ui/inc/datastream.hxx |8 +++-
 sc/source/ui/miscdlgs/datastreamdlg.cxx |5 +
 4 files changed, 10 insertions(+), 16 deletions(-)

New commits:
commit 883b50c06ea00a5437a757c1a4a49dc27a92e30a
Author: Noel Grandin 
AuthorDate: Tue Oct 31 13:46:00 2023 +0200
Commit: Noel Grandin 
CommitDate: Wed Nov 1 18:39:52 2023 +0100

DataStream::mnSettings is unused

found by a new loplugin

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

diff --git a/sc/source/ui/docshell/datastream.cxx 
b/sc/source/ui/docshell/datastream.cxx
index 47a8cd1729c4..998985bb78ff 100644
--- a/sc/source/ui/docshell/datastream.cxx
+++ b/sc/source/ui/docshell/datastream.cxx
@@ -264,16 +264,16 @@ void DataStream::MakeToolbarVisible()
 
 DataStream* DataStream::Set(
 ScDocShell *pShell, const OUString& rURL, const ScRange& rRange,
-sal_Int32 nLimit, MoveType eMove, sal_uInt32 nSettings)
+sal_Int32 nLimit, MoveType eMove)
 {
-DataStream* pLink = new DataStream(pShell, rURL, rRange, nLimit, eMove, 
nSettings);
+DataStream* pLink = new DataStream(pShell, rURL, rRange, nLimit, eMove);
 sc::DocumentLinkManager& rMgr = pShell->GetDocument().GetDocLinkManager();
 rMgr.setDataStream(pLink);
 return pLink;
 }
 
 DataStream::DataStream(ScDocShell *pShell, const OUString& rURL, const 
ScRange& rRange,
-sal_Int32 nLimit, MoveType eMove, sal_uInt32 nSettings) :
+sal_Int32 nLimit, MoveType eMove) :
 mpDocShell(pShell),
 maDocAccess(mpDocShell->GetDocument()),
 meOrigMove(NO_MOVE),
@@ -292,7 +292,7 @@ DataStream::DataStream(ScDocShell *pShell, const OUString& 
rURL, const ScRange&
 maImportTimer.SetTimeout(0);
 maImportTimer.SetInvokeHandler( LINK(this, DataStream, ImportTimerHdl) );
 
-Decode(rURL, rRange, nLimit, eMove, nSettings);
+Decode(rURL, rRange, nLimit, eMove);
 }
 
 DataStream::~DataStream()
@@ -344,12 +344,11 @@ ScRange DataStream::GetRange() const
 }
 
 void DataStream::Decode(const OUString& rURL, const ScRange& rRange,
-sal_Int32 nLimit, MoveType eMove, const sal_uInt32 nSettings)
+sal_Int32 nLimit, MoveType eMove)
 {
 msURL = rURL;
 meMove = eMove;
 meOrigMove = eMove;
-mnSettings = nSettings;
 
 mbValuesInLine = true; // always true.
 
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 175eb2f9c38a..c951814ce77f 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -447,7 +447,7 @@ void processDataStream( ScDocShell& rShell, const 
sc::ImportPostProcessData& rDa
 r.meInsertPos == sc::ImportPostProcessData::DataStream::InsertTop ?
 sc::DataStream::MOVE_DOWN : sc::DataStream::RANGE_DOWN;
 
-sc::DataStream* pStrm = new sc::DataStream(, r.maURL, aTopRange, 
nLimit, eMove, 0);
+sc::DataStream* pStrm = new sc::DataStream(, r.maURL, aTopRange, 
nLimit, eMove);
 pStrm->SetRefreshOnEmptyLine(r.mbRefreshOnEmpty);
 sc::DocumentLinkManager& rMgr = rShell.GetDocument().GetDocLinkManager();
 rMgr.setDataStream(pStrm);
diff --git a/sc/source/ui/inc/datastream.hxx b/sc/source/ui/inc/datastream.hxx
index 849b3168236e..b7a0a36797f3 100644
--- a/sc/source/ui/inc/datastream.hxx
+++ b/sc/source/ui/inc/datastream.hxx
@@ -62,15 +62,14 @@ public:
 typedef std::vector LinesType;
 
 enum MoveType { NO_MOVE, RANGE_DOWN, MOVE_DOWN, MOVE_UP };
-enum { VALUES_IN_LINE = 2 };
 
 static void MakeToolbarVisible();
 static DataStream* Set(ScDocShell *pShell, const OUString& rURL, const 
ScRange& rRange,
-sal_Int32 nLimit, MoveType eMove, sal_uInt32 nSettings);
+sal_Int32 nLimit, MoveType eMove);
 
 DataStream(
 ScDocShell *pShell, const OUString& rURL, const ScRange& rRange,
-sal_Int32 nLimit, MoveType eMove, sal_uInt32 nSettings);
+sal_Int32 nLimit, MoveType eMove);
 
 ~DataStream();
 
@@ -81,7 +80,7 @@ public:
 
 void Decode(
 const OUString& rURL, const ScRange& rRange, sal_Int32 nLimit,
-MoveType eMove, const sal_uInt32 nSettings);
+MoveType eMove);
 
 bool ImportData();
 void StartImport();
@@ -101,7 +100,6 @@ private:
 ScDocShell* mpDocShell;
 DocumentStreamAccess maDocAccess;
 OUString msURL;
-sal_uInt32 mnSettings;
 MoveType meOrigMove; // Initial move setting. This one gets saved to file.
 MoveType meMove; // move setting during streaming, which may change in the 
middle.
 bool mbRunning;
diff --git a/sc/source/ui/miscdlgs/datastreamdlg.cxx 
b/sc/source/ui/miscdlgs/datastreamdlg.cxx
index cd03a3e66c53..1876665dabbc 100644
--- a/sc/source/ui/miscdlgs/datastreamdlg.cxx
+++ b/sc/source/ui/miscdlgs/datastreamdlg.cxx
@@ -161,14 +161,11 

[Libreoffice-commits] core.git: sc/source svtools/source

2023-10-31 Thread Andreas Heinisch (via logerrit)
 sc/source/ui/view/tabview.cxx |3 ++-
 svtools/source/control/tabbar.cxx |4 +---
 2 files changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 4f1b3c16f5530a2a190cab07c07c7bf63acf42c7
Author: Andreas Heinisch 
AuthorDate: Tue Oct 31 15:48:44 2023 +0100
Commit: Andreas Heinisch 
CommitDate: Tue Oct 31 15:51:59 2023 +0100

tdf#100584, tdf#157784 - Arrange sheets depending on the RTL settings

The tab bar's position should be determined globally based on the RTL
settings, rather than being individually set for each sheet.

Change-Id: I0690b01c842d2da6d49b57d1adad0a8e0844087f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158730
Tested-by: Andreas Heinisch 
Reviewed-by: Andreas Heinisch 

diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index d158516fdb0a..25d60abc2946 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -280,7 +280,8 @@ void ScTabView::DoResize( const Point& rOffset, const Size& 
rSize, bool bInner )
 if (bHasHint)
 RemoveHintWindow();
 
-bool bLayoutRTL = aViewData.GetDocument().IsLayoutRTL( 
aViewData.GetTabNo() );
+// tdf#100584 - arrange sheets depending on the RTL settings
+bool bLayoutRTL = AllSettings::GetLayoutRTL();
 tools::Long nTotalWidth = rSize.Width();
 if ( bLayoutRTL )
 nTotalWidth += 2*rOffset.X();
diff --git a/svtools/source/control/tabbar.cxx 
b/svtools/source/control/tabbar.cxx
index 1690269ba234..02a23b8aea33 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -715,9 +715,7 @@ void TabBar::ImplFormat()
 const size_t nItemListSize = mpImpl->maItemList.size();
 for (size_t nItemIndex = 0; nItemIndex < nItemListSize; nItemIndex++)
 {
-// tdf#100584 - arrange sheets depending on the RTL settings
-auto& rItem = mbMirrored ? mpImpl->maItemList[nItemListSize - 
nItemIndex - 1]
- : mpImpl->maItemList[nItemIndex];
+auto& rItem = mpImpl->maItemList[nItemIndex];
 
 // At all non-visible tabs an empty rectangle is set
 if ((nItemIndex + 1 < mnFirstPos) || (x > mnLastOffX))


[Libreoffice-commits] core.git: sc/source svtools/source

2023-10-31 Thread Andreas Heinisch (via logerrit)
 sc/source/ui/view/tabview.cxx |3 +--
 svtools/source/control/tabbar.cxx |4 +++-
 2 files changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 3be361d00eb1d61543e2c8c6953e63c149fb1eb0
Author: Andreas Heinisch 
AuthorDate: Tue Oct 31 15:39:13 2023 +0100
Commit: Andreas Heinisch 
CommitDate: Tue Oct 31 15:40:01 2023 +0100

Revert "tdf#100584, tdff#157784 - Arrange sheets depending on the RTL 
settings"

This reverts commit a90d89d5b2dae2b4c3fd6a411de2160a3bf20779.

Reason for revert: Typo in the commit message

Change-Id: I58f184e2733d91aa827396868fb4f7b8e9d47a48
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158693
Tested-by: Andreas Heinisch 
Reviewed-by: Andreas Heinisch 

diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 25d60abc2946..d158516fdb0a 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -280,8 +280,7 @@ void ScTabView::DoResize( const Point& rOffset, const Size& 
rSize, bool bInner )
 if (bHasHint)
 RemoveHintWindow();
 
-// tdf#100584 - arrange sheets depending on the RTL settings
-bool bLayoutRTL = AllSettings::GetLayoutRTL();
+bool bLayoutRTL = aViewData.GetDocument().IsLayoutRTL( 
aViewData.GetTabNo() );
 tools::Long nTotalWidth = rSize.Width();
 if ( bLayoutRTL )
 nTotalWidth += 2*rOffset.X();
diff --git a/svtools/source/control/tabbar.cxx 
b/svtools/source/control/tabbar.cxx
index 02a23b8aea33..1690269ba234 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -715,7 +715,9 @@ void TabBar::ImplFormat()
 const size_t nItemListSize = mpImpl->maItemList.size();
 for (size_t nItemIndex = 0; nItemIndex < nItemListSize; nItemIndex++)
 {
-auto& rItem = mpImpl->maItemList[nItemIndex];
+// tdf#100584 - arrange sheets depending on the RTL settings
+auto& rItem = mbMirrored ? mpImpl->maItemList[nItemListSize - 
nItemIndex - 1]
+ : mpImpl->maItemList[nItemIndex];
 
 // At all non-visible tabs an empty rectangle is set
 if ((nItemIndex + 1 < mnFirstPos) || (x > mnLastOffX))


[Libreoffice-commits] core.git: sc/source svtools/source

2023-10-31 Thread Andreas Heinisch (via logerrit)
 sc/source/ui/view/tabview.cxx |3 ++-
 svtools/source/control/tabbar.cxx |4 +---
 2 files changed, 3 insertions(+), 4 deletions(-)

New commits:
commit a90d89d5b2dae2b4c3fd6a411de2160a3bf20779
Author: Andreas Heinisch 
AuthorDate: Mon Oct 30 20:29:05 2023 +0100
Commit: Andreas Heinisch 
CommitDate: Tue Oct 31 15:37:57 2023 +0100

tdf#100584, tdff#157784 - Arrange sheets depending on the RTL settings

The tab bar's position should be determined globally based on the RTL 
settings, rather than being individually set for each sheet.

Change-Id: I0906f85058a5b4250540dda07740eec61f46d299
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158675
Tested-by: Andreas Heinisch 
Reviewed-by: Andreas Heinisch 

diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index d158516fdb0a..25d60abc2946 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -280,7 +280,8 @@ void ScTabView::DoResize( const Point& rOffset, const Size& 
rSize, bool bInner )
 if (bHasHint)
 RemoveHintWindow();
 
-bool bLayoutRTL = aViewData.GetDocument().IsLayoutRTL( 
aViewData.GetTabNo() );
+// tdf#100584 - arrange sheets depending on the RTL settings
+bool bLayoutRTL = AllSettings::GetLayoutRTL();
 tools::Long nTotalWidth = rSize.Width();
 if ( bLayoutRTL )
 nTotalWidth += 2*rOffset.X();
diff --git a/svtools/source/control/tabbar.cxx 
b/svtools/source/control/tabbar.cxx
index 1690269ba234..02a23b8aea33 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -715,9 +715,7 @@ void TabBar::ImplFormat()
 const size_t nItemListSize = mpImpl->maItemList.size();
 for (size_t nItemIndex = 0; nItemIndex < nItemListSize; nItemIndex++)
 {
-// tdf#100584 - arrange sheets depending on the RTL settings
-auto& rItem = mbMirrored ? mpImpl->maItemList[nItemListSize - 
nItemIndex - 1]
- : mpImpl->maItemList[nItemIndex];
+auto& rItem = mpImpl->maItemList[nItemIndex];
 
 // At all non-visible tabs an empty rectangle is set
 if ((nItemIndex + 1 < mnFirstPos) || (x > mnLastOffX))


[Libreoffice-commits] core.git: sc/source

2023-10-31 Thread Caolán McNamara (via logerrit)
 sc/source/core/data/column2.cxx   |   12 ++--
 sc/source/core/data/column4.cxx   |2 +-
 sc/source/ui/docshell/docfunc.cxx |2 +-
 sc/source/ui/docshell/docsh4.cxx  |6 +++---
 sc/source/ui/inc/docsh.hxx|2 +-
 sc/source/ui/undo/undocell.cxx|4 ++--
 6 files changed, 14 insertions(+), 14 deletions(-)

New commits:
commit f1d2442662a1c593c0ed47391156719ffdf9385f
Author: Caolán McNamara 
AuthorDate: Tue Oct 31 10:55:13 2023 +
Commit: Caolán McNamara 
CommitDate: Tue Oct 31 15:10:05 2023 +0100

we always have a ScDocument so pass by reference

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

diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index a2f8ca5ea25a..e7ca588a0b34 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -1945,7 +1945,7 @@ public:
 ScPostIt* pNew = p->Clone(aSrcPos, mrDestCol.GetDoc(), aDestPos, 
mbCloneCaption).release();
 miPos = mrDestNotes.set(miPos, nDestRow, pNew);
 // Notify our LOK clients also
-ScDocShell::LOKCommentNotify(LOKCommentNotificationType::Add, 
(), aDestPos, pNew);
+ScDocShell::LOKCommentNotify(LOKCommentNotificationType::Add, 
mrDestCol.GetDoc(), aDestPos, pNew);
 }
 };
 
@@ -2230,13 +2230,13 @@ void ScColumn::SetCellNote(SCROW nRow, 
std::unique_ptr pNote)
 namespace {
 class CellNoteHandler
 {
-const ScDocument* m_pDocument;
+const ScDocument& m_rDocument;
 const ScAddress m_aAddress; // 'incomplete' address consisting of tab, 
column
 const bool m_bForgetCaptionOwnership;
 
 public:
-CellNoteHandler(const ScDocument* pDocument, const ScAddress& rPos, 
bool bForgetCaptionOwnership) :
-m_pDocument(pDocument),
+CellNoteHandler(const ScDocument& rDocument, const ScAddress& rPos, 
bool bForgetCaptionOwnership) :
+m_rDocument(rDocument),
 m_aAddress(rPos),
 m_bForgetCaptionOwnership(bForgetCaptionOwnership) {}
 
@@ -2249,7 +2249,7 @@ namespace {
 ScAddress aAddr(m_aAddress);
 aAddr.SetRow(nRow);
 // Notify our LOK clients
-ScDocShell::LOKCommentNotify(LOKCommentNotificationType::Remove, 
m_pDocument, aAddr, p);
+ScDocShell::LOKCommentNotify(LOKCommentNotificationType::Remove, 
m_rDocument, aAddr, p);
 }
 };
 } // anonymous namespace
@@ -2257,7 +2257,7 @@ namespace {
 void ScColumn::CellNotesDeleting(SCROW nRow1, SCROW nRow2, bool 
bForgetCaptionOwnership)
 {
 ScAddress aAddr(nCol, 0, nTab);
-CellNoteHandler aFunc((), aAddr, bForgetCaptionOwnership);
+CellNoteHandler aFunc(GetDoc(), aAddr, bForgetCaptionOwnership);
 sc::ParseNote(maCellNotes.begin(), maCellNotes, nRow1, nRow2, aFunc);
 }
 
diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx
index be0fc4f201c3..8e22b13a8e1e 100644
--- a/sc/source/core/data/column4.cxx
+++ b/sc/source/core/data/column4.cxx
@@ -362,7 +362,7 @@ void ScColumn::CopyOneCellFromClip( 
sc::CopyFromClipContext& rCxt, SCROW nRow1,
 aDestPosition.SetRow(nRow1);
 for (size_t i = 0; i < nDestSize; ++i)
 {
-ScDocShell::LOKCommentNotify(LOKCommentNotificationType::Add, 
, aDestPosition, aNotes[i]);
+ScDocShell::LOKCommentNotify(LOKCommentNotificationType::Add, 
rDocument, aDestPosition, aNotes[i]);
 aDestPosition.IncRow();
 }
 }
diff --git a/sc/source/ui/docshell/docfunc.cxx 
b/sc/source/ui/docshell/docfunc.cxx
index 5691a67b9780..7ad32d4963b9 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -1396,7 +1396,7 @@ void ScDocFunc::ReplaceNote( const ScAddress& rPos, const 
OUString& rNoteText, c
 if (pNewNote)
 {
 ScDocShell::LOKCommentNotify(hadOldNote ? 
LOKCommentNotificationType::Modify : LOKCommentNotificationType::Add,
- , rPos, pNewNote);
+ rDoc, rPos, pNewNote);
 }
 }
 else if (!bApi)
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 0ef5be3c50e8..f8a33f91d1e8 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -2535,9 +2535,9 @@ bool ScDocShell::DdeSetData( const OUString& rItem,
 return pObj;
 }
 
-void ScDocShell::LOKCommentNotify(LOKCommentNotificationType nType, const 
ScDocument* pDocument, const ScAddress& rPos, const ScPostIt* pNote)
+void ScDocShell::LOKCommentNotify(LOKCommentNotificationType nType, const 
ScDocument& rDocument, const ScAddress& rPos, const ScPostIt* pNote)
 {
-if ( !pDocument->IsDocVisible() || // don't want callbacks until document 
load
+if ( !rDocument.IsDocVisible() || // don't want callbacks until document 
load
  

[Libreoffice-commits] core.git: sc/source

2023-10-29 Thread Caolán McNamara (via logerrit)
 sc/source/core/data/formulacell.cxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit 3b39360edc104f4ecfed1228b08812388f5126a1
Author: Caolán McNamara 
AuthorDate: Sun Oct 29 16:46:23 2023 +
Commit: Caolán McNamara 
CommitDate: Sun Oct 29 21:44:11 2023 +0100

crashtesting: dependency tracking doesn't parse ocRange

so only the args passed to ocRange are seen, not what range is
created from those args, so the dependency detected is just the args
and not the result

seen with forum-mso-en4-457928.xlsx


=SUMPRODUCT(--(LEFT(TRIM(Summary.Sections.Type),2)=F24)*Summary.Sections.QCount)

Summary.Sections.Type is
Summary.SectionType.Start:INDEX(Summary,,COLUMN(Summary.SectionType.EndCol))

Summary.SectionType.Start is
$Summary.$BD$7

Summary.SectionType.EndCol is
$Summary.$BG$7

So $BD$7 and $BG$7 are detected as dependencies, but we are really dependent
on the $BD$7:$BG$7 range, so $BE$7:$BF$7 is not seen

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

diff --git a/sc/source/core/data/formulacell.cxx 
b/sc/source/core/data/formulacell.cxx
index 88970ff75401..f278492b0916 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -4512,6 +4512,15 @@ struct ScDependantsCalculator
 return false;
 }
 
+if (p->GetOpCode() == ocRange)
+{
+// We are just looking at svSingleRef/svDoubleRef, so we will 
miss that ocRange constructs
+// a range from its arguments, and only examining the 
individual args doesn't capture the
+// true range of dependencies
+SAL_WARN("sc.core.formulacell", "dynamic range, dropping as 
candidate for parallelizing");
+return false;
+}
+
 switch (p->GetType())
 {
 case svSingleRef:


[Libreoffice-commits] core.git: sc/source sc/uiconfig

2023-10-29 Thread Szymon Kłos (via logerrit)
 sc/source/ui/condformat/condformateasydlg.cxx |2 +-
 sc/uiconfig/scalc/ui/conditionaleasydialog.ui |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit ecdb3d6e8dd24d2e75a16f181c0ba565a101408f
Author: Szymon Kłos 
AuthorDate: Sun Oct 29 09:47:09 2023 +0100
Commit: Szymon Kłos 
CommitDate: Sun Oct 29 11:14:59 2023 +0100

Use better approach to translate simple conditional formatting dialog

it will allow to reorder words in case of languages with
different order

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

diff --git a/sc/source/ui/condformat/condformateasydlg.cxx 
b/sc/source/ui/condformat/condformateasydlg.cxx
index d707b7c9f88d..0fee5ea15b36 100644
--- a/sc/source/ui/condformat/condformateasydlg.cxx
+++ b/sc/source/ui/condformat/condformateasydlg.cxx
@@ -53,7 +53,7 @@ namespace sc
 {
 void ConditionalFormatEasyDialog::SetDescription(std::u16string_view 
rCondition)
 {
-mxDescription->set_label(mxDescription->get_label() + ": " + rCondition);
+mxDescription->set_label(mxDescription->get_label().replaceAll("%1", 
rCondition));
 }
 
 ConditionalFormatEasyDialog::ConditionalFormatEasyDialog(SfxBindings* 
pBindings,
diff --git a/sc/uiconfig/scalc/ui/conditionaleasydialog.ui 
b/sc/uiconfig/scalc/ui/conditionaleasydialog.ui
index 077610196356..c7a43c4cb256 100644
--- a/sc/uiconfig/scalc/ui/conditionaleasydialog.ui
+++ b/sc/uiconfig/scalc/ui/conditionaleasydialog.ui
@@ -171,7 +171,7 @@
   
 True
 False
-Apply conditional formatting to cells
+Apply conditional formatting to cells: %1
 
   
   


[Libreoffice-commits] core.git: sc/source sc/uiconfig

2023-10-29 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 42811537c8536330e21fd6cee7561294a177836a
Author: Szymon Kłos 
AuthorDate: Fri Oct 27 13:02:29 2023 +0200
Commit: Szymon Kłos 
CommitDate: Sun Oct 29 09:14:50 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/+/158538
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

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: 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 f8f8d5ec4568a10dc77144369f52b2dd165e66c5
Author: Paris Oplopoios 
AuthorDate: Fri Oct 27 13:12:19 2023 +0300
Commit: Paris Oplopoios 
CommitDate: Sun Oct 29 01:05:30 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/+/158555
Tested-by: Jenkins
Reviewed-by: Paris Oplopoios 

diff --git a/sc/source/ui/condformat/condformateasydlg.cxx 
b/sc/source/ui/condformat/condformateasydlg.cxx
index c371861ac355..7e07b1a1dc19 100644
--- a/sc/source/ui/condformat/condformateasydlg.cxx
+++ b/sc/source/ui/condformat/condformateasydlg.cxx
@@ -67,11 +67,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 469613d2f1c8..9ca15a11bda9 100644
--- a/sc/source/ui/inc/condformateasydlg.hxx
+++ b/sc/source/ui/inc/condformateasydlg.hxx
@@ -45,6 +45,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: sc/source

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

New commits:
commit 67803125b17f1231b5a436883ebc77baa52a5d4f
Author: Caolán McNamara 
AuthorDate: Fri Oct 27 12:49:23 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Oct 27 20:28:15 2023 +0200

merge these checks together to avoid duplication

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

diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx
index 5dd60f6d266e..7a6758788ad4 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 332356dd794f..4ba5f774b83a 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -1428,62 +1428,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;
+}
 
-ScViewDataTable* pTabData = maTabData[nTabIndex].get();
-if (!pTabData)
-{
-SAL_WARN("sc.viewdata", "ScViewData::GetCurXForTab : hidden sheet = " 
<< nTabIndex);
-return -1;
-}
-return pTabData->nCurX;
+SCCOL ScViewData::GetCurXForTab( SCTAB nTabIndex ) const
+{
+ScViewDataTable* pTabData = FetchTableData(nTabIndex);
+return pTabData ? pTabData->nCurX : -1;
 }
 
 SCROW ScViewData::GetCurYForTab( SCTAB nTabIndex ) const
 {
-if (!ValidTab(nTabIndex) || (nTabIndex >= 
static_cast(maTabData.size(
-return -1;
-
-ScViewDataTable* pTabData = maTabData[nTabIndex].get();
-if (!pTabData)
-{
-SAL_WARN("sc.viewdata", "ScViewData::GetCurYForTab : hidden sheet = " 
<< nTabIndex);
-return -1;
-}
-return pTabData->nCurY;
+ScViewDataTable* pTabData = FetchTableData(nTabIndex);
+return pTabData ? pTabData->nCurY : -1;
 }
 
 void ScViewData::SetCurXForTab( SCCOL nNewCurX, SCTAB nTabIndex )
 {
-if (!ValidTab(nTabIndex) || (nTabIndex >= 
static_cast(maTabData.size(
-return;
-
-ScViewDataTable* pTabData = maTabData[nTabIndex].get();
-if (!pTabData)
-{
-SAL_WARN("sc.viewdata", "ScViewData::SetCurXForTab : hidden sheet = " 
<< nTabIndex);
-return;
-}
-
-pTabData->nCurX = nNewCurX;
+if (ScViewDataTable* pTabData = FetchTableData(nTabIndex))
+pTabData->nCurX = nNewCurX;
 }
 
 void ScViewData::SetCurYForTab( SCCOL nNewCurY, SCTAB nTabIndex )
 {
-if (!ValidTab(nTabIndex) || (nTabIndex >= 
static_cast(maTabData.size(
-return;
-
-ScViewDataTable* pTabData = maTabData[nTabIndex].get();
-if (!pTabData)
-{
-SAL_WARN("sc.viewdata", "ScViewData::SetCurYForTab : hidden sheet = " 
<< nTabIndex);
-return;
-}
-
-pTabData->nCurY = nNewCurY;
+if (ScViewDataTable* pTabData = FetchTableData(nTabIndex))
+pTabData->nCurY = nNewCurY;
 }
 
 void ScViewData::SetMaxTiledCol( SCCOL nNewMaxCol )


[Libreoffice-commits] core.git: sc/source

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

New commits:
commit 334d3aff8d411ee5f2d612c8899a171716b8a3d1
Author: Caolán McNamara 
AuthorDate: Fri Oct 27 12:04:29 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Oct 27 17:53:42 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/+/158561
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 8b2599ab2684..0ef5be3c50e8 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -19,8 +19,6 @@
 
 #include 
 
-#include 
-
 #include 
 
 #include 
@@ -53,6 +51,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -2543,32 +2542,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();
+OString aPayload = aAnnotation.finishAndGetAsOString();
 
 ScViewData* pViewData = GetViewData();
 SfxViewShell* pThisViewShell = ( pViewData ? pViewData->GetViewShell() : 
nullptr );
@@ -2576,7 +2574,7 @@ void 
ScDocShell::LOKCommentNotify(LOKCommentNotificationType nType, const ScDocu
 while (pViewShell)
 {
 if (pThisViewShell == nullptr || pViewShell->GetDocId() == 
pThisViewShell->GetDocId())
-pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_COMMENT, 
OString(aPayload));
+pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_COMMENT, 
aPayload);
 pViewShell = SfxViewShell::GetNext(*pViewShell);
 }
 }


[Libreoffice-commits] core.git: sc/source

2023-10-26 Thread Caolán McNamara (via logerrit)
 sc/source/ui/view/viewdata.cxx |   34 ++
 1 file changed, 30 insertions(+), 4 deletions(-)

New commits:
commit ce8920448c05594f37f09c7a42ae3f3c7ccb7a1e
Author: Caolán McNamara 
AuthorDate: Thu Oct 26 12:47:21 2023 +0100
Commit: Caolán McNamara 
CommitDate: Thu Oct 26 17:41:02 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/+/158502
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 511051d6f49c..332356dd794f 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -1433,7 +1433,13 @@ SCCOL ScViewData::GetCurXForTab( SCTAB nTabIndex ) const
 if (!ValidTab(nTabIndex) || (nTabIndex >= 
static_cast(maTabData.size())) || !maTabData[nTabIndex])
 return -1;
 
-return maTabData[nTabIndex]->nCurX;
+ScViewDataTable* pTabData = maTabData[nTabIndex].get();
+if (!pTabData)
+{
+SAL_WARN("sc.viewdata", "ScViewData::GetCurXForTab : hidden sheet = " 
<< nTabIndex);
+return -1;
+}
+return pTabData->nCurX;
 }
 
 SCROW ScViewData::GetCurYForTab( SCTAB nTabIndex ) const
@@ -1441,7 +1447,13 @@ SCROW ScViewData::GetCurYForTab( SCTAB nTabIndex ) const
 if (!ValidTab(nTabIndex) || (nTabIndex >= 
static_cast(maTabData.size(
 return -1;
 
-return maTabData[nTabIndex]->nCurY;
+ScViewDataTable* pTabData = maTabData[nTabIndex].get();
+if (!pTabData)
+{
+SAL_WARN("sc.viewdata", "ScViewData::GetCurYForTab : hidden sheet = " 
<< nTabIndex);
+return -1;
+}
+return pTabData->nCurY;
 }
 
 void ScViewData::SetCurXForTab( SCCOL nNewCurX, SCTAB nTabIndex )
@@ -1449,7 +1461,14 @@ void ScViewData::SetCurXForTab( SCCOL nNewCurX, SCTAB 
nTabIndex )
 if (!ValidTab(nTabIndex) || (nTabIndex >= 
static_cast(maTabData.size(
 return;
 
-maTabData[nTabIndex]->nCurX = nNewCurX;
+ScViewDataTable* pTabData = maTabData[nTabIndex].get();
+if (!pTabData)
+{

[Libreoffice-commits] core.git: sc/source

2023-10-23 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 8db72aab30ec81c26452a363b8ef9d6a98a07632
Author: Noel Grandin 
AuthorDate: Sun Oct 22 21:25:15 2023 +0200
Commit: Noel Grandin 
CommitDate: Mon Oct 23 09:38:24 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/+/158338
Tested-by: Noel Grandin 
Reviewed-by: Noel Grandin 

diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index d037685c66e4..a2f8ca5ea25a 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -1328,6 +1328,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 c80c6483bc5e..1b67ab4f4b24 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -1513,8 +1513,11 @@ void ScOutputData::LayoutStrings(bool bPixelToLogic)
 
 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
@@ -4394,11 +4397,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: 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 2cbf54efab073d9147e2d6c627c8ff3726de8578
Author: Michael Meeks 
AuthorDate: Thu Oct 19 15:15:33 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Oct 20 17:17:54 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/+/158158
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx
index a1423b2e1c67..be0fc4f201c3 100644
--- a/sc/source/core/data/column4.cxx
+++ b/sc/source/core/data/column4.cxx
@@ -856,7 +856,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: sc/source

2023-10-19 Thread Balazs Varga (via logerrit)
 sc/source/filter/xml/xmlexprt.cxx |   10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 87e1a77a9aadb883386816dc4ebc3dad64c81892
Author: Balazs Varga 
AuthorDate: Wed Oct 18 13:52:16 2023 +0200
Commit: Balazs Varga 
CommitDate: Thu Oct 19 14:16:09 2023 +0200

tdf#156336 - sc ods: fix can't remove Calc comment metadata

Remove Calc comment metadata (author, date) during ods export
if the Remove personal information option is enable.

Change-Id: I814aabb734cff4160dccf1913a33aa270c2edbf6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158116
Tested-by: Jenkins
Tested-by: Gabor Kelemen 
Reviewed-by: Gabor Kelemen 

diff --git a/sc/source/filter/xml/xmlexprt.cxx 
b/sc/source/filter/xml/xmlexprt.cxx
index 2ac992a20930..9acae7b1ec0d 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -3714,16 +3714,22 @@ void ScXMLExport::exportAnnotationMeta( const 
uno::Reference < drawing::XShape >
 if (xCurrentShape.get()!=xShape.get())
 return;
 
+bool bRemovePersonalInfo = SvtSecurityOptions::IsOptionSet(
+SvtSecurityOptions::EOption::DocWarnRemovePersonalInfo) && 
!SvtSecurityOptions::IsOptionSet(
+SvtSecurityOptions::EOption::DocWarnKeepNoteAuthorDateInfo);
+
 const OUString& sAuthor(pNote->GetAuthor());
 if (!sAuthor.isEmpty())
 {
 SvXMLElementExport aCreatorElem( *this, XML_NAMESPACE_DC,
 XML_CREATOR, true,
 false );
-Characters(sAuthor);
+Characters( bRemovePersonalInfo
+? "Author" + OUString::number(SvXMLExport::GetInfoID(sAuthor))
+: sAuthor );
 }
 
-const OUString& aDate(pNote->GetDate());
+const OUString& aDate(bRemovePersonalInfo ? OUString("1970-01-01") : 
pNote->GetDate()); // Epoch time
 if (pDoc)
 {
 SvNumberFormatter* pNumForm = pDoc->GetFormatTable();


[Libreoffice-commits] core.git: sc/source

2023-10-19 Thread Xisco Fauli (via logerrit)
 sc/source/ui/app/inputhdl.cxx |   37 ++---
 1 file changed, 18 insertions(+), 19 deletions(-)

New commits:
commit fee44aa4d5080af29ff0e663118ea1e629d53605
Author: Xisco Fauli 
AuthorDate: Thu Oct 19 10:48:58 2023 +0200
Commit: Xisco Fauli 
CommitDate: Thu Oct 19 14:01:24 2023 +0200

sc: return earlier if there is no pActiveViewSh

See https://gerrit.libreoffice.org/c/core/+/158123

Change-Id: Id9a27ca657377ba0a81009cdd2d27ce6aa4e2aa0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158140
Reviewed-by: Noel Grandin 
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index de6a7f47a8bc..6cedb9617ec5 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -3073,6 +3073,9 @@ void ScInputHandler::EnterHandler( ScEnterMode 
nBlockMode, bool bBeforeSavingInL
 && pActiveViewSh != SfxViewShell::Current())
 return;
 
+if (!pActiveViewSh)
+return;
+
 // Macro calls for validity can cause a lot of problems, so inhibit
 // nested calls of EnterHandler().
 if (bInEnterHandler) return;
@@ -3080,8 +3083,7 @@ void ScInputHandler::EnterHandler( ScEnterMode 
nBlockMode, bool bBeforeSavingInL
 bInOwnChange = true; // disable ModifyHdl (reset below)
 mbPartialPrefix = false;
 
-if (pActiveViewSh)
-ImplCreateEditEngine();
+ImplCreateEditEngine();
 
 bool bMatrix = ( nBlockMode == ScEnterMode::MATRIX );
 
@@ -3103,7 +3105,7 @@ void ScInputHandler::EnterHandler( ScEnterMode 
nBlockMode, bool bBeforeSavingInL
 lcl_SelectionToEnd(pTableView);
 }
 
-vcl::Window* pFrameWin = pActiveViewSh ? pActiveViewSh->GetFrameWin() 
: nullptr;
+vcl::Window* pFrameWin = pActiveViewSh->GetFrameWin();
 
 if (pTopView)
 pTopView->CompleteAutoCorrect(); // CompleteAutoCorrect for both 
Views
@@ -3115,7 +3117,7 @@ void ScInputHandler::EnterHandler( ScEnterMode 
nBlockMode, bool bBeforeSavingInL
 lcl_RemoveTabs(aPreAutoCorrectString);
 
 // Test if valid (always with simple string)
-if (bModified && nValidation && pActiveViewSh)
+if (bModified && nValidation)
 {
 ScDocument& rDoc = pActiveViewSh->GetViewData().GetDocument();
 const ScValidationData* pData = rDoc.GetValidationEntry( nValidation );
@@ -3165,7 +3167,7 @@ void ScInputHandler::EnterHandler( ScEnterMode 
nBlockMode, bool bBeforeSavingInL
 }
 
 // Check for input into DataPilot table
-if ( bModified && pActiveViewSh && !bForget )
+if ( bModified && !bForget )
 {
 ScDocument& rDoc = pActiveViewSh->GetViewData().GetDocument();
 ScDPObject* pDPObj = rDoc.GetDPAtCursor( aCursorPos.Col(), 
aCursorPos.Row(), aCursorPos.Tab() );
@@ -3187,21 +3189,18 @@ void ScInputHandler::EnterHandler( ScEnterMode 
nBlockMode, bool bBeforeSavingInL
 {
 //  #i3820# If the spell checker flags numerical input as error,
 //  it still has to be treated as number, not EditEngine object.
-if ( pActiveViewSh )
+ScDocument& rDoc = pActiveViewSh->GetViewData().GetDocument();
+// #i67990# don't use pLastPattern in EnterHandler
+const ScPatternAttr* pPattern = rDoc.GetPattern( aCursorPos.Col(), 
aCursorPos.Row(), aCursorPos.Tab() );
+if (pPattern)
 {
-ScDocument& rDoc = pActiveViewSh->GetViewData().GetDocument();
-// #i67990# don't use pLastPattern in EnterHandler
-const ScPatternAttr* pPattern = rDoc.GetPattern( aCursorPos.Col(), 
aCursorPos.Row(), aCursorPos.Tab() );
-if (pPattern)
+SvNumberFormatter* pFormatter = rDoc.GetFormatTable();
+// without conditional format, as in ScColumn::SetString
+sal_uInt32 nFormat = pPattern->GetNumberFormat( pFormatter );
+double nVal;
+if ( pFormatter->IsNumberFormat( aString, nFormat, nVal ) )
 {
-SvNumberFormatter* pFormatter = rDoc.GetFormatTable();
-// without conditional format, as in ScColumn::SetString
-sal_uInt32 nFormat = pPattern->GetNumberFormat( pFormatter );
-double nVal;
-if ( pFormatter->IsNumberFormat( aString, nFormat, nVal ) )
-{
-bSpellErrors = false;   // ignore the spelling errors
-}
+bSpellErrors = false;   // ignore the spelling errors
 }
 }
 }
@@ -3235,7 +3234,7 @@ void ScInputHandler::EnterHandler( ScEnterMode 
nBlockMode, bool bBeforeSavingInL
 const SfxPoolItem* pItem = nullptr;
 
 // Find common (cell) attributes before RemoveAdjust
-if ( pActiveViewSh && bUniformAttribs )
+if ( bUniformAttribs )
 {
 std::optional pCommonAttrs;
 for (sal_uInt16 nId = EE_CHAR_START; nId <= 

[Libreoffice-commits] core.git: sc/source

2023-10-18 Thread Xisco Fauli (via logerrit)
 sc/source/ui/app/inputhdl.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 51678d9cf57085bac3c7eba998e0a6d364d36cb2
Author: Xisco Fauli 
AuthorDate: Wed Oct 18 17:28:37 2023 +0200
Commit: Noel Grandin 
CommitDate: Wed Oct 18 20:08:47 2023 +0200

fix crash in ScInputHandler::ImplCreateEditEngine()

See 
https://crashreport.libreoffice.org/stats/crash_details/1b2c45b0-6053-4628-94cc-f639899ceb39

Regression from 5484657d2b1677b7e385ab6ef87ad64dcb9934e4
"tdf#156209 Font size increases when copying from cell in edit mode"

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

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index b4d56988ca0f..de6a7f47a8bc 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -3080,7 +3080,8 @@ void ScInputHandler::EnterHandler( ScEnterMode 
nBlockMode, bool bBeforeSavingInL
 bInOwnChange = true; // disable ModifyHdl (reset below)
 mbPartialPrefix = false;
 
-ImplCreateEditEngine();
+if (pActiveViewSh)
+ImplCreateEditEngine();
 
 bool bMatrix = ( nBlockMode == ScEnterMode::MATRIX );
 


[Libreoffice-commits] core.git: sc/source

2023-10-18 Thread Noel Grandin (via logerrit)
 sc/source/ui/inc/output.hxx   |9 +-
 sc/source/ui/view/output.cxx  |4 +
 sc/source/ui/view/output2.cxx |  148 --
 3 files changed, 94 insertions(+), 67 deletions(-)

New commits:
commit c546b33dde8760cdc8d9990e672cc8cb344e470e
Author: Noel Grandin 
AuthorDate: Fri Oct 13 09:49:57 2023 +0200
Commit: Noel Grandin 
CommitDate: Wed Oct 18 18:52:08 2023 +0200

cool#6893 cache the EditEngine for rendering

to avoid re-allocating one constantly

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

diff --git a/sc/source/ui/inc/output.hxx b/sc/source/ui/inc/output.hxx
index 1a445f9e14e4..e4763767b7f5 100644
--- a/sc/source/ui/inc/output.hxx
+++ b/sc/source/ui/inc/output.hxx
@@ -240,6 +240,7 @@ private:
 // #i74769# use SdrPaintWindow direct, remember it during 
BeginDrawLayers/EndDrawLayers
 SdrPaintWindow* mpTargetPaintWindow;
 const sc::SpellCheckContext* mpSpellCheckCxt;
+std::unique_ptr mxOutputEditEngine;
 
 // private methods
 
@@ -278,7 +279,7 @@ private:
 void DrawEditStacked(DrawEditParam& rParam);
 void DrawEditAsianVertical(DrawEditParam& rParam);
 
-std::unique_ptr CreateOutputEditEngine();
+void InitOutputEditEngine();
 
 void SetClipMarks( OutputAreaParam , ScCellInfo* pClipMarkCell,
SvxCellHorJustify eOutHorJust, tools::Long nLayoutSign 
);
@@ -318,14 +319,14 @@ public:
 voidSetSpellCheckContext( const sc::SpellCheckContext* pCxt );
 voidSetContentDevice( OutputDevice* pContentDev );
 
-voidSetRefDevice( OutputDevice* pRDev ) { mpRefDevice = pFmtDevice = 
pRDev; }
-voidSetFmtDevice( OutputDevice* pRDev ) { pFmtDevice = pRDev; }
+voidSetRefDevice( OutputDevice* pRDev );
+voidSetFmtDevice( OutputDevice* pRDev );
 voidSetViewShell( ScTabViewShell* pSh ) { pViewShell = pSh; }
 
 voidSetDrawView( FmFormView* pNew ) { pDrawView = pNew; }
 
 voidSetSolidBackground( bool bSet ) { bSolidBackground = bSet; }
-voidSetUseStyleColor( bool bSet )   { mbUseStyleColor = bSet; }
+voidSetUseStyleColor( bool bSet );
 
 voidSetEditCell( SCCOL nCol, SCROW nRow );
 voidSetSyntaxMode( bool bNewMode );
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index f3b4b3ca9be2..8461c446 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -61,6 +61,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -212,6 +213,7 @@ ScOutputData::ScOutputData( OutputDevice* pNewDev, 
ScOutputType eNewType,
 
 // always needed, so call at the end of the constructor
 SetCellRotations();
+InitOutputEditEngine();
 }
 
 ScOutputData::~ScOutputData()
@@ -262,6 +264,8 @@ void ScOutputData::SetShowFormulas( bool bSet )
 void ScOutputData::SetShowSpellErrors( bool bSet )
 {
 bShowSpellErrors = bSet;
+// reset EditEngine because it depends on bShowSpellErrors
+mxOutputEditEngine.reset();
 }
 
 void ScOutputData::SetSnapPixel()
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 6dbd218caf61..c80c6483bc5e 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -2177,27 +2177,56 @@ void ScOutputData::LayoutStrings(bool bPixelToLogic)
 ScProgress::DeleteInterpretProgress();
 }
 
-std::unique_ptr ScOutputData::CreateOutputEditEngine()
+void ScOutputData::SetRefDevice( OutputDevice* pRDev )
 {
-std::unique_ptr pEngine(new ScFieldEditEngine(mpDoc, 
mpDoc->GetEnginePool()));
-pEngine->SetUpdateLayout( false );
-pEngine->EnableUndo( false ); // don't 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();
-if ( bShowSpellErrors )
-nCtrl |= EEControlBits::ONLINESPELLING;
-if ( eType == OUTTYPE_PRINTER )
-nCtrl &= ~EEControlBits::MARKFIELDS;
+mpRefDevice = pFmtDevice = pRDev;
+// reset EditEngine because it depends on pFmtDevice and mpRefDevice
+mxOutputEditEngine.reset();
+}
+
+void ScOutputData::SetFmtDevice( OutputDevice* pRDev )
+{
+pFmtDevice = pRDev;
+// reset EditEngine because it depends on pFmtDevice
+mxOutputEditEngine.reset();
+}
+
+void ScOutputData::SetUseStyleColor( bool bSet )
+{
+mbUseStyleColor = bSet;
+// reset EditEngine because it depends on mbUseStyleColor
+mxOutputEditEngine.reset();
+}
+
+void ScOutputData::InitOutputEditEngine()
+{
+if (!mxOutputEditEngine)
+{
+mxOutputEditEngine = std::make_unique(mpDoc, 
mpDoc->GetEnginePool());
+mxOutputEditEngine->SetUpdateLayout( false );
+mxOutputEditEngine->EnableUndo( false ); 

[Libreoffice-commits] core.git: sc/source

2023-10-16 Thread Eike Rathke (via logerrit)
 sc/source/core/tool/interpr4.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 3161a6c351a2f5f70c0420ee8cccf2eb23de1ecf
Author: Eike Rathke 
AuthorDate: Mon Oct 16 20:35:13 2023 +0200
Commit: Eike Rathke 
CommitDate: Mon Oct 16 23:35:02 2023 +0200

Resolves: tdf#157797 Let GetCellValue() propagate previous error, if any

Change-Id: I27ee8d19e4f45bef81e133c82ac17b825790208f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158064
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 0ac2e151f5cc..95dff9f1cc18 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -181,7 +181,9 @@ double ScInterpreter::GetCellValue( const ScAddress& rPos, 
ScRefCellValue& rCell
 FormulaError nErr = nGlobalError;
 nGlobalError = FormulaError::NONE;
 double nVal = GetCellValueOrZero(rPos, rCell);
-if ( nGlobalError == FormulaError::NONE || nGlobalError == 
FormulaError::CellNoValue )
+// Propagate previous error, if any; nGlobalError==CellNoValue is not an
+// error here, preserve previous error or non-error.
+if (nErr != FormulaError::NONE || nGlobalError == 
FormulaError::CellNoValue)
 nGlobalError = nErr;
 return nVal;
 }


[Libreoffice-commits] core.git: sc/source sd/source sw/source

2023-10-16 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 e99936639379acfe7949b6b77d3b401990f50dde
Author: Paris Oplopoios 
AuthorDate: Thu Jul 20 19:49:10 2023 +0300
Commit: Caolán McNamara 
CommitDate: Mon Oct 16 20:12:39 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 
(cherry picked from commit 6c6bb1d434d5c0be2f71470483f3ce56f5210e01)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154709
Tested-by: Jenkins
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index d82c7e15c11c..c5fe69007fcc 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -1802,6 +1802,12 @@ ScTabViewShell::ScTabViewShell( SfxViewFrame& rViewFrame,
 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 2868c38d6c90..9bc5c0030f76 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 85138778bf65..3bad54a839b8 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 
@@ -1113,6 +1115,12 @@ SwView::SwView(SfxViewFrame& _rFrame, SfxViewShell* 
pOldSh)
 m_aBringToAttentionBlinkTimer.SetInvokeHandler(
 LINK(this, SwView, BringToAttentionBlinkTimerHdl));
 m_aBringToAttentionBlinkTimer.SetTimeout(350);
+
+if (comphelper::LibreOfficeKit::isActive())
+{
+SwXTextDocument* pModel = 
comphelper::getFromUnoTunnel(GetCurrentDocument());
+SfxLokHelper::notifyViewRenderState(this, pModel);
+}
 }
 
 SwViewGlueDocShell::SwViewGlueDocShell(SwView& rView, SwDocShell& rDocSh)


[Libreoffice-commits] core.git: sc/source

2023-10-16 Thread Eike Rathke (via logerrit)
 sc/source/core/inc/interpre.hxx  |2 ++
 sc/source/core/tool/interpr2.cxx |   24 
 sc/source/core/tool/interpr4.cxx |   17 +
 3 files changed, 31 insertions(+), 12 deletions(-)

New commits:
commit 2fa1cdcaeff7d1583aedfcee5b7c802e951b3a86
Author: Eike Rathke 
AuthorDate: Mon Oct 16 13:51:28 2023 +0200
Commit: Eike Rathke 
CommitDate: Mon Oct 16 16:31:32 2023 +0200

Resolves: tdf#157786 Use GetFloor32() for date days instead of GetInt32()

Change-Id: I1d6242b516f4b23473151bb99cbdf1a057a15746
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158029
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index 5897a6b6c757..64b9a8ae5b2c 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -427,6 +427,8 @@ private:
 sal_Int32 GetInt32();
 /** if GetDoubleWithDefault() not within int32 limits sets nGlobalError 
and returns SAL_MAX_INT32 */
 sal_Int32 GetInt32WithDefault( sal_Int32 nDefault );
+/** if GetDouble() not within int32 limits sets nGlobalError and returns 
SAL_MAX_INT32 */
+sal_Int32 GetFloor32();
 /** if GetDouble() not within int16 limits sets nGlobalError and returns 
SAL_MAX_INT16 */
 sal_Int16 GetInt16();
 /** if GetDouble() not within uint32 limits sets nGlobalError and returns 
SAL_MAX_UINT32 */
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index a6753a4aa78b..8255fe7f76c1 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -122,21 +122,21 @@ void ScInterpreter::ScGetActTime()
 void ScInterpreter::ScGetYear()
 {
 Date aDate = pFormatter->GetNullDate();
-aDate.AddDays( GetInt32());
+aDate.AddDays( GetFloor32());
 PushDouble( static_cast(aDate.GetYear()) );
 }
 
 void ScInterpreter::ScGetMonth()
 {
 Date aDate = pFormatter->GetNullDate();
-aDate.AddDays( GetInt32());
+aDate.AddDays( GetFloor32());
 PushDouble( static_cast(aDate.GetMonth()) );
 }
 
 void ScInterpreter::ScGetDay()
 {
 Date aDate = pFormatter->GetNullDate();
-aDate.AddDays( GetInt32());
+aDate.AddDays( GetFloor32());
 PushDouble(static_cast(aDate.GetDay()));
 }
 
@@ -200,7 +200,7 @@ void ScInterpreter::ScGetDayOfWeek()
 nFlag = 1;
 
 Date aDate = pFormatter->GetNullDate();
-aDate.AddDays( GetInt32());
+aDate.AddDays( GetFloor32());
 int nVal = static_cast(aDate.GetDayOfWeek());  // MONDAY = 0
 switch (nFlag)
 {
@@ -241,7 +241,7 @@ void ScInterpreter::ScWeeknumOOo()
 sal_Int16 nFlag = GetInt16();
 
 Date aDate = pFormatter->GetNullDate();
-aDate.AddDays( GetInt32());
+aDate.AddDays( GetFloor32());
 PushInt( static_cast(aDate.GetWeekOfYear( nFlag == 1 ? SUNDAY : 
MONDAY )));
 }
 }
@@ -255,7 +255,7 @@ void ScInterpreter::ScGetWeekOfYear()
 sal_Int16 nFlag = ( nParamCount == 1 ) ? 1 : GetInt16();
 
 Date aDate = pFormatter->GetNullDate();
-aDate.AddDays( GetInt32());
+aDate.AddDays( GetFloor32());
 
 sal_Int32 nMinimumNumberOfDaysInWeek;
 DayOfWeek eFirstDayOfWeek;
@@ -297,7 +297,7 @@ void ScInterpreter::ScGetIsoWeekOfYear()
 if ( MustHaveParamCount( GetByte(), 1 ) )
 {
 Date aDate = pFormatter->GetNullDate();
-aDate.AddDays( GetInt32());
+aDate.AddDays( GetFloor32());
 PushInt( static_cast(aDate.GetWeekOfYear()) );
 }
 }
@@ -572,7 +572,7 @@ void ScInterpreter::ScWorkday_MS()
 PushError( nErr );
 else
 {
-sal_Int32 nDays = GetInt32();
+sal_Int32 nDays = GetFloor32();
 sal_uInt32 nDate = GetUInt32();
 if (nGlobalError != FormulaError::NONE || (nDate > SAL_MAX_UINT32 - 
nNullDate))
 {
@@ -702,8 +702,8 @@ void ScInterpreter::ScGetDiffDate360()
 return;
 
 bool bFlag = nParamCount == 3 && GetBool();
-sal_Int32 nDate2 = GetInt32();
-sal_Int32 nDate1 = GetInt32();
+sal_Int32 nDate2 = GetFloor32();
+sal_Int32 nDate1 = GetFloor32();
 if (nGlobalError != FormulaError::NONE)
 PushError( nGlobalError);
 else
@@ -767,8 +767,8 @@ void ScInterpreter::ScGetDateDif()
 return;
 
 OUString aInterval = GetString().getString();
-sal_Int32 nDate2 = GetInt32();
-sal_Int32 nDate1 = GetInt32();
+sal_Int32 nDate2 = GetFloor32();
+sal_Int32 nDate1 = GetFloor32();
 
 if (nGlobalError != FormulaError::NONE)
 {
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index c40c111f226e..0ac2e151f5cc 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -2227,6 +2227,23 @@ sal_Int32 ScInterpreter::GetInt32WithDefault( sal_Int32 
nDefault )
 return double_to_int32(fVal);
 }
 
+sal_Int32 ScInterpreter::GetFloor32()
+{
+double fVal = GetDouble();
+if (!std::isfinite(fVal))
+{
+SetError( 

[Libreoffice-commits] core.git: sc/source

2023-10-14 Thread Andrea Gelmini (via logerrit)
 sc/source/ui/view/output2.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9f9335ed67fcbb1192140e2761df7404620156c9
Author: Andrea Gelmini 
AuthorDate: Sat Oct 14 12:26:02 2023 +0200
Commit: Julien Nabet 
CommitDate: Sat Oct 14 16:30:06 2023 +0200

Fix typo

Change-Id: I1554a3fbdf563a6fb9710ade03eccd162ae86643
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157976
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 0cb886a87dc6..916748b0ceab 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -2186,7 +2186,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
+pEngine->EnableUndo( false ); // don't 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: sc/source

2023-10-13 Thread Matt K (via logerrit)
 sc/source/ui/app/inputwin.cxx |   37 +++--
 1 file changed, 3 insertions(+), 34 deletions(-)

New commits:
commit b0496a314b1acee28e22c1029b696cbbc1983853
Author: Matt K 
AuthorDate: Thu Jul 13 18:12:16 2023 -0500
Commit: Mike Kaganski 
CommitDate: Fri Oct 13 15:30:38 2023 +0200

tdf#150262 Split Autosum button: refactor to deduplicate

This change refactors the recent checkin that split the
autosum button into a default clickable button.  We just
use the existing function "AutoSum" in place of the copied
code.

Change-Id: I9a0e6fce047165c927746f0f87df4de905d2f8ee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155058
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 2bb29146da07..ed3fe521d94b 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -368,40 +368,9 @@ void ScInputWindow::Select()
 }
 else if (curItemId == SID_INPUT_SUM)
 {
-ScTabViewShell* pViewSh = 
dynamic_cast(SfxViewShell::Current());
-if (pViewSh)
-{
-bool bSubTotal = false;
-bool bRangeFinder = false;
-const OUString aFormula = pViewSh->DoAutoSum(bRangeFinder, 
bSubTotal, ocSum);
-if (!aFormula.isEmpty())
-{
-SetFuncString(aFormula);
-if (bRangeFinder && pScMod->IsEditMode())
-{
-ScInputHandler* pHdl = pScMod->GetInputHdl(pViewSh);
-if (pHdl)
-{
-pHdl->InitRangeFinder(aFormula);
-
-//! SetSelection at the InputHandler?
-//! Set bSelIsRef?
-const sal_Int32 nOpen = aFormula.indexOf('(');
-const sal_Int32 nLen = aFormula.getLength();
-if (nOpen != -1 && nLen > nOpen)
-{
-ESelection aSel(0, nOpen + (bSubTotal ? 3 : 1), 0, 
nLen - 1);
-EditView* pTableView = pHdl->GetTableView();
-if (pTableView)
-pTableView->SetSelection(aSel);
-EditView* pTopView = pHdl->GetTopView();
-if (pTopView)
-pTopView->SetSelection(aSel);
-}
-}
-}
-}
-}
+bool bRangeFinder = false;
+bool bSubTotal = false;
+AutoSum(bRangeFinder, bSubTotal, ocSum);
 }
 else if (curItemId == SID_INPUT_EQUAL)
 {


[Libreoffice-commits] core.git: sc/source

2023-10-13 Thread Henry Castro (via logerrit)
 sc/source/ui/view/output2.cxx |   14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

New commits:
commit f96819f1358fb55b6e19ddc864f0376693e9feba
Author: Henry Castro 
AuthorDate: Wed Oct 11 08:59:59 2023 -0400
Commit: Caolán McNamara 
CommitDate: Fri Oct 13 11:27:59 2023 +0200

sc: ui: fix cell bidi layout strings

The default constructor OutputDevice can set the
layout text to "vcl::text::ComplexTextLayoutFlags::BiDiRtl"
for all strings if the UI locale is a RTL locale, however
each cell string can be mixed LTR and RTL.

Set the defaults to auto detect the correct text layout mode.

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

diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 20956ccad844..0cb886a87dc6 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -1482,14 +1482,22 @@ void ScOutputData::LayoutStrings(bool bPixelToLogic)
 {
 bool bOrigIsInLayoutStrings = mpDoc->IsInLayoutStrings();
 mpDoc->SetLayoutStrings(true);
-comphelper::ScopeGuard g([this, bOrigIsInLayoutStrings] {
-mpDoc->SetLayoutStrings(bOrigIsInLayoutStrings);
-});
 
 OSL_ENSURE( mpDev == mpRefDevice ||
 mpDev->GetMapMode().GetMapUnit() == 
mpRefDevice->GetMapMode().GetMapUnit(),
 "LayoutStrings: different MapUnits ?!?!" );
 
+vcl::text::ComplexTextLayoutFlags eTextLayout = mpDev->GetLayoutMode();
+comphelper::ScopeGuard g([this, bOrigIsInLayoutStrings, eTextLayout] {
+mpDoc->SetLayoutStrings(bOrigIsInLayoutStrings);
+
+if (mpDev->GetLayoutMode() != eTextLayout)
+mpDev->SetLayoutMode(eTextLayout);
+});
+
+if (mpDev->GetLayoutMode() != vcl::text::ComplexTextLayoutFlags::Default)
+mpDev->SetLayoutMode(vcl::text::ComplexTextLayoutFlags::Default);
+
 sc::IdleSwitch aIdleSwitch(*mpDoc, false);
 
 // Try to limit interpreting to only visible cells. Calling e.g. IsValue()


[Libreoffice-commits] core.git: 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 c4381b39b40929cd6a30c15161faf79a346f1ed9
Author: Noel Grandin 
AuthorDate: Fri Oct 13 08:18:46 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Oct 13 11:20:57 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/+/157900
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 00922a0f8e59..20956ccad844 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -2178,6 +2178,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: sc/source

2023-10-11 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 2709d6bcf248a072abdc6e219466727f52dc159b
Author: Henry Castro 
AuthorDate: Wed Aug 2 16:54:12 2023 -0400
Commit: Caolán McNamara 
CommitDate: Wed Oct 11 09:29:46 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 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155352
(cherry picked from commit 5279aff5588941e1e131a703059e8148713d24ef)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157726
Tested-by: Jenkins

diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index deb3264c7759..8334e5fd0d51 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -510,6 +510,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 56a7cc00f436..7ae933b1cf65 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -400,7 +400,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)
@@ -2045,6 +2047,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
@@ -2695,6 +2699,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);
+}
+}
+
+m_nDownPosX = m_nDownPosY = -1;
+
 return;
 }
 


[Libreoffice-commits] core.git: sc/source

2023-10-10 Thread Caolán McNamara (via logerrit)
 sc/source/ui/view/formatsh.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6cfd36a392ec3710304ff3df3cb0f42e0d8b53d9
Author: Caolán McNamara 
AuthorDate: Tue Oct 10 16:29:16 2023 +0100
Commit: Caolán McNamara 
CommitDate: Tue Oct 10 21:44:09 2023 +0200

tdf#154142 null-deref in SfxUndoManager::SetMaxUndoActionCount

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

diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 0eea4d0f6bdf..028fdc77b3b0 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -135,7 +135,7 @@ ScFormatShell::ScFormatShell(ScViewData& rData) :
 SetPool( >GetPool() );
 SfxUndoManager* pMgr = rViewData.GetSfxDocShell()->GetUndoManager();
 SetUndoManager( pMgr );
-if ( !rViewData.GetDocument().IsUndoEnabled() )
+if (pMgr && !rViewData.GetDocument().IsUndoEnabled())
 {
 pMgr->SetMaxUndoActionCount( 0 );
 }


[Libreoffice-commits] core.git: sc/source

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

New commits:
commit 7d7a34635cd4d7e5d9c3ae123d5adfa071e85da0
Author: Noel Grandin 
AuthorDate: Fri Oct 6 20:54:19 2023 +0200
Commit: Noel Grandin 
CommitDate: Sat Oct 7 09:41:43 2023 +0200

fix ScTabViewShell::HasAccessibilityObjects

been this way since it was introduced in
commit 5cd1b592821d6870376f44aedfb527db07fd07d0
Author: Sascha Ballach 
Date:   Thu Feb 14 15:54:20 2002 +
#95584#; call Broadcaster for Accessibility objects

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

diff --git a/sc/source/ui/view/tabvwshh.cxx b/sc/source/ui/view/tabvwshh.cxx
index ce38719bde67..d1263590a895 100644
--- a/sc/source/ui/view/tabvwshh.cxx
+++ b/sc/source/ui/view/tabvwshh.cxx
@@ -241,7 +241,7 @@ void ScTabViewShell::BroadcastAccessibility( const SfxHint 
 )
 
 bool ScTabViewShell::HasAccessibilityObjects() const
 {
-return pAccessibilityBroadcaster != nullptr;
+return pAccessibilityBroadcaster && 
pAccessibilityBroadcaster->HasListeners();
 }
 
 bool ScTabViewShell::ExecuteRetypePassDlg(ScPasswordHash eDesiredHash)


[Libreoffice-commits] core.git: sc/source

2023-10-07 Thread Andreas Heinisch (via logerrit)
 sc/source/ui/attrdlg/attrdlg.cxx |9 -
 1 file changed, 9 deletions(-)

New commits:
commit f1f2a3faeaddf9e9a59f44bf9de38a1f0aa97104
Author: Andreas Heinisch 
AuthorDate: Fri Oct 6 20:52:15 2023 +0200
Commit: Andreas Heinisch 
CommitDate: Sat Oct 7 08:49:32 2023 +0200

Revert "tdf#149598 - Remember window state of the format cell dialog"

This reverts commit c1893df42567c260ca5fb069038d1a55616e7b7f.

Reason for revert: causes a regression under Linux (Bug 156710)
https://bugs.documentfoundation.org/show_bug.cgi?id=156710

Change-Id: I72a570ecba4cf7fe594a0bb50a121ab2e99cc613
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157624
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/sc/source/ui/attrdlg/attrdlg.cxx b/sc/source/ui/attrdlg/attrdlg.cxx
index 7bd79468d27d..faa08bf3ca00 100644
--- a/sc/source/ui/attrdlg/attrdlg.cxx
+++ b/sc/source/ui/attrdlg/attrdlg.cxx
@@ -31,17 +31,11 @@
 #include 
 #include 
 #include 
-#include 
 
 ScAttrDlg::ScAttrDlg(weld::Window* pParent, const SfxItemSet* pCellAttrs)
 : SfxTabDialogController(pParent, "modules/scalc/ui/formatcellsdialog.ui",
  "FormatCellsDialog", pCellAttrs)
 {
-// tdf#149598 - restore window state of the dialog
-SvtViewOptions aDlgOpt(EViewType::Dialog, "FormatCellDialog");
-if (aDlgOpt.Exists())
-m_xDialog->set_window_state(aDlgOpt.GetWindowState());
-
 SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
 
 OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT ), 
"GetTabPageCreatorFunc fail!");
@@ -73,9 +67,6 @@ ScAttrDlg::ScAttrDlg(weld::Window* pParent, const SfxItemSet* 
pCellAttrs)
 
 ScAttrDlg::~ScAttrDlg()
 {
-// tdf#149598 - remember window state of the dialog
-SvtViewOptions aDlgOpt(EViewType::Dialog, "FormatCellDialog");
-
aDlgOpt.SetWindowState(m_xDialog->get_window_state(vcl::WindowDataMask::PosSize));
 }
 
 void ScAttrDlg::PageCreated(const OUString& rPageId, SfxTabPage& rTabPage)


[Libreoffice-commits] core.git: sc/source

2023-10-06 Thread Caolán McNamara (via logerrit)
 sc/source/ui/inc/content.hxx|3 ---
 sc/source/ui/navipi/content.cxx |   12 +---
 sc/source/ui/navipi/navipi.cxx  |   10 --
 3 files changed, 1 insertion(+), 24 deletions(-)

New commits:
commit d34c975c849db6c99d3b1f0155cce34234468fc1
Author: Caolán McNamara 
AuthorDate: Fri Oct 6 15:39:37 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Oct 6 21:32:15 2023 +0200

aHiddenTitle is always an empty string

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

diff --git a/sc/source/ui/inc/content.hxx b/sc/source/ui/inc/content.hxx
index 9f7f6aada3b8..5a14cb48b4a4 100644
--- a/sc/source/ui/inc/content.hxx
+++ b/sc/source/ui/inc/content.hxx
@@ -51,7 +51,6 @@ class ScContentTree
 OUStringaManualDoc; // Switched in Navigator 
(Title)
 boolbHiddenDoc; // Hidden active?
 OUStringaHiddenName;// URL to load
-OUStringaHiddenTitle;   // for display
 ScDocument* pHiddenDocument;// temporary
 boolbIsInNavigatorDlg;
 boolm_bFreeze;
@@ -149,8 +148,6 @@ public:
 voidSelectDoc(const OUString& rName);
 voidSelectEntryByName(const ScContentId nRoot, std::u16string_view 
rName);
 
-const OUString& GetHiddenTitle() const{ return aHiddenTitle; }
-
 /** Applies the navigator settings to the listbox. */
 void ApplyNavigatorSettings();
 /** Stores the current listbox state in the navigator settings. */
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index 96bd64a75924..1af85b31d051 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -586,16 +586,6 @@ IMPL_LINK(ScContentTree, CommandHdl, const CommandEvent&, 
rCEvt, bool)
 xDocMenu->append_radio(sId, pParentWindow->aStrActiveWin);
 if (!bHiddenDoc && aManualDoc.isEmpty())
 sActive = sId;
-//  hidden document
-if ( !aHiddenTitle.isEmpty() )
-{
-OUString aEntry = aHiddenTitle + pParentWindow->aStrHidden;
-++i;
-sId = "document" + OUString::number(i);
-xDocMenu->append_radio(sId, aEntry);
-if (bHiddenDoc)
-sActive = sId;
-}
 xDocMenu->set_active(sActive, true);
 
 OUString sIdent = xPop->popup_at_rect(m_xTreeView.get(), 
tools::Rectangle(rCEvt.GetMousePosPixel(), Size(1, 1)));
@@ -1408,7 +1398,7 @@ bool ScContentTree::ActiveDocChanged()
 
 OUString aCurrent;
 if ( bHiddenDoc )
-aCurrent = aHiddenTitle;
+aCurrent = OUString();
 else
 {
 ScDocShell* pSh = GetManualOrCurrent();
diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index 940a8f4e4f8f..ad5e149e9028 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -884,16 +884,6 @@ void ScNavigatorDlg::GetDocNames( const OUString* 
pManualSel )
 
 m_xLbDocuments->append_text(aStrActiveWin);
 
-OUString aHidden =  m_xLbEntries->GetHiddenTitle();
-if (!aHidden.isEmpty())
-{
-OUString aEntry = aHidden + aStrHidden;
-m_xLbDocuments->append_text(aEntry);
-
-if ( pManualSel && aHidden == *pManualSel )
-aSelEntry = aEntry;
-}
-
 m_xLbDocuments->thaw();
 
 m_xLbDocuments->set_active_text(aSelEntry);


[Libreoffice-commits] core.git: sc/source

2023-10-06 Thread Caolán McNamara (via logerrit)
 sc/source/ui/inc/content.hxx|1 -
 sc/source/ui/navipi/content.cxx |   32 
 2 files changed, 33 deletions(-)

New commits:
commit d8fa0ca2a3befeb961f8555321af6f6cbf14c03d
Author: Caolán McNamara 
AuthorDate: Fri Oct 6 15:36:30 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Oct 6 18:23:35 2023 +0200

ScContentTree::LoadFile can't be called

ScContentTree::LoadFile is only called if !aHiddenTitle.isEmpty()
but the only thing that set aHiddenTitle is ScContentTree::LoadFile

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

diff --git a/sc/source/ui/inc/content.hxx b/sc/source/ui/inc/content.hxx
index 9cd7e977319d..9f7f6aada3b8 100644
--- a/sc/source/ui/inc/content.hxx
+++ b/sc/source/ui/inc/content.hxx
@@ -146,7 +146,6 @@ public:
 boolActiveDocChanged();
 voidResetManualDoc();
 voidSetManualDoc(const OUString& rName);
-voidLoadFile(const OUString& rUrl);
 voidSelectDoc(const OUString& rName);
 voidSelectEntryByName(const ScContentId nRoot, std::u16string_view 
rName);
 
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index dfdcc29ffcc1..96bd64a75924 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -1346,33 +1346,6 @@ IMPL_LINK(ScContentTree, DragBeginHdl, bool&, 
rUnsetDragIcon, bool)
 return bDisallow;
 }
 
-void ScContentTree::LoadFile( const OUString& rUrl )
-{
-OUString aDocName = rUrl;
-sal_Int32 nPos = aDocName.indexOf('#');
-if ( nPos != -1 )
-aDocName = aDocName.copy(0, nPos);   // only the name without 
#...
-
-OUString aURL = aDocName;
-OUString aFilter, aOptions;
-ScDocumentLoader aLoader( aURL, aFilter, aOptions );
-if ( aLoader.IsError() )
-return;
-
-bHiddenDoc = true;
-aHiddenName = aDocName;
-aHiddenTitle = aLoader.GetTitle();
-pHiddenDocument = aLoader.GetDocument();
-
-Refresh();  // get content from loaded document
-
-pHiddenDocument = nullptr;
-
-pParentWindow->GetDocNames(  );// fill list
-
-//  document is closed again by ScDocumentLoader in dtor
-}
-
 void ScContentTree::SetRootType( ScContentId nNew )
 {
 if ( nNew != nRootType )
@@ -1505,11 +1478,6 @@ void ScContentTree::SelectDoc(const OUString& rName) 
 // rName like shown in
 bHiddenDoc = false;
 SetManualDoc(aRealName);
 }
-else if (!aHiddenTitle.isEmpty())// hidden selected
-{
-if (!bHiddenDoc)
-LoadFile(aHiddenName);
-}
 else
 {
 OSL_FAIL("SelectDoc: not found");


[Libreoffice-commits] core.git: 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 67c0bf2f73132406ff7dc63505c9869a2af697e0
Author: Caolán McNamara 
AuthorDate: Fri Oct 6 13:01:12 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Oct 6 15:50:53 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/+/157639
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index 1c83bd703623..940a8f4e4f8f 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: 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 71dd1f40482cafda40756dd6de4ecaf66b542909
Author: Caolán McNamara 
AuthorDate: Thu Oct 5 14:27:45 2023 +0100
Commit: Caolán McNamara 
CommitDate: Thu Oct 5 17:01:47 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/+/157595
Tested-by: Jenkins
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: sc/source

2023-09-30 Thread Justin Luth (via logerrit)
 sc/source/ui/view/gridwin.cxx |   15 ++-
 1 file changed, 14 insertions(+), 1 deletion(-)

New commits:
commit 4cf4516bac88fb8f58743e6ae68eab0393059d7f
Author: Justin Luth 
AuthorDate: Sat Sep 30 07:02:08 2023 -0400
Commit: Justin Luth 
CommitDate: Sat Sep 30 16:24:32 2023 +0200

tdf#157038 sc: avoid spell-check dialog from outside selection

Fixes 7.4 regression from cf18038c66075f7a18d89e47f3a2ab1a5bf7c4fd

To avoid the HIGHLY LIKELY risk of losing the selection
because of the LOW POTENTIAL of the right click
being over a misspelling (that overflowed from outside the selection),
simply don't even attempt to spell-check in that case.

The opposite was already true (and is even worse).
If the misspelling originates in the selected cells,
but has overflowed into an unselected area,
right clicking on the misspelling is deliberately ignored
by SelectForContextMenu().

Change-Id: I7dfc5b190036f1705d848cb621e527cbff37e425
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157430
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index c214f2ec2d1e..56a7cc00f436 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -3314,9 +3314,22 @@ void ScGridWindow::Command( const CommandEvent& rCEvt )
 if (aPos.Col() >= 0 && (aSpellCheckCell.getType() == 
CELLTYPE_STRING || aSpellCheckCell.getType() == CELLTYPE_EDIT))
 nColSpellError = aPos.Col();
 
-// Is there a misspelled word somewhere in the cell?
+// Is there possibly a misspelled word somewhere in the cell?
 // A "yes" does not mean that the word under the mouse pointer is 
wrong though.
 bSpellError = (mpSpellCheckCxt->isMisspelled(nColSpellError, 
nCellY));
+// Avoid situations where selecting the cell-with-wrong-spelling 
would be bad
+if (bSpellError)
+{
+// When the mouse is over an empty cell, text with spelling 
errors
+// potentially could have overflowed underneath the mouse 
pointer
+if (nColSpellError != nCellX)
+{
+// If the mouse is over a selected cell, only consider 
spell-checking
+// if the cell with the misspelling is also selected. 
tdf#157038
+if (mrViewData.GetMarkData().IsCellMarked(nCellX, nCellY))
+bSpellError = 
mrViewData.GetMarkData().IsCellMarked(nColSpellError, nCellY);
+}
+}
 }
 
 //  #i18735# First select the item under the mouse pointer.


[Libreoffice-commits] core.git: sc/source

2023-09-28 Thread Caolán McNamara (via logerrit)
 sc/source/core/data/dpsave.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit a3bd64c4a1fceb20fe5d72da142a46a72b8ae5dc
Author: Caolán McNamara 
AuthorDate: Thu Sep 28 09:28:21 2023 +0100
Commit: Caolán McNamara 
CommitDate: Thu Sep 28 14:06:11 2023 +0200

cid#1545264 COPY_INSTEAD_OF_MOVE

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

diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx
index 78067c042acd..74f9131caf16 100644
--- a/sc/source/core/data/dpsave.cxx
+++ b/sc/source/core/data/dpsave.cxx
@@ -520,8 +520,7 @@ void ScDPSaveDimension::WriteToSource( const 
uno::Reference& xD
 uno::Reference xHierSupp( xDim, 
uno::UNO_QUERY );
 if ( xHierSupp.is() )
 {
-uno::Reference xHiersName = 
xHierSupp->getHierarchies();
-xHiers = new ScNameToIndexAccess( xHiersName );
+xHiers = new ScNameToIndexAccess(xHierSupp->getHierarchies());
 nHierCount = xHiers->getCount();
 }
 


[Libreoffice-commits] core.git: 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 8705b4ccaa7b8ea28eda95307c9add2b23e0716b
Author: Caolán McNamara 
AuthorDate: Tue Sep 26 21:09:02 2023 +0100
Commit: Caolán McNamara 
CommitDate: Wed Sep 27 10:25:49 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/+/157298
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

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: sc/source

2023-09-26 Thread Michael Weghorn (via logerrit)
 sc/source/ui/Accessibility/AccessibleCell.cxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit c2d6ae1781ad4be5f9acefecce7e1504df02cf8f
Author: Michael Weghorn 
AuthorDate: Tue Sep 26 10:30:27 2023 +0200
Commit: Michael Weghorn 
CommitDate: Tue Sep 26 12:05:59 2023 +0200

tdf#157299 sc a11y: Limit amount of reported cell relations

For the cells referenced in formulae, the a11y `CONTROLLED_BY`
relation is reported.

Since formulae can reference a large amount of cells, creating
the a11y objects for each of these cells can result in Calc freezing,
e.g. for the tdf#157299 `SUMIF` example that was referencing a whole
column (containing 1048576 cells).

Prevent that by limiting the maximimum amount of cells to handle
here to 1000, and just printing a warning to the log otherwise
and ignore cell ranges having more cells.

If there's a need to increase the limit, that should be possible
within certain bounds. My test with a modified SUMIF that just
uses 999 cells wasn't causing any noticeable delay and the
relations were shown in Accerciser as expected.

From a quick look at the Orca and NVDA source code,
they currently don't seem to make use of the
`CONTROLLED_BY` relation for LibreOffice at all.

Change-Id: Ia74e0e88d9dbd7650832664b9c027262367b428e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157265
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx 
b/sc/source/ui/Accessibility/AccessibleCell.cxx
index 855bdf957546..27ac67611585 100644
--- a/sc/source/ui/Accessibility/AccessibleCell.cxx
+++ b/sc/source/ui/Accessibility/AccessibleCell.cxx
@@ -455,6 +455,15 @@ void ScAccessibleCell::AddRelation(const ScRange& rRange,
 const sal_uInt32 nCount(static_cast(rRange.aEnd.Col() -
 rRange.aStart.Col() + 1) * (rRange.aEnd.Row() -
 rRange.aStart.Row() + 1));
+
+// tdf#157299 avoid handling a large amount of cells for performance 
reasons
+if (nCount > 1000)
+{
+SAL_WARN("sc", "ScAccessibleCell::AddRelation: Not setting relations "
+   "for cell range with more than 1000 cells for 
performance reasons.");
+return;
+}
+
 uno::Sequence < uno::Reference < uno::XInterface > > aTargetSet( nCount );
 uno::Reference < uno::XInterface >* pTargetSet = aTargetSet.getArray();
 sal_uInt32 nPos(0);


[Libreoffice-commits] core.git: sc/source sc/uiconfig

2023-09-15 Thread Rafael Lima (via logerrit)
 sc/source/ui/formdlg/dwfunctr.cxx |  137 +++---
 sc/source/ui/inc/dwfunctr.hxx |8 +
 sc/source/ui/view/tabvwsh3.cxx|3 
 sc/uiconfig/scalc/ui/functionpanel.ui |   36 
 4 files changed, 166 insertions(+), 18 deletions(-)

New commits:
commit b5a8cdbd71a61c76f2b1a6ad33b0757911603184
Author: Rafael Lima 
AuthorDate: Tue Jul 25 22:42:49 2023 +0200
Commit: Rafael Lima 
CommitDate: Fri Sep 15 13:25:49 2023 +0200

tdf#122718 Add search functionality to the Functions sidebar

With this patch it is possible to search the list of functions in the 
Functions sidebar.

To use this feature:
1) In Calc, go to View - Function List
2) The Functions sidebar will open with the "Search" entry focused
3) You can now type your search
4) With the "Search" entry focused, it is possible to use the arrow keys 
(up/down) to select the function to insert
5) Press "Enter" to insert the function

The Escape key will clear the search box and F1 will open the help page of 
the selected function.

Change-Id: I1af6c1c2489ff736c44e1b3750bea21c05786602
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154917
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins
Reviewed-by: Rafael Lima 

diff --git a/sc/source/ui/formdlg/dwfunctr.cxx 
b/sc/source/ui/formdlg/dwfunctr.cxx
index 8fde50549be1..d158a4aada69 100644
--- a/sc/source/ui/formdlg/dwfunctr.cxx
+++ b/sc/source/ui/formdlg/dwfunctr.cxx
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -29,6 +30,8 @@
 #include 
 
 #include 
+#include 
+#include 
 
 /*
 #*  Member: ScFunctionWin
@@ -50,6 +53,7 @@ ScFunctionWin::ScFunctionWin(weld::Widget* pParent)
 , xFuncList(m_xBuilder->weld_tree_view("funclist"))
 , xInsertButton(m_xBuilder->weld_button("insert"))
 , xFiFuncDesc(m_xBuilder->weld_text_view("funcdesc"))
+, m_xSearchString(m_xBuilder->weld_entry("search"))
 , xConfigListener(new 
comphelper::ConfigurationListener("/org.openoffice.Office.Calc/Formula/Syntax"))
 , 
xConfigChange(std::make_unique(xConfigListener, 
this))
 , pFuncDesc(nullptr)
@@ -57,11 +61,15 @@ ScFunctionWin::ScFunctionWin(weld::Widget* pParent)
 InitLRUList();
 
 nArgs=0;
-m_aHelpId = xFuncList->get_help_id();
+m_aListHelpId = xFuncList->get_help_id();
+m_aSearchHelpId = m_xSearchString->get_help_id();
 
 // Description box has a height of 8 lines of text
 xFiFuncDesc->set_size_request(-1, 8 * xFiFuncDesc->get_text_height());
 
+m_xSearchString->connect_changed(LINK(this, ScFunctionWin, ModifyHdl));
+m_xSearchString->connect_key_press(LINK(this, ScFunctionWin, KeyInputHdl));
+
 xCatBox->connect_changed(LINK( this, ScFunctionWin, SelComboHdl));
 xFuncList->connect_changed(LINK( this, ScFunctionWin, SelTreeHdl));
 
@@ -100,7 +108,7 @@ ScFunctionWin::~ScFunctionWin()
 }
 
 /*
-#*  Member: UpdateFunctionList
+#*  Member: InitLRUList
 #*
 #*
 #*  Class:  ScFunctionWin
@@ -121,11 +129,11 @@ void ScFunctionWin::InitLRUList()
 sal_Int32 nSelPos  = xCatBox->get_active();
 
 if (nSelPos == 0)
-UpdateFunctionList();
+UpdateFunctionList("");
 }
 
 /*
-#*  Member: UpdateFunctionList
+#*  Member: UpdateLRUList
 #*
 #*
 #*  Class:  ScFunctionWin
@@ -183,7 +191,7 @@ void ScFunctionWin::SetDescription()
 if (!sHelpId.isEmpty())
 xFuncList->set_help_id(pDesc->getHelpId());
 else
-xFuncList->set_help_id(m_aHelpId);
+xFuncList->set_help_id(m_aListHelpId);
 }
 }
 
@@ -195,13 +203,13 @@ void ScFunctionWin::SetDescription()
 #*
 #*  Function:   Updates the list of functions depending on the set category
 #*
-#*  Input:  ---
+#*  Input:  Search string used to filter the list of functions
 #*
 #*  Output: ---
 #*
 #/
 
-void ScFunctionWin::UpdateFunctionList()
+void ScFunctionWin::UpdateFunctionList(const OUString& rSearchString)
 {
 sal_Int32  nSelPos   = xCatBox->get_active();
 sal_Int32  nCategory = ( -1 != nSelPos )
@@ -214,12 +222,32 @@ void ScFunctionWin::UpdateFunctionList()
 {
 ScFunctionMgr* pFuncMgr = ScGlobal::GetStarCalcFunctionMgr();
 
+SvtSysLocale aSysLocale;
+const CharClass& rCharClass = aSysLocale.GetCharClass();
+const OUString aSearchStr(rCharClass.uppercase(rSearchString));
+
+// First add the functions that start with the search string
 const ScFuncDesc* pDesc = pFuncMgr->First( 

[Libreoffice-commits] core.git: sc/source

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

New commits:
commit 0da88ee88255083ec9557ff25005a745dcdbef14
Author: Tomaž Vajngerl 
AuthorDate: Tue Sep 12 14:34:03 2023 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Sep 12 20:50:16 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 

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: 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 b8f6f91f476f1c3f93bb44265381305f6f02b161
Author: Dennis Francis 
AuthorDate: Mon Sep 11 17:49:32 2023 +0530
Commit: Dennis Francis 
CommitDate: Tue Sep 12 16:12:18 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/+/156747
Tested-by: Jenkins
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: sc/source

2023-09-06 Thread Christian Lohmaier (via logerrit)
 sc/source/core/data/column3.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 7f5a9096be8518aff99c3a227d78f36c6dc124fb
Author: Christian Lohmaier 
AuthorDate: Wed Sep 6 11:49:16 2023 +0200
Commit: Christian Lohmaier 
CommitDate: Wed Sep 6 16:40:08 2023 +0200

fix "variable 'nRow' set but not used [-Werror,-Wunused-but-set-variable]"

as seen on non-debug builds with compiling for x86_64 with XCode 14.3.1

Change-Id: Ib0b97cfcf15cc58d08a90bc0b4aaf43fc1be3c05
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156614
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier 

diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index eb478fd2a462..054e334edb06 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -3638,6 +3638,8 @@ public:
 {
 // Both previous and current cells are regular cells.
 assert(pPrev->aPos.Row() == static_cast(nRow - 1));
+// silence set-but-unused warning for non-dbg build
+(void) nRow;
 xPrevGrp = pPrev->CreateCellGroup(2, eCompState == 
ScFormulaCell::EqualInvariant);
 pCur->SetCellGroup(xPrevGrp);
 ++nRow;


[Libreoffice-commits] core.git: sc/source

2023-09-06 Thread Hossein (via logerrit)
 sc/source/ui/inc/viewdata.hxx  |2 +-
 sc/source/ui/view/cellsh4.cxx  |2 +-
 sc/source/ui/view/tabview3.cxx |   18 ++
 3 files changed, 16 insertions(+), 6 deletions(-)

New commits:
commit 218b73d937453d5d813a050f1216840ba71f4fe7
Author: Hossein 
AuthorDate: Wed Sep 6 13:00:18 2023 +0200
Commit: Hossein 
CommitDate: Wed Sep 6 16:27:11 2023 +0200

tdf#154271 Fix automatic cursor/screen jump in Calc

Previously, when using ctrl+end, the screen/cursor jump was done to the
middle of the screen. In this way, the available space of the screen was
not optimally used.

In this patch, the jump is adjusted to move the cursor to the end of the
screen, and the visible/usable space will be all of the screen.

In this patch, previous behavior for showing the search results and
other purposes other than pressing ctrl+end to jump to the last cell are
preserved, and in those cases, the selected cell will be in the middle
of the screen, as before.

Also, in the situations that the jump is done from a cell lower or right
of the last cell (in other words, further than the last cell), the
behavior is preserved.

Change-Id: I25f308f84f096ec271c23df75998ddeea32119ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156266
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx
index 34bc8c49c4f6..5dd60f6d266e 100644
--- a/sc/source/ui/inc/viewdata.hxx
+++ b/sc/source/ui/inc/viewdata.hxx
@@ -49,7 +49,7 @@ inline ScHSplitPos WhichH( ScSplitPos ePos );
 inline ScVSplitPos WhichV( ScSplitPos ePos );
 
 /**  Screen behavior related to cursor movements */
-enum ScFollowMode { SC_FOLLOW_NONE, SC_FOLLOW_LINE, SC_FOLLOW_FIX, 
SC_FOLLOW_JUMP };
+enum ScFollowMode { SC_FOLLOW_NONE, SC_FOLLOW_LINE, SC_FOLLOW_FIX, 
SC_FOLLOW_JUMP, SC_FOLLOW_JUMP_END };
 
 /** Mouse mode to select areas */
 enum ScRefType { SC_REFTYPE_NONE, SC_REFTYPE_REF, SC_REFTYPE_FILL,
diff --git a/sc/source/ui/view/cellsh4.cxx b/sc/source/ui/view/cellsh4.cxx
index 8cf13970bdeb..bacbf2b98f90 100644
--- a/sc/source/ui/view/cellsh4.cxx
+++ b/sc/source/ui/view/cellsh4.cxx
@@ -507,7 +507,7 @@ void ScCellShell::ExecutePage( SfxRequest& rReq )
 break;
 
 case SID_CURSORENDOFFILE:
-pTabViewShell->MoveCursorEnd( 1, 1, SC_FOLLOW_JUMP, bSel, bKeep );
+pTabViewShell->MoveCursorEnd( 1, 1, SC_FOLLOW_JUMP_END, bSel, 
bKeep );
 break;
 
 default:
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 9a321f73eefe..723f2b4904e0 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -959,8 +959,17 @@ void ScTabView::AlignToCursor( SCCOL nCurX, SCROW nCurY, 
ScFollowMode eMode,
 else
 nCellSizeX = nCellSizeY = 0;
 Size aScrSize = aViewData.GetScrSize();
-tools::Long nSpaceX = ( aScrSize.Width()  - nCellSizeX ) / 2;
-tools::Long nSpaceY = ( aScrSize.Height() - nCellSizeY ) / 2;
+
+tools::Long nDenom;
+if ( eMode == SC_FOLLOW_JUMP_END && nCurX > aViewData.GetRefStartX()
+&& nCurY > aViewData.GetRefStartY() )
+nDenom = 1; // tdf#154271 Selected cell will be at the bottom 
corner
+// to maximize the visible/usable area
+else
+nDenom = 2; // Selected cell will be at the center of the screen, 
so that
+// it will be visible. This is useful for search 
results, etc.
+tools::Long nSpaceX = ( aScrSize.Width()  - nCellSizeX ) / nDenom;
+tools::Long nSpaceY = ( aScrSize.Height() - nCellSizeY ) / nDenom;
 //  nSpaceY: desired start position of cell for FOLLOW_JUMP, modified 
if dialog interferes
 
 bool bForceNew = false; // force new calculation of JUMP position 
(vertical only)
@@ -971,7 +980,7 @@ void ScTabView::AlignToCursor( SCCOL nCurX, SCROW nCurY, 
ScFollowMode eMode,
 // if possible, put the row with the cursor above or below the dialog
 //! not if already completely visible
 
-if ( eMode == SC_FOLLOW_JUMP )
+if ( eMode == SC_FOLLOW_JUMP || eMode == SC_FOLLOW_JUMP_END )
 {
 weld::Window* pCare = lcl_GetCareWin( 
aViewData.GetViewShell()->GetViewFrame() );
 if (pCare)
@@ -1042,6 +1051,7 @@ void ScTabView::AlignToCursor( SCCOL nCurX, SCROW nCurY, 
ScFollowMode eMode,
 switch (eMode)
 {
 case SC_FOLLOW_JUMP:
+case SC_FOLLOW_JUMP_END:
 if ( nCurX < nDeltaX || nCurX >= nDeltaX+nSizeX )
 {
 nNewDeltaX = nCurX - aViewData.CellsAtX( nCurX, -1, 
eAlignX, static_cast(nSpaceX) );
@@ -1521,7 +1531,7 @@ bool ScTabView::MoveCursorKeyInput( const KeyEvent& 
rKeyEvent )
 if( (nCode == KEY_HOME) || (nCode == KEY_END) )
 {
 nDX = (nCode == KEY_HOME) ? -1 : 

[Libreoffice-commits] core.git: sc/source

2023-09-06 Thread Noel Grandin (via logerrit)
 sc/source/filter/xml/xmlannoi.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5462924437213934c2993c1fe966803a4a9f9a52
Author: Noel Grandin 
AuthorDate: Wed Sep 6 09:24:32 2023 +0200
Commit: Noel Grandin 
CommitDate: Wed Sep 6 10:24:54 2023 +0200

SAL_WARN->SAL_INFO in ScXMLAnnotationContext

these attributes are mostly irrelevant, and do not constitute an error

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

diff --git a/sc/source/filter/xml/xmlannoi.cxx 
b/sc/source/filter/xml/xmlannoi.cxx
index db12eb148464..f046ec3d174c 100644
--- a/sc/source/filter/xml/xmlannoi.cxx
+++ b/sc/source/filter/xml/xmlannoi.cxx
@@ -91,7 +91,7 @@ ScXMLAnnotationContext::ScXMLAnnotationContext( ScXMLImport& 
rImport,
 }
 break;
 default:
-XMLOFF_WARN_UNKNOWN("xmloff", aIter);
+XMLOFF_INFO_UNKNOWN("xmloff", aIter);
 }
 }
 }


[Libreoffice-commits] core.git: sc/source

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

New commits:
commit 4d8cff696cfdb23733b0e91348b28a83f1c3bedc
Author: Aron Budea 
AuthorDate: Mon Sep 4 03:15:13 2023 +0200
Commit: Henry Castro 
CommitDate: Mon Sep 4 15:37:59 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 

diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index 4faa5d89d569..e28ff1d7 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: sc/source

2023-09-04 Thread Julien Nabet (via logerrit)
 sc/source/ui/app/client.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 4a501a7270a0dd476ff71f72fae2c9fb9b40520a
Author: Julien Nabet 
AuthorDate: Mon Sep 4 11:19:31 2023 +0200
Commit: Julien Nabet 
CommitDate: Mon Sep 4 14:21:05 2023 +0200

Related tdf#108976: Crash in: OutputDevice::GetOutputSizePixel()

On pc Debian x86-64 with master sources updated today, I encountered this:
5  0x7f68124533a2 in __assert_fail
(assertion=0x7f67016aea9b "_pInterface != NULL", file=0x7f670156834a 
"/home/julien/lo/libreoffice/include/com/sun/star/uno/Reference.h", line=385, 
function=0x7f6701592970 "interface_type 
*com::sun::star::uno::Reference::operator->()
 const [interface_type = com::sun::star::embed::XEmbeddedObject]") at 
./assert/assert.c:101
6  0x7f67023ed042 in 
com::sun::star::uno::Reference::operator->()
 const (this=0x7ffe3b5f11c0) at include/com/sun/star/uno/Reference.h:385
7  0x7f67030a7ba9 in ScClient::ViewChanged() (this=0x55fb3b69e7b0) at 
/home/julien/lo/libreoffice/sc/source/ui/app/client.cxx:191
8  0x7f680f1d13db in SfxInPlaceClient::Invalidate() 
(this=0x55fb3b69e7b0) at 
/home/julien/lo/libreoffice/sfx2/source/view/ipclient.cxx:840
9  0x7f680f1d59db in SfxInPlaceClient::SetObjArea(tools::Rectangle 
const&) (this=0x55fb3b69e7b0, rArea=...) at 
/home/julien/lo/libreoffice/sfx2/source/view/ipclient.cxx:764
10 0x7f6703b74c30 in ScTabViewShell::ConnectObject(SdrOle2Obj const*) 
(this=0x55fb3ca0b880, pObj=0x55fb3c68b2c0) at 
/home/julien/lo/libreoffice/sc/source/ui/view/tabvwshb.cxx:107

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

Change-Id: I0b48f2e624b249438d8d4fbc53057f89f5877c05
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156509
Reviewed-by: Noel Grandin 
Reviewed-by: Julien Nabet 
Tested-by: Jenkins

diff --git a/sc/source/ui/app/client.cxx b/sc/source/ui/app/client.cxx
index 26c84e5fa347..5c44bc077e83 100644
--- a/sc/source/ui/app/client.cxx
+++ b/sc/source/ui/app/client.cxx
@@ -184,6 +184,8 @@ void ScClient::ViewChanged()
 }
 
 uno::Reference < embed::XEmbeddedObject > xObj = GetObject();
+if (!xObj.is())
+return;
 
 // TODO/LEAN: working with Visual Area can switch object to running state
 awt::Size aSz;


[Libreoffice-commits] core.git: sc/source

2023-09-01 Thread Kohei Yoshida (via logerrit)
 sc/source/filter/orcus/interface.cxx |   15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)

New commits:
commit 78d9d0d8dccb6fd8952435b8a13d525c7606f467
Author: Kohei Yoshida 
AuthorDate: Fri Sep 1 16:44:51 2023 -0400
Commit: Kohei Yoshida 
CommitDate: Sat Sep 2 02:31:29 2023 +0200

Apply font names and sizes to formatted strings via orcus

Change-Id: I6809a184652b278eb66ee104558af19ea4a22ed7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156459
Tested-by: Jenkins
Reviewed-by: Kohei Yoshida 

diff --git a/sc/source/filter/orcus/interface.cxx 
b/sc/source/filter/orcus/interface.cxx
index c2c784a5a016..b349016355b7 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -1357,12 +1357,23 @@ void ScOrcusSharedStrings::set_segment_italic(bool b)
 maCurFormat.Put(SvxPostureItem(eItalic, EE_CHAR_ITALIC));
 }
 
-void ScOrcusSharedStrings::set_segment_font_name(std::string_view /*s*/)
+void ScOrcusSharedStrings::set_segment_font_name(std::string_view s)
 {
+OUString aName = toOUString(s);
+maCurFormat.Put(
+SvxFontItem(
+FAMILY_DONTKNOW, aName, aName, PITCH_DONTKNOW,
+mrFactory.getGlobalSettings().getTextEncoding(),
+EE_CHAR_FONTINFO
+)
+);
 }
 
-void ScOrcusSharedStrings::set_segment_font_size(double /*point*/)
+void ScOrcusSharedStrings::set_segment_font_size(double point)
 {
+// points to 100th of millimeters
+tools::Long nMM = o3tl::convert(point, o3tl::Length::pt, 
o3tl::Length::mm100);
+maCurFormat.Put(SvxFontHeightItem(nMM, 100, EE_CHAR_FONTHEIGHT));
 }
 
 void ScOrcusSharedStrings::set_segment_font_color(


[Libreoffice-commits] core.git: sc/source

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

New commits:
commit 964fe83ec0ce36dab611c7e1cf22af7c8cce5860
Author: Henry Castro 
AuthorDate: Thu Aug 10 15:14:18 2023 -0400
Commit: Henry Castro 
CommitDate: Fri Sep 1 18:10:16 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 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156417
Tested-by: Jenkins

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 1267509d4e5f..4a728f54874d 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: sc/source

2023-08-30 Thread Kohei Yoshida (via logerrit)
 sc/source/filter/inc/orcusinterface.hxx   |   15 
 sc/source/filter/orcus/interface.cxx  |   82 --
 sc/source/ui/dataprovider/xmldataprovider.cxx |2 
 3 files changed, 79 insertions(+), 20 deletions(-)

New commits:
commit 695ae365dcab7c7dd59b39411299c5c200081885
Author: Kohei Yoshida 
AuthorDate: Tue Aug 29 22:13:32 2023 -0400
Commit: Kohei Yoshida 
CommitDate: Thu Aug 31 03:03:29 2023 +0200

Add support for rich-text string import via orcus interface

It was previously imported only as non-formatted strings.  Font names
and sizes are to be imported later.

Change-Id: I93a313851e87f1d6d9ccc409ca9a9f1abff3de0d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156271
Tested-by: Jenkins
Reviewed-by: Kohei Yoshida 

diff --git a/sc/source/filter/inc/orcusinterface.hxx 
b/sc/source/filter/inc/orcusinterface.hxx
index ed3966a2e136..2fd1d5ed40f3 100644
--- a/sc/source/filter/inc/orcusinterface.hxx
+++ b/sc/source/filter/inc/orcusinterface.hxx
@@ -11,10 +11,12 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
 #include 
+#include 
 
 #include "sharedformulagroups.hxx"
 
@@ -30,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 
 class ScOrcusSheet;
 class ScOrcusStyles;
@@ -103,8 +106,13 @@ public:
 class ScOrcusSharedStrings : public 
orcus::spreadsheet::iface::import_shared_strings
 {
 ScOrcusFactory& mrFactory;
+ScFieldEditEngine& mrEditEngine;
+
+SfxItemSet maCurFormat;
+std::vector> maFormatSegments;
+
+OUString toOUString(std::string_view s);
 
-OStringBuffer maCurSegment;
 public:
 ScOrcusSharedStrings(ScOrcusFactory& rFactory);
 
@@ -696,12 +704,13 @@ class ScOrcusFactory : public 
orcus::spreadsheet::iface::import_factory
 CellStoreToken( const ScAddress& rPos, OUString aFormula, 
formula::FormulaGrammar::Grammar eGrammar );
 };
 
+using StringValueType = std::variant>;
 typedef std::unordered_map StringHashType;
 typedef std::vector CellStoreTokensType;
 
 ScDocumentImport maDoc;
 
-std::vector maStrings;
+std::vector maStrings;
 StringHashType maStringHash;
 
 CellStoreTokensType maCellStoreTokens;
@@ -735,6 +744,8 @@ public:
 
 size_t appendString(const OUString& rStr);
 size_t addString(const OUString& rStr);
+std::size_t appendFormattedString(std::unique_ptr 
pEditText);
+
 const OUString* getString(size_t nIndex) const;
 
 void pushCellStoreAutoToken( const ScAddress& rPos, const OUString& rVal );
diff --git a/sc/source/filter/orcus/interface.cxx 
b/sc/source/filter/orcus/interface.cxx
index a61d545d9151..c2c784a5a016 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -455,7 +456,16 @@ void ScOrcusFactory::finalize()
 // String index out-of-bound!  Something is up.
 break;
 
-maDoc.setStringCell(rToken.maPos, maStrings[rToken.mnIndex1]);
+const auto& s = maStrings[rToken.mnIndex1];
+switch (s.index())
+{
+case 0: // OUString
+maDoc.setStringCell(rToken.maPos, std::get<0>(s));
+break;
+case 1: // std::unique_ptr
+maDoc.setEditCell(rToken.maPos, 
std::get<1>(s)->Clone());
+break;
+}
 ++nCellCount;
 break;
 }
@@ -577,9 +587,23 @@ size_t ScOrcusFactory::addString(const OUString& rStr)
 return appendString(rStr);
 }
 
+std::size_t 
ScOrcusFactory::appendFormattedString(std::unique_ptr pEditText)
+{
+std::size_t nPos = maStrings.size();
+maStrings.push_back(std::move(pEditText));
+return nPos;
+}
+
 const OUString* ScOrcusFactory::getString(size_t nIndex) const
 {
-return nIndex < maStrings.size() ? [nIndex] : nullptr;
+if (nIndex >= maStrings.size())
+return nullptr;
+
+const StringValueType& rStr = maStrings[nIndex];
+if (rStr.index() != 0)
+return nullptr;
+
+return ::get(rStr);
 }
 
 void ScOrcusFactory::pushCellStoreAutoToken( const ScAddress& rPos, const 
OUString& rVal )
@@ -1294,31 +1318,43 @@ ScOrcusFactory& ScOrcusSheet::getFactory()
 return mrFactory;
 }
 
+OUString ScOrcusSharedStrings::toOUString(std::string_view s)
+{
+return {s.data(), sal_Int32(s.size()), 
mrFactory.getGlobalSettings().getTextEncoding()};
+}
+
 ScOrcusSharedStrings::ScOrcusSharedStrings(ScOrcusFactory& rFactory) :
-mrFactory(rFactory) {}
+mrFactory(rFactory),
+mrEditEngine(rFactory.getDoc().getDoc().GetEditEngine()),
+maCurFormat(mrEditEngine.GetEmptyItemSet())
+{
+mrEditEngine.Clear();
+}
 
 size_t ScOrcusSharedStrings::append(std::string_view s)
 {
-OUString aNewString(s.data(), s.size(), 

[Libreoffice-commits] core.git: 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 1fbf566ad06cb41ae181b3848dfd2535e2dd87a2
Author: Michael Meeks 
AuthorDate: Tue Aug 29 22:08:42 2023 +0100
Commit: Michael Meeks 
CommitDate: Wed Aug 30 10:00:00 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/+/156270

diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 70dee0e453fd..802d2d7087e5 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1141,6 +1141,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: sc/source

2023-08-29 Thread Czeber László Ádám (via logerrit)
 sc/source/ui/view/gridwin.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 62e201d2cf82f4ccaa6564bd2420ac6582594b8f
Author: Czeber László Ádám 
AuthorDate: Fri Aug 11 10:31:24 2023 +0200
Commit: László Németh 
CommitDate: Tue Aug 29 16:49:20 2023 +0200

tdf#155495 sc: fix cursor positioning editing centered/right-aligned cells

It was not always possible to place the cursor in edited text
by mouse clicking in case of centered and right-aligned cell
content, i.e. when the edited content has been shown before
the original (not edited) cell position.

Now it's possible to place the cursor by mouse clicking before
the left border of the not edited cell (instead of selecting other
cells covered by the edited content).

Change-Id: I23c59ca3ef67d223181a7e3dfd71b84f43fca32b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155579
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 275c9dbcec25..d5a6bf9db155 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -1943,8 +1943,9 @@ void ScGridWindow::HandleMouseButtonDown( const 
MouseEvent& rMEvt, MouseEventSta
 mrViewData.GetEditView( eWhich, pEditView, nEditCol, nEditRow );
 SCCOL nEndCol = mrViewData.GetEditEndCol();
 SCROW nEndRow = mrViewData.GetEditEndRow();
+SCCOL nStartCol = mrViewData.GetEditStartCol();
 
-if ( nPosX >= nEditCol && nPosX <= nEndCol &&
+if ( nPosX >= nStartCol && nPosX <= nEndCol &&
  nPosY >= nEditRow && nPosY <= nEndRow )
 {
 // when clicking in the table EditView, always reset the focus


[Libreoffice-commits] core.git: sc/source

2023-08-25 Thread Caolán McNamara (via logerrit)
 sc/source/ui/attrdlg/attrdlg.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 772d9abb6006bb03b8bd783bbe95a54360ebc3a9
Author: Caolán McNamara 
AuthorDate: Fri Aug 25 12:40:15 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Aug 25 16:36:39 2023 +0200

downgrade from assert to SAL_WARN

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

diff --git a/sc/source/ui/attrdlg/attrdlg.cxx b/sc/source/ui/attrdlg/attrdlg.cxx
index e09a69b5c13f..7bd79468d27d 100644
--- a/sc/source/ui/attrdlg/attrdlg.cxx
+++ b/sc/source/ui/attrdlg/attrdlg.cxx
@@ -89,7 +89,7 @@ void ScAttrDlg::PageCreated(const OUString& rPageId, 
SfxTabPage& rTabPage)
 else if (rPageId == "font" && pDocSh)
 {
 const SfxPoolItem* pInfoItem = pDocSh->GetItem( SID_ATTR_CHAR_FONTLIST 
);
-assert(pInfoItem && "FontListItem  not found :-(");
+SAL_WARN_IF(!pInfoItem, "sc.ui", "we should have a FontListItem 
normally here");
 if (pInfoItem)
 {
 aSet.Put (SvxFontListItem(static_cast(pInfoItem)->GetFontList(), SID_ATTR_CHAR_FONTLIST ));


[Libreoffice-commits] core.git: sc/source

2023-08-25 Thread Xisco Fauli (via logerrit)
 sc/source/ui/attrdlg/attrdlg.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit c46f00166027fa3eefc75f9cb13bf4afc887bf1d
Author: Xisco Fauli 
AuthorDate: Fri Aug 25 12:39:37 2023 +0200
Commit: Caolán McNamara 
CommitDate: Fri Aug 25 13:39:00 2023 +0200

sc: fix crash in ScAttrDlg::PageCreated

See 
https://crashreport.libreoffice.org/stats/signature/ScAttrDlg::PageCreated(rtl::OString%20const%20&,SfxTabPage%20&)

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

diff --git a/sc/source/ui/attrdlg/attrdlg.cxx b/sc/source/ui/attrdlg/attrdlg.cxx
index 7a80073d9da3..e09a69b5c13f 100644
--- a/sc/source/ui/attrdlg/attrdlg.cxx
+++ b/sc/source/ui/attrdlg/attrdlg.cxx
@@ -90,8 +90,11 @@ void ScAttrDlg::PageCreated(const OUString& rPageId, 
SfxTabPage& rTabPage)
 {
 const SfxPoolItem* pInfoItem = pDocSh->GetItem( SID_ATTR_CHAR_FONTLIST 
);
 assert(pInfoItem && "FontListItem  not found :-(");
-aSet.Put (SvxFontListItem(static_cast(pInfoItem)->GetFontList(), SID_ATTR_CHAR_FONTLIST ));
-rTabPage.PageCreated(aSet);
+if (pInfoItem)
+{
+aSet.Put (SvxFontListItem(static_cast(pInfoItem)->GetFontList(), SID_ATTR_CHAR_FONTLIST ));
+rTabPage.PageCreated(aSet);
+}
 }
 else if (rPageId == "background")
 {


[Libreoffice-commits] core.git: sc/source

2023-08-25 Thread Xisco Fauli (via logerrit)
 sc/source/ui/app/transobj.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 8b022db4cd397fd88f8078fc7f5ff85f21635155
Author: Xisco Fauli 
AuthorDate: Fri Aug 25 12:42:02 2023 +0200
Commit: Caolán McNamara 
CommitDate: Fri Aug 25 13:35:31 2023 +0200

sc: fix crash in ScTransferObj::DragFinished

See 
https://crashreport.libreoffice.org/stats/signature/ScModule::GetDragData()

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

diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index f19bf94a4ff1..6a1ef6a04650 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -566,7 +566,7 @@ void ScTransferObj::DragFinished( sal_Int8 nDropAction )
 }
 
 ScModule* pScMod = SC_MOD();
-if ( pScMod->GetDragData().pCellTransfer == this )
+if ( pScMod && pScMod->GetDragData().pCellTransfer == this )
 pScMod->ResetDragObject();
 
 m_xDragSourceRanges = nullptr;   // don't keep source after dropping


[Libreoffice-commits] core.git: sc/source

2023-08-24 Thread Andrea Gelmini (via logerrit)
 sc/source/ui/view/editsh.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 9b6f0bcb042354fd5c25f78e432b8983963e0e9c
Author: Andrea Gelmini 
AuthorDate: Thu Aug 24 10:20:23 2023 +0200
Commit: Julien Nabet 
CommitDate: Thu Aug 24 22:16:42 2023 +0200

Remove duplicated include

Change-Id: I5bfb0f4bbebdd21c3ceef04b6a7eb36bdd41c52c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156034
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 99d84ca1518f..74d4add556b9 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -64,7 +64,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 


[Libreoffice-commits] core.git: sc/source

2023-08-23 Thread Noel Grandin (via logerrit)
 sc/source/core/data/global.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit fc2dc496434fdb6f0babde509ee22c2952d532d0
Author: Noel Grandin 
AuthorDate: Wed Aug 23 14:20:17 2023 +0200
Commit: Noel Grandin 
CommitDate: Wed Aug 23 15:43:23 2023 +0200

fix bug inScGlobal::CheckWidthInvalidate

introduced in
commit 6adabd915d931b845fcf2fef15fbf3fca14ec9b3
Author: Luboš Luňák 
Date:   Sun Mar 6 16:53:47 2022 +0100
faster check whether attributes have changed (tdf#117366)

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

diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index 459798d1f26f..027bc5768a35 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -188,7 +188,7 @@ bool ScGlobal::CheckWidthInvalidate( bool& 
bNumFormatChanged,
  const SfxItemSet& rOldAttrs )
 {
 std::optional equal = ScPatternAttr::FastEqualPatternSets( 
rNewAttrs, rOldAttrs );
-if( equal.has_value() && equal )
+if( equal.has_value() && *equal )
 {
 bNumFormatChanged = false;
 return false;


[Libreoffice-commits] core.git: sc/source

2023-08-22 Thread Caolán McNamara (via logerrit)
 sc/source/ui/inc/textdlgs.hxx  |3 ++-
 sc/source/ui/miscdlgs/textdlgs.cxx |9 ++---
 2 files changed, 8 insertions(+), 4 deletions(-)

New commits:
commit e46e663cc350d89e4997095466d675b875eb2e04
Author: Caolán McNamara 
AuthorDate: Mon Aug 21 21:24:54 2023 +0100
Commit: Caolán McNamara 
CommitDate: Tue Aug 22 16:30:52 2023 +0200

Related: tdf#98367 allow drawing shapes in calc to have smallcaps

which is something excel allows, so allow this too

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

diff --git a/sc/source/ui/inc/textdlgs.hxx b/sc/source/ui/inc/textdlgs.hxx
index 61cdfdb170ff..3d01bdc43433 100644
--- a/sc/source/ui/inc/textdlgs.hxx
+++ b/sc/source/ui/inc/textdlgs.hxx
@@ -26,7 +26,8 @@ class SfxObjectShell;
 class ScCharDlg : public SfxTabDialogController
 {
 private:
-const SfxObjectShell& rDocShell;
+const SfxObjectShell& m_rDocShell;
+bool m_bDrawText;
 
 virtual void PageCreated(const OUString& rId, SfxTabPage& rPage) override;
 
diff --git a/sc/source/ui/miscdlgs/textdlgs.cxx 
b/sc/source/ui/miscdlgs/textdlgs.cxx
index 04c4db957db8..2cf70d8f5705 100644
--- a/sc/source/ui/miscdlgs/textdlgs.cxx
+++ b/sc/source/ui/miscdlgs/textdlgs.cxx
@@ -32,7 +32,8 @@
 
 ScCharDlg::ScCharDlg(weld::Window* pParent, const SfxItemSet* pAttr, const 
SfxObjectShell* pDocShell, bool bDrawText)
 : SfxTabDialogController(pParent, "modules/scalc/ui/chardialog.ui", 
"CharDialog", pAttr)
-, rDocShell(*pDocShell)
+, m_rDocShell(*pDocShell)
+, m_bDrawText(bDrawText)
 {
 AddTabPage("font", RID_SVXPAGE_CHAR_NAME);
 AddTabPage("fonteffects", RID_SVXPAGE_CHAR_EFFECTS);
@@ -50,14 +51,16 @@ void ScCharDlg::PageCreated(const OUString& rId, SfxTabPage 
)
 if (rId == "font")
 {
 SvxFontListItem aItem(*static_cast(
-( rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ) ) );
+( m_rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ) ) );
 
 aSet.Put (SvxFontListItem( aItem.GetFontList(), 
SID_ATTR_CHAR_FONTLIST));
 rPage.PageCreated(aSet);
 }
 else if (rId == "fonteffects")
 {
-aSet.Put (SfxUInt16Item(SID_DISABLE_CTL,DISABLE_CASEMAP));
+// Allow CaseMap in drawings, but not in normal text
+if (!m_bDrawText)
+aSet.Put (SfxUInt16Item(SID_DISABLE_CTL,DISABLE_CASEMAP));
 rPage.PageCreated(aSet);
 }
 else if (rId == "background")


[Libreoffice-commits] core.git: sc/source

2023-08-21 Thread Andrea Gelmini (via logerrit)
 sc/source/core/data/formulacell.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d0f3f62414ce8c49b1a9ad83e2f7bd57d6fb7f63
Author: Andrea Gelmini 
AuthorDate: Mon Aug 21 09:24:55 2023 +0200
Commit: Julien Nabet 
CommitDate: Mon Aug 21 11:52:43 2023 +0200

Fix typo

Change-Id: Ieb6e4ccf543b4d015b83cea4614983d5fcaea8cb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155886
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/sc/source/core/data/formulacell.cxx 
b/sc/source/core/data/formulacell.cxx
index 85d43700461e..88970ff75401 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -4432,7 +4432,7 @@ struct ScDependantsCalculator
 return nRowLen;
 }
 
-// Because Lookup will extend the Result Vector under certain cirumstances 
listed at:
+// Because Lookup will extend the Result Vector under certain 
circumstances listed at:
 // https://wiki.documentfoundation.org/Documentation/Calc_Functions/LOOKUP
 // then if the Lookup has a Result Vector only accept the Lookup for 
parallelization
 // of the Result Vector has the same dimensions as the Search Vector.


[Libreoffice-commits] core.git: sc/source

2023-08-19 Thread Caolán McNamara (via logerrit)
 sc/source/core/data/formulacell.cxx |   52 
 1 file changed, 52 insertions(+)

New commits:
commit 81c19355d7ad830c2356d7d82e244929be3823a8
Author: Caolán McNamara 
AuthorDate: Sat Aug 19 16:42:25 2023 +0100
Commit: Caolán McNamara 
CommitDate: Sat Aug 19 20:55:08 2023 +0200

crashtesting: parallel calc assert with Lookup

seen in forum-mso-en4-55192.xlsx with a singlecell as the result vector
which gets autoextended outside the range that the pre-parallel calc
took into consideration on set up. For simplicity if there is a result
vector assume that if it doesn't match the size of the search vector
that we can't parallelize this.

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

diff --git a/sc/source/core/data/formulacell.cxx 
b/sc/source/core/data/formulacell.cxx
index 4b974831992b..85d43700461e 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -4432,6 +4432,52 @@ struct ScDependantsCalculator
 return nRowLen;
 }
 
+// Because Lookup will extend the Result Vector under certain cirumstances 
listed at:
+// https://wiki.documentfoundation.org/Documentation/Calc_Functions/LOOKUP
+// then if the Lookup has a Result Vector only accept the Lookup for 
parallelization
+// of the Result Vector has the same dimensions as the Search Vector.
+bool LookupResultVectorMismatch(sal_Int32 nTokenIdx)
+{
+if (nTokenIdx >= 3)
+{
+FormulaToken** pRPNArray = mrCode.GetCode();
+if (pRPNArray[nTokenIdx - 1]->GetOpCode() == ocPush &&   // <- 
result vector
+pRPNArray[nTokenIdx - 2]->GetOpCode() == ocPush &&   // <- 
search vector
+pRPNArray[nTokenIdx - 2]->GetType() == svDoubleRef &&
+pRPNArray[nTokenIdx - 3]->GetOpCode() == ocPush) // <- 
search criterion
+{
+auto res = pRPNArray[nTokenIdx - 1];
+// If Result vector is just a single cell reference
+// LOOKUP extends it as a column vector.
+if (res->GetType() == svSingleRef)
+return true;
+
+// If Result vector is a cell range and the match position
+// falls outside its length, it gets automatically extended
+// to the length of Search vector, but in the direction of
+// Result vector.
+if (res->GetType() == svDoubleRef)
+{
+ScComplexRefData aRef1 = *res->GetDoubleRef();
+ScComplexRefData aRef2 = *pRPNArray[nTokenIdx - 
2]->GetDoubleRef();
+ScRange resultRange = aRef1.toAbs(mrDoc, mrPos);
+ScRange sourceRange = aRef2.toAbs(mrDoc, mrPos);
+
+SCROW nResultRows = resultRange.aEnd.Row() - 
resultRange.aStart.Row();
+SCROW nSourceRows = sourceRange.aEnd.Row() - 
sourceRange.aStart.Row();
+if (nResultRows != nSourceRows)
+return true;
+
+SCCOL nResultCols = resultRange.aEnd.Col() - 
resultRange.aStart.Col();
+SCCOL nSourceCols = sourceRange.aEnd.Col() - 
sourceRange.aStart.Col();
+if (nResultCols != nSourceCols)
+return true;
+}
+}
+}
+return false;
+}
+
 bool DoIt(ScRangeList* pSuccessfulDependencies, ScAddress* pDirtiedAddress)
 {
 // Partially from ScGroupTokenConverter::convert in 
sc/source/core/data/grouptokenconverter.cxx
@@ -4460,6 +4506,12 @@ struct ScDependantsCalculator
 return false;
 }
 
+if (p->GetOpCode() == ocLookup && 
LookupResultVectorMismatch(nTokenIdx))
+{
+SAL_INFO("sc.core.formulacell", "Lookup Result Vector size 
doesn't match Search Vector");
+return false;
+}
+
 switch (p->GetType())
 {
 case svSingleRef:


[Libreoffice-commits] core.git: sc/source

2023-08-18 Thread Caolán McNamara (via logerrit)
 sc/source/ui/inc/gridwin.hxx   |2 ++
 sc/source/ui/view/gridwin4.cxx |   10 --
 2 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 28d41e60416ef10ae2a59d1c4ad34a2eb75dc408
Author: Caolán McNamara 
AuthorDate: Thu Aug 17 20:31:55 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Aug 18 18:32:56 2023 +0200

add a LogicInvalidatePart which can take a 'part'

no change in behaviour intended

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

diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index ddc9815c2052..979767c6801b 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -320,6 +320,8 @@ class SAL_DLLPUBLIC_RTTI ScGridWindow : public 
vcl::DocWindow, public DropTarget
 voidSetupInitialPageBreaks(const ScDocument& rDoc, SCTAB nTab);
 DECL_DLLPRIVATE_LINK(InitiatePageBreaksTimer, Timer*, void);
 
+voidLogicInvalidatePart(const tools::Rectangle* pRectangle, 
int nPart);
+
 protected:
 virtual voidPrePaint(vcl::RenderContext& rRenderContext) override;
 virtual voidPaint(vcl::RenderContext& rRenderContext, const 
tools::Rectangle& rRect) override;
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index bc2521531a37..a86902d57944 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1727,7 +1727,7 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice,
 }
 }
 
-void ScGridWindow::LogicInvalidate(const tools::Rectangle* pRectangle)
+void ScGridWindow::LogicInvalidatePart(const tools::Rectangle* pRectangle, int 
nPart)
 {
 tools::Rectangle aRectangle;
 tools::Rectangle* pResultRectangle;
@@ -1759,7 +1759,13 @@ void ScGridWindow::LogicInvalidate(const 
tools::Rectangle* pRectangle)
 }
 
 ScTabViewShell* pViewShell = mrViewData.GetViewShell();
-SfxLokHelper::notifyInvalidation(pViewShell, pResultRectangle);
+SfxLokHelper::notifyInvalidation(pViewShell, nPart, pResultRectangle);
+}
+
+void ScGridWindow::LogicInvalidate(const tools::Rectangle* pRectangle)
+{
+ScTabViewShell* pViewShell = mrViewData.GetViewShell();
+LogicInvalidatePart(pRectangle, pViewShell->getPart());
 }
 
 void ScGridWindow::SetCellSelectionPixel(int nType, int nPixelX, int nPixelY)


[Libreoffice-commits] core.git: sc/source

2023-08-18 Thread Andrea Gelmini (via logerrit)
 sc/source/filter/oox/pivotcachebuffer.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b0cfba866a664b6d70a7b10a20da1971c891ab5e
Author: Andrea Gelmini 
AuthorDate: Fri Aug 18 11:31:10 2023 +0200
Commit: Julien Nabet 
CommitDate: Fri Aug 18 13:53:26 2023 +0200

Fix typo

Change-Id: I0c7e1d2c2cf9d20ca40a45d2880ff5dcea4a238d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155830
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/sc/source/filter/oox/pivotcachebuffer.cxx 
b/sc/source/filter/oox/pivotcachebuffer.cxx
index e796cfe53da0..3655ffc40391 100644
--- a/sc/source/filter/oox/pivotcachebuffer.cxx
+++ b/sc/source/filter/oox/pivotcachebuffer.cxx
@@ -720,7 +720,7 @@ OUString PivotCacheField::createParentGroupField( const 
Reference< XDataPilotFie
 previous field if that is grouped too. To find the correct
 group, the first item used to create the group is searched.
 Calc provides the original item names of the base field
-when the group is querried for its members. Its does not
+when the group is queried for its members. Its does not
 provide the names of members that are already groups in the
 field used to create the new groups. (Is this a bug?)
 Therefore, a name from the passed list of original item


[Libreoffice-commits] core.git: sc/source

2023-08-18 Thread Heiko Tietze (via logerrit)
 sc/source/ui/view/tabvwsh3.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 27fa859bb85ba7ac5b8cb22db5ae85750c7effba
Author: Heiko Tietze 
AuthorDate: Thu Jul 27 11:08:35 2023 +0200
Commit: Heiko Tietze 
CommitDate: Fri Aug 18 09:21:23 2023 +0200

Resolves tdf#156357 - Submit Show Formula to document

Change-Id: Ic893e573b2409342d61877313a3b60e83bb13690
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154984
Tested-by: Jenkins
Reviewed-by: Heiko Tietze 

diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx
index 7395325f775c..255dbed88508 100644
--- a/sc/source/ui/view/tabvwsh3.cxx
+++ b/sc/source/ui/view/tabvwsh3.cxx
@@ -721,6 +721,8 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
 ScViewOptions aSetOpts = rOpts;
 aSetOpts.SetOption( VOPT_FORMULAS, bFormulaMode );
 rViewData.SetOptions( aSetOpts );
+ScDocument& rDoc = rViewData.GetDocument();
+rDoc.SetViewOptions(aSetOpts);
 
 rViewData.GetDocShell()->PostPaintGridAll();
 


[Libreoffice-commits] core.git: sc/source

2023-08-16 Thread Denis Sorotnik (via logerrit)
 sc/source/ui/view/tabview3.cxx |   39 ---
 1 file changed, 20 insertions(+), 19 deletions(-)

New commits:
commit 552170c9c8ad6d215aa456ba9d622af01c25d275
Author: Denis Sorotnik 
AuthorDate: Tue Aug 8 15:19:17 2023 +0600
Commit: Ilmari Lauhakangas 
CommitDate: Wed Aug 16 12:47:50 2023 +0200

tdf#156311 Cycling through tabs in Calc

Change-Id: Ieadae5dea642b27a2c91fd8c34049dc5a79bdf6d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155449
Tested-by: Jenkins
Reviewed-by: Heiko Tietze 

diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index bb0c4701387d..03a15b4437d9 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -1779,33 +1779,34 @@ void ScTabView::SelectNextTab( short nDir, bool 
bExtendSelection )
 
 ScDocument& rDoc = aViewData.GetDocument();
 SCTAB nTab = aViewData.GetTabNo();
-if (nDir<0)
+SCTAB nNextTab = nTab;
+if (nDir < 0)
 {
-if (!nTab)
-return;
---nTab;
-while (!rDoc.IsVisible(nTab))
+do
 {
-if (!nTab)
-return;
---nTab;
-}
+--nNextTab;
+if (nNextTab < 0)
+nNextTab = rDoc.GetTableCount();
+if (rDoc.IsVisible(nNextTab))
+break;
+} while (nNextTab != nTab);
 }
-else
+if (nDir > 0)
 {
 SCTAB nCount = rDoc.GetTableCount();
-++nTab;
-if (nTab >= nCount)
-return;
-while (!rDoc.IsVisible(nTab))
+do
 {
-++nTab;
-if (nTab >= nCount)
-return;
-}
+++nNextTab;
+if (nNextTab >= nCount)
+nNextTab = 0;
+if (rDoc.IsVisible(nNextTab))
+break;
+} while (nNextTab != nTab);
 }
+if (nNextTab == nTab)
+return;
 
-SetTabNo( nTab, false, bExtendSelection );
+SetTabNo(nNextTab, false, bExtendSelection);
 PaintExtras();
 }
 


[Libreoffice-commits] core.git: sc/source

2023-08-14 Thread Caolán McNamara (via logerrit)
 sc/source/filter/excel/xeescher.cxx |9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

New commits:
commit d827d36625e8952ef3bfadbf8de76578074d474d
Author: Caolán McNamara 
AuthorDate: Mon Aug 14 11:14:14 2023 +0100
Commit: Caolán McNamara 
CommitDate: Mon Aug 14 21:26:11 2023 +0200

move GetEditTextObject to after it is potentially generated

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

diff --git a/sc/source/filter/excel/xeescher.cxx 
b/sc/source/filter/excel/xeescher.cxx
index 04c1f1b9efbd..c7926a9b6f12 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -1643,12 +1643,8 @@ XclExpNote::XclExpNote(const XclExpRoot& rRoot, const 
ScAddress& rScPos,
 // get the main note text
 OUString aNoteText;
 if( pScNote )
-{
 aNoteText = pScNote->GetText();
-const EditTextObject *pEditObj = pScNote->GetEditTextObject();
-if( pEditObj )
-mpNoteContents = XclExpStringHelper::CreateString( rRoot, 
*pEditObj );
-}
+
 // append additional text
 aNoteText = ScGlobal::addToken( aNoteText, rAddText, '\n', 2 );
 
@@ -1689,6 +1685,9 @@ XclExpNote::XclExpNote(const XclExpRoot& rRoot, const 
ScAddress& rScPos,
 maAuthor = XclExpString( " " );
 else
 maAuthor = XclExpString( pScNote->GetAuthor(), 
XclStrFlags::NONE, 54 );
+
+if (const EditTextObject *pEditObj = 
pScNote->GetEditTextObject())
+mpNoteContents = XclExpStringHelper::CreateString( rRoot, 
*pEditObj );
 }
 
 SetRecSize( 9 + maAuthor.GetSize() );


[Libreoffice-commits] core.git: sc/source

2023-08-14 Thread Andrea Gelmini (via logerrit)
 sc/source/core/data/postit.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d8e012b6a71ed1499d0e25122cc65c13cdadddf6
Author: Andrea Gelmini 
AuthorDate: Mon Aug 14 14:27:49 2023 +0200
Commit: Julien Nabet 
CommitDate: Mon Aug 14 17:18:03 2023 +0200

Fix typo

Change-Id: I5975a46e2692b1af221ca716d2a117e424948c15
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155664
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index b631d7659d99..e46836f12e53 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -980,7 +980,7 @@ ScPostIt* ScNoteUtil::CreateNoteFromGenerator(
 ScCaptionInitData& rInitData = *aNoteData.mxInitData;
 rInitData.mxGenerator = std::move(xGenerator);
 // because the Caption is generated on demand, we will need to create the
-// simple text now to supply any querys for that which don't require
+// simple text now to supply any queries for that which don't require
 // creation of a full Caption
 rInitData.maSimpleText = rInitData.mxGenerator->GetSimpleText();
 


[Libreoffice-commits] core.git: sc/source

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

New commits:
commit f2febdd756723a5835f98ca8cd749d51875f8bcc
Author: Henry Castro 
AuthorDate: Fri Aug 11 09:11:09 2023 -0400
Commit: Henry Castro 
CommitDate: Sun Aug 13 16:38:38 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 
(cherry picked from commit f4f171506dc64a288344cb3c1eacc2c2d53283e8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155591
Tested-by: Jenkins

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: sc/source

2023-08-12 Thread Noel Grandin (via logerrit)
 sc/source/ui/cctrl/checklistmenu.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d635e73308dc6fcea9897855b5167be09f52f840
Author: Noel Grandin 
AuthorDate: Sat Aug 12 17:38:54 2023 +0200
Commit: Noel Grandin 
CommitDate: Sat Aug 12 22:00:27 2023 +0200

tdf#156686 AutoFilter arrows have white background in kf5/gen

regression from
commit 81994cb2b8b32453a92bcb011830fcb884f22ff3
Author: Noel Grandin
Date:   Fri Apr 16 20:33:10 2021 +0200
Convert internal vcl bitmap formats transparency->alpha (II)

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

diff --git a/sc/source/ui/cctrl/checklistmenu.cxx 
b/sc/source/ui/cctrl/checklistmenu.cxx
index 2ff0e4a4dc00..92e7096fc25a 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -180,7 +180,7 @@ void ScCheckListMenuControl::CreateDropDown()
 aSpinColor = rStyleSettings.GetDarkShadowColor();
 
 int nWidth = (mxMenu->get_text_height() * 3) / 4;
-mxDropDown->SetOutputSizePixel(Size(nWidth, nWidth));
+mxDropDown->SetOutputSizePixel(Size(nWidth, nWidth), /*bErase*/true, 
/*bAlphaMaskTransparent*/true);
 DecorationView aDecoView(mxDropDown.get());
 aDecoView.DrawSymbol(tools::Rectangle(Point(0, 0), Size(nWidth, nWidth)),
  SymbolType::SPIN_RIGHT, aSpinColor,


[Libreoffice-commits] core.git: sc/source

2023-08-11 Thread Caolán McNamara (via logerrit)
 sc/source/filter/oox/commentsbuffer.cxx |   43 +---
 1 file changed, 34 insertions(+), 9 deletions(-)

New commits:
commit e11a0e646b8eb75e102f878dc70f5196c4efbea2
Author: Caolán McNamara 
AuthorDate: Fri Aug 11 12:32:09 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Aug 11 18:13:48 2023 +0200

rearrange to collect the properties set on the annotation together

and set them in one block. No behavior change intended.

note: type passed as TextFitToSize seems to be wrong
Change-Id: I349aeba5176ef6c10163069a73d0367469aadd6b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155588
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/filter/oox/commentsbuffer.cxx 
b/sc/source/filter/oox/commentsbuffer.cxx
index 55bcb7e2cc73..9307ad707006 100644
--- a/sc/source/filter/oox/commentsbuffer.cxx
+++ b/sc/source/filter/oox/commentsbuffer.cxx
@@ -169,10 +169,11 @@ void Comment::finalizeImport()
 // setting a property triggers expensive process, so set them all at 
once
 
 // Add shape formatting properties (autoFill, colHidden and rowHidden 
are dropped)
-static_cast(xAnnoShape.get())->setPropertyValues(
-Sequence { "TextFitToSize", "MoveProtect", 
"TextHorizontalAdjust", "TextVerticalAdjust" },
-Sequence { Any(maModel.mbAutoScale), Any(maModel.mbLocked),
-Any(lcl_ToHorizAlign( maModel.mnTHA )), Any(lcl_ToVertAlign( 
maModel.mnTVA )) });
+// vvv TODO vvv TextFitToSize should be a drawing::TextFitToSizeType 
not bool
+Sequence aPropertyNames{ "TextFitToSize", "MoveProtect", 
"TextHorizontalAdjust", "TextVerticalAdjust" };
+Sequence aPropertyValues{ Any(maModel.mbAutoScale), 
Any(maModel.mbLocked),
+Any(lcl_ToHorizAlign( maModel.mnTHA )), Any(lcl_ToVertAlign( 
maModel.mnTVA )) };
+
 if( maModel.maAnchor.Width > 0 && maModel.maAnchor.Height > 0 )
 {
 xAnnoShape->setPosition( css::awt::Point( maModel.maAnchor.X, 
maModel.maAnchor.Y ) );
@@ -191,18 +192,42 @@ void Comment::finalizeImport()
 xAnnoShape->setSize(css::awt::Size(aShapeRect.Width, 
aShapeRect.Height));
 
 ::oox::drawingml::ShapePropertyMap 
aPropMap(pVmlNoteShape->makeShapePropertyMap());
-css::uno::Reference xShape(xAnnoShape);
-PropertySet(xShape).setProperties(aPropMap);
+
+Sequence aVMLPropNames;
+Sequence aVMLPropValues;
+aPropMap.fillSequences(aVMLPropNames, aVMLPropValues);
+
+sal_uInt32 nOldPropLen = aPropertyNames.getLength();
+sal_uInt32 nVMLPropLen = aVMLPropNames.getLength();
+aPropertyNames.realloc(nOldPropLen + nVMLPropLen);
+aPropertyValues.realloc(nOldPropLen + nVMLPropLen);
+OUString* pNames = aPropertyNames.getArray();
+Any* pValues = aPropertyValues.getArray();
+for (sal_uInt32 i = 0; i < nVMLPropLen; ++i)
+{
+pNames[nOldPropLen + i] = aVMLPropNames[i];
+pValues[nOldPropLen + i] = aVMLPropValues[i];
+}
 }
+
 // visibility
 bVisible = pVmlNoteShape->getTypeModel().mbVisible;
 
 // Setting comment text alignment
 const ::oox::vml::ClientData* xClientData = 
pVmlNoteShape->getClientData();
-static_cast(xAnnoShape.get())->setPropertyValues(
-Sequence { "TextVerticalAdjust", "ParaAdjust" },
-Sequence { Any(lcl_ToVertAlign( xClientData->mnTextVAlign 
)), Any(lcl_ToParaAlign( xClientData->mnTextHAlign )) });
+sal_uInt32 nOldPropLen = aPropertyNames.getLength();
+aPropertyNames.realloc(nOldPropLen + 2);
+aPropertyValues.realloc(nOldPropLen + 2);
+OUString* pNames = aPropertyNames.getArray();
+Any* pValues = aPropertyValues.getArray();
+pNames[nOldPropLen] = "TextVerticalAdjust";
+pValues[nOldPropLen] <<= 
lcl_ToVertAlign(xClientData->mnTextVAlign);
+pNames[nOldPropLen + 1] = "ParaAdjust";
+pValues[nOldPropLen + 1] <<= lcl_ToParaAlign( 
xClientData->mnTextHAlign);
 }
+
+
static_cast(xAnnoShape.get())->setPropertyValues(aPropertyNames, 
aPropertyValues);
+
 if (bVisible)
 pDocShell->GetDocFunc().ShowNote( maModel.maRange.aStart, bVisible 
);
 


[Libreoffice-commits] core.git: sc/source

2023-08-11 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 de20853e5243843ac9f4c5927ce0b4cf0e407c15
Author: Caolán McNamara 
AuthorDate: Thu Aug 10 21:49:59 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Aug 11 18:11:47 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 

diff --git a/sc/source/filter/inc/workbookhelper.hxx 
b/sc/source/filter/inc/workbookhelper.hxx
index 7b3047759329..8e2aa221241a 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
@@ -235,6 +281,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 25f273b1e1f2..e38b5cd13002 100644
--- a/sc/source/filter/oox/stylesbuffer.cxx
+++ b/sc/source/filter/oox/stylesbuffer.cxx
@@ -793,44 +793,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
-xFont->hasGlyphs( OUString( u'\xA001' ) ) ||// A001-A48F: Yi 
Syllables
-xFont->hasGlyphs( OUString( u'\xAC01' ) ) ||// AC00-D7AF: Hangul 
Syllables
-xFont->hasGlyphs( OUString( u'\xCC01' ) ) 

[Libreoffice-commits] core.git: sc/source

2023-08-11 Thread Caolán McNamara (via logerrit)
 sc/source/ui/undo/undoblk.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit fa3cfa7ac8b9000aec943e13dc75f8d3828685b4
Author: Caolán McNamara 
AuthorDate: Fri Aug 11 11:00:49 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Aug 11 18:11:15 2023 +0200

cid#1539806 Dereference after null check

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

diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index 0ef3e22f66b1..d352ba143ba8 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -1148,8 +1148,10 @@ void ScUndoPaste::DoChange(bool bUndo)
 pDocShell->PostPaint(aDrawRanges, nPaint, nExtFlags);
 
 pDocShell->PostDataChanged();
-if (pViewShell)
-pViewShell->CellContentChanged();
+if (!pViewShell)
+return;
+
+pViewShell->CellContentChanged();
 
 if (bColsAffected || bRowsAffected)
 ScTabViewShell::notifyAllViewsSheetGeomInvalidation(


[Libreoffice-commits] core.git: sc/source

2023-08-11 Thread Noel Grandin (via logerrit)
 sc/source/ui/app/inputhdl.cxx |   15 ++-
 1 file changed, 6 insertions(+), 9 deletions(-)

New commits:
commit 5484657d2b1677b7e385ab6ef87ad64dcb9934e4
Author: Noel Grandin 
AuthorDate: Thu Aug 10 17:42:12 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Aug 11 09:58:43 2023 +0200

tdf#156209 Font size increases when copying from cell in edit mode

Regression from  0558926c2f9201a12b4c46efc36b8a4080af4d46
"use more officecfg for SvtMiscOptions".

However even reverting the above commit does not fix the problem.
This is because there is an underlying latent bug, where depending on the 
order of initialisation of various and when they fire events, we can end up 
calling the alternative path in ScInputHandler::ImplCreateEditEngine which 
creates a pool via EditEngine::CreatePool(), which ends up having the "wrong" 
default map unit. And then that pool sticks around even after we have a 
document, and causes the reported bug.

Solve it by simply not initialising the pool until we have an associated 
document, which is fine, since we don't actually need the pool until then.


Change-Id: If012c82df225e59dca828556bfca84c1948b5887
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155560
Tested-by: Noel Grandin 
Reviewed-by: Noel Grandin 

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 3351408459a9..1267509d4e5f 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -928,14 +928,10 @@ void ScInputHandler::ImplCreateEditEngine()
 if ( mpEditEngine )
 return;
 
-if ( pActiveViewSh )
-{
-ScDocument& rDoc = 
pActiveViewSh->GetViewData().GetDocShell()->GetDocument();
-mpEditEngine = std::make_unique(, 
rDoc.GetEnginePool(), rDoc.GetEditPool());
-}
-else
-mpEditEngine = std::make_unique(nullptr, 
EditEngine::CreatePool().get(), nullptr, true);
-
+// we cannot create a properly initialised EditEngine until we have a 
document
+assert( pActiveViewSh );
+ScDocument& rDoc = 
pActiveViewSh->GetViewData().GetDocShell()->GetDocument();
+mpEditEngine = std::make_unique(, 
rDoc.GetEnginePool(), rDoc.GetEditPool());
 mpEditEngine->SetWordDelimiters( ScEditUtil::ModifyDelimiters( 
mpEditEngine->GetWordDelimiters() ) );
 UpdateRefDevice();  // also sets MapMode
 mpEditEngine->SetPaperSize( Size( 100, 100 ) );
@@ -4197,7 +4193,8 @@ void ScInputHandler::NotifyChange( const ScInputHdlState* 
pState,
 else
 pActiveViewSh = dynamic_cast( SfxViewShell::Current() 
);
 
-ImplCreateEditEngine();
+if (pActiveViewSh)
+ImplCreateEditEngine();
 
 if ( pState != pLastState.get() )
 {


[Libreoffice-commits] core.git: 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 e4e080086e76a0bedd7ce62dc610889dc5c86401
Author: Henry Castro 
AuthorDate: Wed Aug 9 16:48:42 2023 -0400
Commit: Henry Castro 
CommitDate: Thu Aug 10 21:32:27 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 
(cherry picked from commit ebd1a4d6fc3f9ba533a29fa54acf7b3b41c398d5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155483
Tested-by: Jenkins

diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index ae7a33bfdf49..f3b4b3ca9be2 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: 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 0ccb2ace2825015873cbae550acc83a29cfbb18e
Author: Henry Castro 
AuthorDate: Tue Jul 18 15:15:41 2023 -0400
Commit: Tomaž Vajngerl 
CommitDate: Tue Aug 8 16:43:55 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/+/153657
Tested-by: Jenkins
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: 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 b6edb8e053005cf9a65aa118c4496c25c073e9d0
Author: Caolán McNamara 
AuthorDate: Tue Aug 1 16:34:56 2023 +0100
Commit: Tomaž Vajngerl 
CommitDate: Fri Aug 4 15:39:40 2023 +0200

cool#6911 draw the note indicator browser-side

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

diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index c43a903484cd..ae7a33bfdf49 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;
 
 tools::Long nInitPosX = nScrX;
 if ( bLayoutRTL )


  1   2   3   4   5   6   7   8   9   10   >