core.git: Branch 'libreoffice-25-8' - sc/source

2026-01-27 Thread Xisco Fauli (via logerrit)
 sc/source/ui/drawfunc/fuins2.cxx |   36 
 1 file changed, 20 insertions(+), 16 deletions(-)

New commits:
commit 3537eeaf33bf69e8cf52e0c2ada414c0fc77
Author: Xisco Fauli 
AuthorDate: Fri Jan 23 12:13:12 2026 +0100
Commit: Christian Lohmaier 
CommitDate: Tue Jan 27 15:04:34 2026 +0100

crashreporting: check xObj

like it's done a few lines above

Seen in 
https://crashreport.libreoffice.org/stats/crash_details/978290ff-67d0-4ad4-afdc-b1e79a58b7c2

Change-Id: Ic890513ba6f87b4172966ea004496cbaa755b2a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197941
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins
Tested-by: Caolán McNamara 
(cherry picked from commit 0dde33310b5c53b42e56850422a36273e7d5f7e2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198013
Reviewed-by: Christian Lohmaier 

diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index b5c00aa00d90..cfc738ad3d62 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -503,24 +503,28 @@ FuInsertChart::FuInsertChart(ScTabViewShell& rViewSh, 
vcl::Window* pWin, ScDrawV
 xChartModel->lockControllers();
 
 // object size
-awt::Size aSz = xObj->getVisualAreaSize( nAspect );
-Size aSize( aSz.Width, aSz.Height );
+Size aSize;
+if (xObj.is())
+{
+awt::Size aSz = xObj->getVisualAreaSize( nAspect );
+aSize = Size( aSz.Width, aSz.Height );
 
-MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( 
nAspect ) );
+MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( 
xObj->getMapUnit( nAspect ) );
 
-bool bSizeCh = false;
-if (aSize.IsEmpty())
-{
-aSize.setWidth( 5000 );
-aSize.setHeight( 5000 );
-bSizeCh = true;
-}
-if (bSizeCh)
-{
-aSize = OutputDevice::LogicToLogic( aSize, MapMode( 
MapUnit::Map100thMM ), MapMode( aMapUnit ) );
-aSz.Width = aSize.Width();
-aSz.Height = aSize.Height();
-xObj->setVisualAreaSize( nAspect, aSz );
+bool bSizeCh = false;
+if (aSize.IsEmpty())
+{
+aSize.setWidth( 5000 );
+aSize.setHeight( 5000 );
+bSizeCh = true;
+}
+if (bSizeCh)
+{
+aSize = OutputDevice::LogicToLogic( aSize, MapMode( 
MapUnit::Map100thMM ), MapMode( aMapUnit ) );
+aSz.Width = aSize.Width();
+aSz.Height = aSize.Height();
+xObj->setVisualAreaSize( nAspect, aSz );
+}
 }
 
 ScViewData& rData = rViewSh.GetViewData();


core.git: Branch 'libreoffice-25-8' - sc/source

2026-01-19 Thread Ilmari Lauhakangas (via logerrit)
 sc/source/ui/miscdlgs/linkarea.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit cabded5bde897bf627f1ede3e1835e18fadffd83
Author: Ilmari Lauhakangas 
AuthorDate: Sat Jan 17 19:06:34 2026 +0200
Commit: Xisco Fauli 
CommitDate: Mon Jan 19 11:41:56 2026 +0100

tdf#168132 Make sure ranges do not show as disabled in Calc's

External Data dialog

Change-Id: I5cc64cea920f778e33f0a3e28e082839ceb8314a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197509
Reviewed-by: Noel Grandin 
Tested-by: Ilmari Lauhakangas 
Reviewed-by: Ilmari Lauhakangas 
Tested-by: Jenkins
(cherry picked from commit c6028a9ce60f25027b2901e9cc03b3a8f8883810)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197520
(cherry picked from commit 23c58b0b95ba30dbe67ab451f07ddc2ef9e2070e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197554
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/ui/miscdlgs/linkarea.cxx 
b/sc/source/ui/miscdlgs/linkarea.cxx
index ca559e626aff..c02610c4fc30 100644
--- a/sc/source/ui/miscdlgs/linkarea.cxx
+++ b/sc/source/ui/miscdlgs/linkarea.cxx
@@ -266,8 +266,10 @@ void ScLinkedAreaDlg::UpdateSourceRanges()
 
 m_xLbRanges->thaw();
 
-if (m_xLbRanges->n_children() >= 1)
+if (m_xLbRanges->n_children() >= 1) {
 m_xLbRanges->select(0);
+m_xLbRanges->set_sensitive(true);
+}
 else
 {
 m_xLbRanges->append_text(ScResId(STR_NO_NAMED_RANGES_AVAILABLE));


core.git: Branch 'libreoffice-25-8' - sc/source

2025-12-22 Thread Karthik Godha (via logerrit)
 sc/source/filter/excel/xistyle.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 90d7dd49195a05b23e0a952f6984bcb26bec4e42
Author: Karthik Godha 
AuthorDate: Thu Dec 18 14:36:03 2025 +0530
Commit: Xisco Fauli 
CommitDate: Mon Dec 22 14:11:39 2025 +0100

Sanitize font size read from XLS

This is related to commit 28273e586b398e2ce181c4ce9e740949fad11876

Change-Id: I182c27b6a9f796bf949246a2038c318dec755c33
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195831
Reviewed-by: Michael Stahl 
Tested-by: Jenkins CollaboraOffice 
(cherry picked from commit 50ef3ac17ab884fff1518d90d161b1e6d7bff8c0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195892
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins
(cherry picked from commit 2d273469ebe0c0e3c8a44b16690a218d367614ac)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196071
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/filter/excel/xistyle.cxx 
b/sc/source/filter/excel/xistyle.cxx
index caa55afd7edb..3ccb3f7899fe 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -272,6 +272,10 @@ void XclImpFont::ReadFont( XclImpStream& rStrm )
 DBG_ERROR_BIFF();
 return;
 }
+
+constexpr sal_uInt16 MIN_FONT_HEIGHT_1_20th_PT = 20;
+maData.mnHeight = std::max(maData.mnHeight, MIN_FONT_HEIGHT_1_20th_PT);
+
 GuessScriptType();
 SetAllUsedFlags( true );
 }


core.git: Branch 'libreoffice-25-8' - sc/source

2025-12-19 Thread Justin Luth (via logerrit)
 sc/source/filter/xml/xmlexprt.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 791bdef1573d7f5bb36e41aebb73436ac2ea2e14
Author: Justin Luth 
AuthorDate: Wed Dec 17 14:17:31 2025 -0500
Commit: Xisco Fauli 
CommitDate: Fri Dec 19 10:07:58 2025 +0100

tdf#170012 sc drwlayer: avoid crash on ODS save

This fixes a crash since 7.1
commit 1f0b3c7a40edfa81bbc7a58d123a6a2dfd83e4ca

Instead of trying to save as a broken SCA_CELL_RESIZE
it will save as a SCA_PAGE anchored object.

The crash was occuring when saving to ODS format.
It would loop forever because of the invalid address
that GetNonRotatedObjData got during RecalcPos
when it had been created but never "initialized".

(An earlier patchset tried to force initialization
and assert that, but I got tons of asserts in unit tests
because of detfunc's bCreate without
ScDrawLayer::InitializeCellAnchoredObj).
Plus, doing initialization correctly
sounds incomprehensible based on a code read.

[Unit test removed because it depends on xlsx
importing correctly - which doesn't work in 25.8.]

Change-Id: Ief717c8742d712bf2edec90f492fd258f9fd7741
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195807
Tested-by: Jenkins
Reviewed-by: Justin Luth 
(cherry picked from commit cbd9d23b7b953fdf53d66aaa072bab17db7905d3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195861
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195873
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/filter/xml/xmlexprt.cxx 
b/sc/source/filter/xml/xmlexprt.cxx
index 1d2f86cdb4aa..b9ec718a7271 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -544,7 +544,8 @@ void ScXMLExport::CollectSharedData(SCTAB& nTableCount, 
sal_Int32& nShapesCount)
 if (!pSdrObj)
 continue;
 
-if (ScDrawObjData *pAnchor = 
ScDrawLayer::GetNonRotatedObjData(pSdrObj))
+ScDrawObjData* pAnchor = 
ScDrawLayer::GetNonRotatedObjData(pSdrObj);
+if (pAnchor && pAnchor->maStart.IsValid())
 {
 ScMyShape aMyShape;
 aMyShape.aAddress = pAnchor->maStart;


core.git: Branch 'libreoffice-25-8' - sc/source

2025-12-12 Thread Aron Budea (via logerrit)
 sc/source/filter/xcl97/xcl97esc.cxx |4 
 1 file changed, 4 deletions(-)

New commits:
commit 9ec6929930527e8a4eb4d9b97e72cdbcf91d1ca0
Author: Aron Budea 
AuthorDate: Mon Apr 21 16:57:28 2025 +0930
Commit: Xisco Fauli 
CommitDate: Fri Dec 12 11:23:39 2025 +0100

Revert "tdf#164141 Fix command button xls to xlsx convert problem."

Exporting ActiveX objects is a big missing feature, and
this was more of a workaround.

The invalid export originating from
fd238380ae7820f12ac1f7c52d0f7180a93f3ba3
...has later been resolved differently in:
ab45b8d9959f8f392a10d0874c50f26b816a4da8

This reverts commit ab62d75141192a73dcd6862e37753bc1c3f82576.

Change-Id: I5e40759595e65a8778abbb521bdc146517afc949
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184975
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Aron Budea 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195195
Tested-by: Jenkins
(cherry picked from commit 5c032407baf1952fab7a704b41b8ac8c18f978b0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195250
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/filter/xcl97/xcl97esc.cxx 
b/sc/source/filter/xcl97/xcl97esc.cxx
index 525ddb1bf44e..b2f81453c667 100644
--- a/sc/source/filter/xcl97/xcl97esc.cxx
+++ b/sc/source/filter/xcl97/xcl97esc.cxx
@@ -240,11 +240,7 @@ EscherExHostAppData* XclEscherEx::StartShape( const 
Reference< XShape >& rxShape
 SAL_WARN("sc", "XclEscherEx::StartShape, this control can't 
get the property ControlTypeinMSO!");
 }
 if( nMsCtlType == 2 )  //OCX Form Control
-{
 pCurrXclObj = CreateOCXCtrlObj( rxShape, pChildAnchor 
).release();
-if(!pCurrXclObj) // Give a chance to handle control object 
with XclExpTbxControlObj instead of XclObjAny
-pCurrXclObj = CreateTBXCtrlObj( rxShape, pChildAnchor 
).release();
-}
 else  //TBX Form Control
 pCurrXclObj = CreateTBXCtrlObj( rxShape, pChildAnchor 
).release();
 if( !pCurrXclObj )


core.git: Branch 'libreoffice-25-8' - sc/source

2025-12-11 Thread Justin Luth (via logerrit)
 sc/source/filter/oox/workbooksettings.cxx |   20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

New commits:
commit e16cb27e31d445cbc608be4c10ba4320f4cdf18b
Author: Justin Luth 
AuthorDate: Wed Dec 3 16:14:52 2025 -0500
Commit: Xisco Fauli 
CommitDate: Thu Dec 11 09:36:48 2025 +0100

related tdf#165180 oox: dateCompatibility not usable in LO

This patch will be needed in order to round-trip
the Excel 2010+ filter (ISOIEC_29500_2008).
We can't use dateCompatibility because
we don't have a "strict xml" filter.

I've only triple checked this,
so I can't be sure that I've got this right.

WorkbookSettings::getNullDate is mostly dead code.

getOoxFilter().getVersion() == oox::core::ISOIEC_29500_2008
can only be true when the import filter is
Calc Office Open XML Spreadsheet
but that never happens because filterdetect.cxx
if( rContentType == u"...spreadsheetml.sheet.main+xml")
returns "MS Excel 2007 XML"_ustr;
and calc_MS_Excel_2007_XML.xcu doesn't define

so it is considered to be a zero, which means that
 mxImpl->meVersion = OoxmlVersion( 0 );
which is oox::core::ECMA_376_1ST_EDITION

So getVersion for XLSX will never equal ISOIEC_29500_2008
and thus the code this patch deletes has never been executed.

Plus, our code was wrong. dateCompatibility only briefly
made it into the ISO transitional standards before it disappeared.
> mstahl:6:35 AM  we are puzzled by an attribute dateCompatibility
> that is written by Calc since a commit
> "Merged ooxml-sc-page-date.diff from ooo-build"
> and was added to ECMA-376 3rd ed.
> then removed (without explanation) from ECMA-376 4th ed.

Excel only creates dateCompatibility when saving as "Strict Open XML",
but we don't support OOXMLVariant::ISO_Strict.
It seems to be ignored by Excel for non-strict formats.

Plus, it wouldn't be needed by LO.
Excel does not correctly display dates prior to Mar 1, 1900
because it uses the old Lotus logic that treats
1900 as a leap year, which it isn't.
dateCompatibility="0" seems designed to tell Excel
to consider Feb 29 1900 as an invalid date.
LO never treats 1900 as a leap year (so no Feb 29, 1900),
so our (accurate) dates do not match Excel.
(That isn't a big deal because Excel starts at Jan 1 1900
 and is only wrong for the first two months,
 so we only don't match for the first 2 months of 1900.)

Change-Id: I19ca19334e1f13da010bf09d4c5d9a32aea3a091
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194969
Reviewed-by: Justin Luth 
Tested-by: Jenkins
(cherry picked from commit 5f9d0cf0ce3a9b06138bbab62fcd3e6c89c9e339)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195114
(cherry picked from commit f591c12800aa63dba29230886712617c2e7eba7e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195158
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/filter/oox/workbooksettings.cxx 
b/sc/source/filter/oox/workbooksettings.cxx
index bb7269d9702f..2308c644e6fa 100644
--- a/sc/source/filter/oox/workbooksettings.cxx
+++ b/sc/source/filter/oox/workbooksettings.cxx
@@ -269,18 +269,18 @@ sal_Int16 WorkbookSettings::getApiShowObjectMode() const
 
 css::util::Date const & WorkbookSettings::getNullDate() const
 {
-static const css::util::Date saDate1900 ( 30, 12, 1899 );
-static const css::util::Date saDate1904 ( 1, 1, 1904 );
-static const css::util::Date saDateBackCompatibility1900( 31, 12, 1899 );
+// Excel (inacurrately) treats Feb 29, 1900 as a valid date (for 
compatibility with Lotus).
+// AFAICS, only Strict .xlsx treats that date as invalid
+// (regardless of whether dateCompatibility="0" or "1").
+// Thus the only purpose of dateCompatibility="1" is to determine the 
oldest recognizable date
+// which will be Jan 1 1904 if date1904="true", otherwise it will be Jan 1 
1900.
 
-if( getOoxFilter().getVersion() == oox::core::ISOIEC_29500_2008 )
-{
-if( !maBookSettings.mbDateCompatibility )
-return saDate1900;
+// LO never treats 1900 as a leap year (so we never match Excel's first 
two months of 1900),
+// and doesn't have an earliest recognizable date limitation.
+// The day-early null date of Dec 30 1899 takes care of the extra leap-day 
that Excel inserts.
 
-return maBookSettings.mbDateMode1904 ? saDate1904 :
-   saDateBackCompatibility1900;
-}
+static const css::util::Date saDate1900 ( 30, 12, 1899 );
+static const css::util::Date saDate1904 ( 1, 1, 1904 );
 
 return maBookSettings.mbDateMode1904 ? saDate1904 : saDate1900;
 }


core.git: Branch 'libreoffice-25-8' - sc/source

2025-12-04 Thread Regina Henschel (via logerrit)
 sc/source/ui/dataprovider/dataprovider.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f9e5580569e3ad705d19fe74faeedb56a9ecc4b2
Author: Regina Henschel 
AuthorDate: Thu Dec 4 14:00:54 2025 +0100
Commit: Xisco Fauli 
CommitDate: Thu Dec 4 16:56:46 2025 +0100

tdf#169817 dataprovider insert to correct sheet

Change-Id: I6bd0991cff314abff615371ddba3aa978a442df5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194997
Reviewed-by: Regina Henschel 
Tested-by: Jenkins
(cherry picked from commit 13625af3857ae00d341871767b29dbc629d578e0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195009
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/ui/dataprovider/dataprovider.cxx 
b/sc/source/ui/dataprovider/dataprovider.cxx
index 75a9a2342bd6..1a31a1afddaf 100644
--- a/sc/source/ui/dataprovider/dataprovider.cxx
+++ b/sc/source/ui/dataprovider/dataprovider.cxx
@@ -240,7 +240,7 @@ void ScDBDataManager::WriteToDoc(ScDocument& rDoc)
 aDestRange.aEnd.SetRow(aDestRange.aStart.Row() + nRowSize);
 
 ScMarkData aMark(mpDoc->GetSheetLimits());
-aMark.SelectTable(0, true);
+aMark.SelectTable(aDestRange.aStart.Tab(), true);
 mpDoc->CopyFromClip(aDestRange, aMark, InsertDeleteFlags::CONTENTS, 
nullptr, &rDoc);
 ScDocShell* pDocShell = mpDoc->GetDocumentShell();
 if (pDocShell)


core.git: Branch 'libreoffice-25-8' - sc/source

2025-12-01 Thread Regina Henschel (via logerrit)
 sc/source/ui/miscdlgs/dataproviderdlg.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 56e1b57bd921c2dcaa4bb5932b38ea6c93eb49bd
Author: Regina Henschel 
AuthorDate: Fri Nov 28 15:50:43 2025 +0100
Commit: Xisco Fauli 
CommitDate: Mon Dec 1 15:43:59 2025 +0100

tdf#169077 dataproviderdlg setID expects mxEditID

maID needs to contain the string from mxEditID. In content it needs to
be the XPath to the desired table element in the imported source.
You can see the use of this element in the already working unit test
ScDataProvidersTest::testHTMLImport

Change-Id: If4de7fa345205e5afc2d93a198d88b6788be3700
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194789
Tested-by: Jenkins
Reviewed-by: Regina Henschel 
(cherry picked from commit 9187f38b48956acc892fbf3e7fe0d1942fcfb6f2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194879
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/ui/miscdlgs/dataproviderdlg.cxx 
b/sc/source/ui/miscdlgs/dataproviderdlg.cxx
index 7d4e851c48ab..0be34cbbe0ec 100644
--- a/sc/source/ui/miscdlgs/dataproviderdlg.cxx
+++ b/sc/source/ui/miscdlgs/dataproviderdlg.cxx
@@ -896,7 +896,7 @@ sc::ExternalDataSource 
ScDataProviderDlg::getDataSource(ScDocument* pDoc)
 {
 sc::ExternalDataSource aSource(mxEditURL->get_text(), 
mxProviderList->get_active_id(), pDoc);
 
-aSource.setID(mxProviderList->get_active_id());
+aSource.setID(mxEditID->get_text());
 return aSource;
 }
 


core.git: Branch 'libreoffice-25-8' - sc/source

2025-11-27 Thread Markus Mohrhard (via logerrit)
 sc/source/filter/excel/xepivotxml.cxx |   42 ++
 1 file changed, 23 insertions(+), 19 deletions(-)

New commits:
commit a62e6c819192d77251a9643dc229b82fcdcc6c91
Author: Markus Mohrhard 
AuthorDate: Sun Jul 20 05:19:40 2025 +0800
Commit: Xisco Fauli 
CommitDate: Thu Nov 27 16:34:24 2025 +0100

tdf#158921: fix invalid OOXML during pivot table export

Change-Id: Ie3f0fb7302c21d56fedff8db3f2b1c2b7a5805eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188079
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard 
(cherry picked from commit b5837d2667c2be2c485753f9cf75e84032a15f74)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194211
Reviewed-by: Xisco Fauli 
Code-Style: Xisco Fauli 

diff --git a/sc/source/filter/excel/xepivotxml.cxx 
b/sc/source/filter/excel/xepivotxml.cxx
index bbb9957ee1e9..99cf0024043e 100644
--- a/sc/source/filter/excel/xepivotxml.cxx
+++ b/sc/source/filter/excel/xepivotxml.cxx
@@ -1066,29 +1066,33 @@ void XclExpXmlPivotTables::SavePivotTableXml( 
XclExpXmlStream& rStrm, const ScDP
 pAttList->add( XML_outline, ToPsz10(false));
 pPivotStrm->startElement(XML_pivotField, pAttList);
 
-pPivotStrm->startElement(XML_items,
-XML_count, 
OString::number(static_cast(aMemberSequence.size() + 
aSubtotalSequence.size(;
-
-for (const auto & nMember : aMemberSequence)
+sal_uInt32 nItems = aMemberSequence.size() + aSubtotalSequence.size();
+if (nItems > 0)
 {
-auto pItemAttList = 
sax_fastparser::FastSerializerHelper::createAttrList();
-if (nMember.second)
-pItemAttList->add(XML_h, ToPsz10(true));
-pItemAttList->add(XML_x, 
OString::number(static_cast(nMember.first)));
-pPivotStrm->singleElement(XML_item, pItemAttList);
-}
+pPivotStrm->startElement(XML_items,
+XML_count, OString::number(nItems));
 
-if (strcmp(toOOXMLAxisType(eOrient), "axisCol") == 0)
-nColItemsCount = pivotTableColCount - nFirstDataCol;
-else if (strcmp(toOOXMLAxisType(eOrient), "axisRow") == 0)
-nRowItemsCount = pivotTableRowCount - nFirstDataRow;
+for (const auto & nMember : aMemberSequence)
+{
+auto pItemAttList = 
sax_fastparser::FastSerializerHelper::createAttrList();
+if (nMember.second)
+pItemAttList->add(XML_h, ToPsz10(true));
+pItemAttList->add(XML_x, 
OString::number(static_cast(nMember.first)));
+pPivotStrm->singleElement(XML_item, pItemAttList);
+}
 
-for (const OString& sSubtotal : aSubtotalSequence)
-{
-pPivotStrm->singleElement(XML_item, XML_t, sSubtotal);
-}
+if (strcmp(toOOXMLAxisType(eOrient), "axisCol") == 0)
+nColItemsCount = pivotTableColCount - nFirstDataCol;
+else if (strcmp(toOOXMLAxisType(eOrient), "axisRow") == 0)
+nRowItemsCount = pivotTableRowCount - nFirstDataRow;
 
-pPivotStrm->endElement(XML_items);
+for (const OString& sSubtotal : aSubtotalSequence)
+{
+pPivotStrm->singleElement(XML_item, XML_t, sSubtotal);
+}
+
+pPivotStrm->endElement(XML_items);
+}
 pPivotStrm->endElement(XML_pivotField);
 }
 


core.git: Branch 'libreoffice-25-8' - sc/source

2025-11-24 Thread Justin Luth (via logerrit)
 sc/source/ui/view/gridwin4.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 45a0bb0d209d6b5ace519ed13de890f79e43fe9a
Author: Justin Luth 
AuthorDate: Fri Nov 21 12:01:27 2025 -0500
Commit: Xisco Fauli 
CommitDate: Mon Nov 24 13:03:52 2025 +0100

tdf#150150 Revert "draw Note mark before text for correct ZOrder"

This reverts 5.0 commit 2d1abfff0156c17cdaabf27c01e92b5e3f0bbbf4.

The comment marker is not nearly as obstructive
as it was back in 5.0 days.

Change-Id: Id5596be2ede154e5c9302a23853b5fcaf724c1c7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194343
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194429

diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 7a828e5c6a87..ce688f9855da 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -936,10 +936,6 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, 
const ScTableInfo& rTableI
 
 aOutputData.DrawSparklines(*pContentDev);
 
-// Show Note Mark
-if ( rOpts.GetOption( VOPT_NOTES ) )
-aOutputData.DrawNoteMarks(*pContentDev);
-
 if ( rOpts.GetOption( VOPT_FORMULAS_MARKS ) )
 aOutputData.DrawFormulaMarks(*pContentDev);
 
@@ -970,6 +966,10 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, 
const ScTableInfo& rTableI
 // Autofilter- and Pivot-Buttons
 DrawButtons(nX1, nX2, rTableInfo, pContentDev, pLokRTLCtxt.get()); 
 // Pixel
 
+// Show Note Mark
+if ( rOpts.GetOption( VOPT_NOTES ) )
+aOutputData.DrawNoteMarks(*pContentDev);
+
 pContentDev->SetMapMode(MapMode(MapUnit::MapPixel));
 
 aOutputData.DrawClipMarks();


core.git: Branch 'libreoffice-25-8' - sc/source

2025-11-18 Thread Markus Mohrhard (via logerrit)
 sc/source/filter/excel/xecontent.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d925471eca8d88c571777833f0aa6b9492b3b080
Author: Markus Mohrhard 
AuthorDate: Tue Nov 18 15:27:46 2025 +0800
Commit: Xisco Fauli 
CommitDate: Tue Nov 18 21:10:53 2025 +0100

tdf#164334: fix OOXML export of cond format tomorrow condition

Change-Id: I0ece55bb94b6b7086ab6c728d0bf416cc4f221e6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194140
Reviewed-by: Markus Mohrhard 
Tested-by: Jenkins
(cherry picked from commit 12def302eb518bec27bf8a6f6234ed88b945e2f5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194168
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/filter/excel/xecontent.cxx 
b/sc/source/filter/excel/xecontent.cxx
index c2da396ea972..9de0d67f76f5 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -1163,7 +1163,7 @@ const char* getTimePeriodString( 
condformat::ScCondFormatDateType eType )
 case condformat::YESTERDAY:
 return "yesterday";
 case condformat::TOMORROW:
-return "yesterday";
+return "tomorrow";
 case condformat::THISWEEK:
 return "thisWeek";
 case condformat::LASTWEEK:


core.git: Branch 'libreoffice-25-8' - sc/source

2025-11-06 Thread Noel Grandin (via logerrit)
 sc/source/filter/excel/xeescher.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 361858d734c92ce26f58ad78a16ea5ca4a82c28e
Author: Noel Grandin 
AuthorDate: Wed Nov 5 10:58:49 2025 +0200
Commit: Xisco Fauli 
CommitDate: Thu Nov 6 14:56:35 2025 +0100

mso-test: escape text of a:t element

This is using the test document from tdf 111408-1.odt.
When importing and exporting to XLSX, we end up with an unescaped "&" 
character.

Change-Id: I25e8952049cc0f9665030b46e7d29d2397d9f9bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193448
Reviewed-by: Michael Stahl 
Tested-by: Jenkins CollaboraOffice 
(cherry picked from commit 47e2188d4bab1509d059c4df53df7f49324bea2d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193509
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit 196b3fe18948b1c6b6afe78d171a62513bc21980)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193532
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/filter/excel/xeescher.cxx 
b/sc/source/filter/excel/xeescher.cxx
index d9bc7f3ea56d..7ea8f6a685f5 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -1370,7 +1370,7 @@ void XclExpTbxControlObj::SaveXml( XclExpXmlStream& rStrm 
)
 pDrawing->startElementNS(XML_a, XML_p);
 pDrawing->startElementNS(XML_a, XML_r);
 pDrawing->startElementNS(XML_a, XML_t);
-pDrawing->write(msLabel);
+pDrawing->writeEscaped(msLabel);
 pDrawing->endElementNS(XML_a, XML_t);
 pDrawing->endElementNS(XML_a, XML_r);
 pDrawing->endElementNS(XML_a, XML_p);


core.git: Branch 'libreoffice-25-8' - sc/source

2025-11-04 Thread Michael Weghorn (via logerrit)
 sc/source/ui/condformat/condformatdlg.cxx |5 +
 sc/source/ui/inc/condformatdlgentry.hxx   |1 +
 2 files changed, 6 insertions(+)

New commits:
commit fbef49982f2f4943685495cfdb150c46ce5b7527
Author: Michael Weghorn 
AuthorDate: Tue Nov 4 19:35:47 2025 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Nov 5 08:13:04 2025 +0100

tdf#169006 sc a11y: Keep keyboard focus in conditional formatting dlg

In ScCondFormatList::AfterTypeListHdl, the existing
ScCondFrmtEntry can be deleted, and with it, its combobox
indicating the type, and a new ScCondFrmtEntry created
to replace it.

In the case that combobox was focused (which is usually
the case, because ScCondFormatList::AfterTypeListHdl
is the handler that gets called when the active entry
changes), then make sure that its combobox for the
type takes over/receives keyboard focus, so the user
can continue in the "same" (from their perspective)
place.

While the case of gtk3 with native GTK widgets and
qt6 with SAL_VCL_QT_USE_WELDED_WIDGETS=1 to use native
Qt widgets would at least allow to move the keyboard
focus to somewhere in the dialog using the Tab key
previously, the vcl implementation would not allow
this, breaking keyboard accessibility of the dialog
altogether.

Change-Id: Iaa3e087cda078678d1f160ce8a49938b27e6528c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193431
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit 752adf6cc9d869bbcf34fcf09c80da502398cb81)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193432
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sc/source/ui/condformat/condformatdlg.cxx 
b/sc/source/ui/condformat/condformatdlg.cxx
index 1b0a6195f950..8c8000c712c6 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -264,6 +264,7 @@ IMPL_LINK(ScCondFormatList, AfterTypeListHdl, void*, p, 
void)
 if(itr == maEntries.end())
 return;
 
+const bool bFocused = pBox->has_focus();
 sal_Int32 nPos = pBox->get_active();
 switch(nPos)
 {
@@ -314,6 +315,10 @@ IMPL_LINK(ScCondFormatList, AfterTypeListHdl, void*, p, 
void)
 break;
 
 }
+
+if (bFocused)
+(*itr)->GetTypeComboBox().grab_focus();
+
 Thaw();
 RecalcAll();
 }
diff --git a/sc/source/ui/inc/condformatdlgentry.hxx 
b/sc/source/ui/inc/condformatdlgentry.hxx
index d3210b824212..afd109cedea0 100644
--- a/sc/source/ui/inc/condformatdlgentry.hxx
+++ b/sc/source/ui/inc/condformatdlgentry.hxx
@@ -74,6 +74,7 @@ public:
 virtual ~ScCondFrmtEntry();
 
 void Show() { mxGrid->show(); }
+weld::ComboBox& GetTypeComboBox() { return *mxLbType; }
 
 void set_grid_top_attach(int nAttach);
 int get_preferred_height() const { return 
mxBorder->get_preferred_size().Height(); }


core.git: Branch 'libreoffice-25-8' - sc/source

2025-11-03 Thread Pranam Lashkari (via logerrit)
 sc/source/core/data/validat.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit f60a4baee3852184da95c2947c910b485225d5fb
Author: Pranam Lashkari 
AuthorDate: Wed Oct 29 14:48:58 2025 +0530
Commit: Xisco Fauli 
CommitDate: Mon Nov 3 16:40:13 2025 +0100

tdf#168261: resume ScInputHandler even if error not displayed

problem:
regression from 72bbb0dd4a368dab2b1bd99917cd07d23a92a3f0
when data validity dialog was not displayed, error function returned early
this caused issue with cell invalid data cleaning and it was not possible
to enter new data in any new cell

to reproduce:
select data validity as list and also disable error message showing
enter the invalid data in the validity cell
subsequently its not possible to type in any cells

Change-Id: Ia2157ae57ca90dd9365daae7881640a00c3f1216
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193141
Reviewed-by: Pranam Lashkari 
Tested-by: Jenkins
(cherry picked from commit 65ca233db9a39fd251ffac46608bb2714949e894)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193356
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx
index 8b00dc3c98ea..7850c0e52304 100644
--- a/sc/source/core/data/validat.cxx
+++ b/sc/source/core/data/validat.cxx
@@ -382,8 +382,10 @@ void ScValidationData::DoError(weld::Window* pParent, 
const OUString& rInput, co
 return;
 }
 
-if (!bShowError)
+if (!bShowError) {
+callback(true);
 return;
+}
 
 //  Output error message
 


core.git: Branch 'libreoffice-25-8' - sc/source

2025-11-03 Thread Pranam Lashkari (via logerrit)
 sc/source/core/data/validat.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit d803223e55e5a762a6916e1c03459d931817ba70
Author: Pranam Lashkari 
AuthorDate: Thu Oct 30 15:20:21 2025 +0530
Commit: Xisco Fauli 
CommitDate: Mon Nov 3 16:39:50 2025 +0100

tdf#167126: resume ScInputHandler even if error not displayed

problem:
regression from 72bbb0dd4a368dab2b1bd99917cd07d23a92a3f0
when data validity dialog was not displayed, error function returned early
this caused issue with cell invalid data cleaning and it was not possible
to enter new data in any new cell

Change-Id: I612ea8b9c651afba1095fc14726e5398484207f5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193186
Reviewed-by: Pranam Lashkari 
Tested-by: Jenkins
(cherry picked from commit 0b9b82f41a1ff4cbbed6a7148b77cbc3b00c9716)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193355
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx
index 9c044ed697f6..8b00dc3c98ea 100644
--- a/sc/source/core/data/validat.cxx
+++ b/sc/source/core/data/validat.cxx
@@ -378,6 +378,7 @@ void ScValidationData::DoError(weld::Window* pParent, const 
OUString& rInput, co
 {
 if ( eErrorStyle == SC_VALERR_MACRO ) {
 DoMacro(rPos, rInput, nullptr, pParent);
+callback(true);
 return;
 }
 


core.git: Branch 'libreoffice-25-8' - sc/source

2025-10-30 Thread Regina Henschel (via logerrit)
 sc/source/filter/xml/xmlexprt.cxx   |2 +-
 sc/source/filter/xml/xmltransformationi.cxx |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 4ff6d294eac41288bce19b377c0a8857b8cb4992
Author: Regina Henschel 
AuthorDate: Fri Oct 24 00:58:41 2025 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Thu Oct 30 20:46:29 2025 +0100

tdf#169019 write char not number, read col from 0

Write: Separator as string not as number.
Read: Column index starts at 0, although in dialog is starts at 1
I have not checked the other transformations but only ColumnSplit.

Change-Id: I37812a4b575a425981ed09257263c829bd2eefc4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192929
Reviewed-by: Regina Henschel 
Tested-by: Jenkins
(cherry picked from commit 48cf7f1123637be847140ef9acc49e8f5f056677)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193020
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sc/source/filter/xml/xmlexprt.cxx 
b/sc/source/filter/xml/xmlexprt.cxx
index 1ddf8ff1af90..1d2f86cdb4aa 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -4243,7 +4243,7 @@ void 
ScXMLExport::WriteExternalDataTransformations(ScDocument& rDoc, const std::
 std::shared_ptr 
aSplitTransformation = 
std::dynamic_pointer_cast(itr);
 
 AddAttribute(XML_NAMESPACE_CALC_EXT, XML_COLUMN, 
OUString::number(aSplitTransformation->getColumn()));
-AddAttribute(XML_NAMESPACE_CALC_EXT, XML_SEPARATOR, 
OUString::number(aSplitTransformation->getSeparator()));
+AddAttribute(XML_NAMESPACE_CALC_EXT, XML_SEPARATOR, 
OUString(aSplitTransformation->getSeparator()));
 SvXMLElementExport aTransformation(*this, 
XML_NAMESPACE_CALC_EXT, XML_COLUMN_SPLIT_TRANSFORMATION, true, true);
 }
 break;
diff --git a/sc/source/filter/xml/xmltransformationi.cxx 
b/sc/source/filter/xml/xmltransformationi.cxx
index 238d4bde2a5b..2359c034ae3f 100644
--- a/sc/source/filter/xml/xmltransformationi.cxx
+++ b/sc/source/filter/xml/xmltransformationi.cxx
@@ -134,7 +134,7 @@ ScXMLColumnSplitContext::ScXMLColumnSplitContext(
 ScXMLImport& rImport, const 
rtl::Reference& rAttrList)
 : ScXMLImportContext(rImport)
 {
-SCCOL mnCol = 0;
+SCCOL mnCol = -1;
 OUString cSeparator;
 
 if (rAttrList.is())
@@ -157,7 +157,7 @@ ScXMLColumnSplitContext::ScXMLColumnSplitContext(
 }
 }
 
-if (mnCol > 0)
+if (mnCol >= 0)
 {
 ScDocument* pDoc = GetScImport().GetDocument();
 auto& rDataSources = pDoc->GetExternalDataMapper().getDataSources();


core.git: Branch 'libreoffice-25-8' - sc/source

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

New commits:
commit c43b3e019c5ea9b396a0cdd602137539387857d1
Author: Caolán McNamara 
AuthorDate: Wed Oct 22 08:43:36 2025 +0100
Commit: Miklos Vajna 
CommitDate: Wed Oct 22 15:20:14 2025 +0200

crash in GetPercentile with empty std::vector first arg

/opt/collaboraoffice/program/../program/libsclo.so
(anonymous namespace)::GetPercentile(std::vector > const&, double)
sc/source/core/data/colorscale.cxx:624
/opt/collaboraoffice/program/../program/libsclo.so
__gnu_cxx::__normal_iterator > const*, 
std::vector >, 
std::allocator > > > >::operator*() const

/opt/rh/devtoolset-12/root/usr/include/c++/12/bits/stl_iterator.h:1096
/opt/collaboraoffice/program/libscfiltlo.so
ScHTMLExport::WriteCell(sc::ColumnBlockPosition&, short, int, short)
sc/source/filter/html/htmlexp.cxx:923
/opt/collaboraoffice/program/libscfiltlo.so
ScHTMLExport::WriteTables()
sc/source/filter/html/htmlexp.cxx:864
/opt/collaboraoffice/program/libscfiltlo.so
ScHTMLExport::WriteBody()
sc/source/filter/html/htmlexp.cxx:699
/opt/collaboraoffice/program/libscfiltlo.so
ScHTMLExport::Write()
sc/source/filter/html/htmlexp.cxx:313
/opt/collaboraoffice/program/libscfiltlo.so
rtl::OUString::operator=(rtl::OUString const&)
include/rtl/ustring.hxx:586
/opt/collaboraoffice/program/../program/libsclo.so
ErrCode::IgnoreWarning() const
include/comphelper/errcode.hxx:102 (discriminator 1)
/opt/collaboraoffice/program/../program/libsclo.so
rtl::OUString::~OUString()
include/rtl/ustring.hxx:546
/opt/collaboraoffice/program/libmergedlo.so
TransferableHelper::SetObject(void*, unsigned int, 
com::sun::star::datatransfer::DataFlavor const&)
vcl/source/treelist/transfer.cxx:912 (discriminator 1)
/opt/collaboraoffice/program/../program/libsclo.so
ScTransferObj::GetData(com::sun::star::datatransfer::DataFlavor 
const&, rtl::OUString const&)
sc/source/ui/app/transobj.cxx:395

ScColorScaleFormat::CalcValue is optimized out, but it has to be

case COLORSCALE_PERCENTILE and getValues() must return an empty vector

Change-Id: I2cf09f19edcb5f30c82eca02e2a0fe95e86c78db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192823
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins CollaboraOffice 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192837
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192844
Tested-by: Jenkins

diff --git a/sc/source/core/data/colorscale.cxx 
b/sc/source/core/data/colorscale.cxx
index 1690b66918af..817a30a6ccb8 100644
--- a/sc/source/core/data/colorscale.cxx
+++ b/sc/source/core/data/colorscale.cxx
@@ -683,6 +683,15 @@ std::optional ScColorScaleFormat::GetColor( const 
ScAddress& rAddr ) cons
 return std::optional();
 
 ScColorScaleEntries::const_iterator itr = begin();
+
+// CalcValue will call GetPercentile for COLORSCALE_PERCENTILE. An empty
+// getValues() is invalid for COLORSCALE_PERCENTILE.
+if ((*itr)->GetType() == COLORSCALE_PERCENTILE && getValues().empty())
+{
+SAL_WARN("sc", "empty COLORSCALE_PERCENTILE");
+return std::optional();
+}
+
 double nValMin = CalcValue(nMin, nMax, itr);
 Color rColMin = (*itr)->GetColor();
 ++itr;


core.git: Branch 'libreoffice-25-8' - sc/source

2025-10-20 Thread Miklos Vajna (via logerrit)
 sc/source/filter/oox/SparklineFragment.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 7e0713ad8a2b06c9ffd5b5d83b2a28fe1d7012a4
Author: Miklos Vajna 
AuthorDate: Tue Oct 14 14:54:39 2025 +0200
Commit: Xisco Fauli 
CommitDate: Mon Oct 20 16:21:36 2025 +0200

sc: fix crash in SparklineGroupsContext::onCharacters()

Fixes this assertion failure in a crash report:

/opt/rh/devtoolset-12/root/usr/include/c++/12/bits/stl_vector.h:1230: constexpr 
std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::back() [with _Tp 
= oox::xls::Sparkline; _Alloc = std::allocator; reference 
= oox::xls::Sparkline&]: Assertion '!this->empty()' failed.

Backtrace from gdb on the core:
#0  __GI_raise (sig=sig@entry=6) at 
../sysdeps/unix/sysv/linux/raise.c:51
#1  0x7f906206e7f1 in __GI_abort () at abort.c:79
#2  0x00af43ee in std::__glibcxx_assert_fail(char const*, 
int, char const*, char const*) ()
#3  0x7f904d07ff87 in std::vector >::back (this=)
at 
/opt/rh/devtoolset-12/root/usr/include/c++/12/bits/stl_vector.h:1228
#4  std::vector >::back (this=) at 
/opt/rh/devtoolset-12/root/usr/include/c++/12/bits/stl_vector.h:1228
#5  oox::xls::SparklineGroupsContext::onCharacters(rtl::OUString 
const&) ()
at sc/source/filter/oox/SparklineFragment.cxx:232
#6  0x7f905cf0988a in 
oox::core::ContextHandler2Helper::processCollectedChars() ()
at include/rtl/ustring.hxx:546
#7  0x7f905cf09a05 in 
oox::core::ContextHandler2Helper::implEndElement (nElement=3475622, 
this=0x7f902403e880)
at oox/source/core/contexthandler2.cxx:123

gdb also points out that m_aSparklineGroups is non-empty.

Change-Id: Ib368550f6db0ed7ce4fbe37e056cd416208e7fe9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192424
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins
(cherry picked from commit cde426b7dbea32f93607130d13f108330a8b6275)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192721
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/filter/oox/SparklineFragment.cxx 
b/sc/source/filter/oox/SparklineFragment.cxx
index 44d2fe7e479e..d19b50fffc2b 100644
--- a/sc/source/filter/oox/SparklineFragment.cxx
+++ b/sc/source/filter/oox/SparklineFragment.cxx
@@ -229,6 +229,10 @@ void SparklineGroupsContext::onCharacters(const OUString& 
rChars)
 {
 ScDocument& rDocument = getScDocument();
 auto& rLastGroup = m_aSparklineGroups.back();
+if (rLastGroup.getSparklines().empty())
+{
+return;
+}
 auto& rLastSparkline = rLastGroup.getSparklines().back();
 ScRangeList aRange;
 if (ScRangeStringConverter::GetRangeListFromString(aRange, rChars, 
rDocument,


core.git: Branch 'libreoffice-25-8' - sc/source

2025-10-20 Thread Caolán McNamara (via logerrit)
 sc/source/core/tool/compiler.cxx |   13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 8d5da57c259a3a3d09a0118846c75a269bf38cdf
Author: Caolán McNamara 
AuthorDate: Sun Oct 5 17:52:56 2025 +0100
Commit: Xisco Fauli 
CommitDate: Mon Oct 20 14:35:22 2025 +0200

Threaded import crash in ScDocument::ShrinkToDataArea

since possibly(?) https://gerrit.libreoffice.org/c/core/+/180773

one thread, importing sheet 0, uses ScDocument::ShrinkToDataArea
for a range on sheet 1 while sheet 1 is importing on a different
thread.

Change-Id: Ia982e4c0af4859aacbca19420941f19ee85479eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191920
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins
(cherry picked from commit 7a6ebc8be8f5df795d1c9e0cca1a740ee2b62b27)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191986
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 86c5cc4e3117..7dc4815960c5 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -6642,6 +6642,16 @@ void ScCompiler::CorrectSumRange(const ScComplexRefData& 
rBaseRange,
 pNewSumRangeTok->IncRef();
 }
 
+// If we are loading, we might be loading each sheet in a separate thread at 
the same time
+// It is unsafe to use ShrinkToDataArea on a range that refers to a different 
sheet whose
+// columns and rows are still being added to. Even if it is the same sheet, it 
probably
+// doesn't make sense to ShrinkToDataArea during document load.
+static bool IsSafeToShrinkToDataArea(const ScDocument& rDoc)
+{
+const bool bIsLoading = !rDoc.GetDocumentShell() || 
rDoc.GetDocumentShell()->IsLoading();
+return !bIsLoading;
+}
+
 void ScCompiler::AnnotateTrimOnDoubleRefs()
 {
 if (!pCode || !(*(pCode - 1)))
@@ -6886,7 +6896,8 @@ void ScCompiler::AnnotateTrimOnDoubleRefs()
 SCROW nTempStartRow = rRange.aStart.Row();
 SCCOL nTempEndCol = rRange.aEnd.Col();
 SCROW nTempEndRow = rRange.aEnd.Row();
-rDoc.ShrinkToDataArea(rRange.aStart.Tab(), nTempStartCol, 
nTempStartRow, nTempEndCol, nTempEndRow);
+if (IsSafeToShrinkToDataArea(rDoc))
+rDoc.ShrinkToDataArea(rRange.aStart.Tab(), nTempStartCol, 
nTempStartRow, nTempEndCol, nTempEndRow);
 // check if range is still valid
 if (nTempStartRow <= nTempEndRow && nTempStartCol <= 
nTempEndCol)
 {


core.git: Branch 'libreoffice-25-8' - sc/source

2025-10-18 Thread Pranam Lashkari (via logerrit)
 sc/source/ui/view/cellsh2.cxx |   11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 7e9ef9557da52b219e2c7ce500345510f9cbbc9c
Author: Pranam Lashkari 
AuthorDate: Wed Sep 17 21:26:17 2025 +0200
Commit: Xisco Fauli 
CommitDate: Tue Sep 30 11:20:57 2025 +0200

tdf#156263: fixes freeze after opening data validity dialog

after making dialog async ScValidationRegisteredDlg was destroyed while
dialog is still running causing undefined behaviour

regression caused by 63b26e8e20f6a4eeb3117925b7a727f565e3a2dc

Change-Id: Idef30f12b88c46cb30a01ffb12588bb11e279750
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191105
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Caolán McNamara 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191116
Tested-by: Jenkins
(cherry picked from commit ef7151c271d14f623759f87d30e452f2e6d4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191652
Reviewed-by: Pranam Lashkari 

diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index 5e79e0820c36..af45261e6070 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -928,7 +928,8 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
 vcl::Window* pWin = GetViewData().GetActiveWin();
 weld::Window* pParentWin = pWin ? pWin->GetFrameWeld() : 
nullptr;
 auto xDlg = std::make_shared(pParentWin, 
&aArgSet, pTabViewShell);
-ScValidationRegisteredDlg 
aRegisterThatDlgExists(pParentWin, xDlg);
+std::shared_ptr 
pRegisterThatDlgExists
+= 
std::make_shared(pParentWin, xDlg);
 
 struct lcl_auxData
 {
@@ -947,11 +948,13 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
 OUString aErrTitle;
 OUString aErrText;
 bool bCaseSensitive;
+std::shared_ptr 
aRegisterThatDlgExists;
 };
 
-std::shared_ptr xAuxData = 
std::make_shared(lcl_auxData{
-aCursorPos, eMode, eOper, aExpr1, aExpr2, bBlank, 
nListType, bShowHelp,
-aHelpTitle, aHelpText, bShowError, eErrStyle, 
aErrTitle, aErrText, bCaseSensitive});
+std::shared_ptr xAuxData = 
std::make_shared(
+lcl_auxData{ aCursorPos, eMode, eOper, aExpr1, aExpr2, 
bBlank, nListType,
+ bShowHelp, aHelpTitle, aHelpText, 
bShowError, eErrStyle,
+ aErrTitle, aErrText, bCaseSensitive, 
pRegisterThatDlgExists });
 
 auto xRequest = std::make_shared(rReq);
 rReq.Ignore(); // the 'old' request is not relevant any 
more


core.git: Branch 'libreoffice-25-8' - sc/source

2025-09-03 Thread Noel Grandin (via logerrit)
 sc/source/core/data/documen4.cxx |5 -
 sc/source/core/data/patattr.cxx  |6 --
 2 files changed, 4 insertions(+), 7 deletions(-)

New commits:
commit 641a0e3d9a668f38651831f2a99db02edd50f21e
Author: Noel Grandin 
AuthorDate: Tue Sep 2 11:52:38 2025 +0200
Commit: Noel Grandin 
CommitDate: Wed Sep 3 21:39:35 2025 +0200

tdf#168159 CRASH: deleting columns and undoing

revert
   commit 68db5b64b8db405f9e6c0368836a8ee671b46830
   Author: Noel Grandin 
   Date:   Sat Jun 28 16:13:53 2025 +0200
   crashtesting ooo120243-1.ods
and
   commit c8742f36fa2bdc9d23042378f5b587ccda8b54dd
   Author: Noel Grandin 
   Date:   Thu May 22 10:18:48 2025 +0200
   tdf#166684 reduce cost of CellAttributeHelper::registerAndCheck

Change-Id: I4d4442c6927121e7f18e3e08eb1736fa94a896bc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190521
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190539

diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx
index 61b9670a6f84..771c4d81964a 100644
--- a/sc/source/core/data/documen4.cxx
+++ b/sc/source/core/data/documen4.cxx
@@ -804,11 +804,6 @@ const SfxItemSet* ScDocument::GetCondResult( SCCOL nCol, 
SCROW nRow, SCTAB nTab,
 aCell.assign(const_cast(*this), aPos);
 pCell = &aCell;
 }
-// if the underlying cell needs evaluation, ScPatternAttr
-// and ScCondFormatIndexes might end up being deleted under
-// us, so we need to trigger evaluation before accessing them.
-if (pCell->getType() == CELLTYPE_FORMULA)
-pCell->getFormula()->IsValue();
 const ScPatternAttr* pPattern = GetPattern( nCol, nRow, nTab );
 const ScCondFormatIndexes& rIndex =
 pPattern->GetItem(ATTR_CONDITIONAL).GetCondFormatData();
diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx
index 3a0a6aa2d6ae..541498d5740c 100644
--- a/sc/source/core/data/patattr.cxx
+++ b/sc/source/core/data/patattr.cxx
@@ -114,10 +114,12 @@ const ScPatternAttr* 
CellAttributeHelper::registerAndCheck(const ScPatternAttr&
 return mpLastHit;
 }
 const OUString* pCandidateStyleName = rCandidate.GetStyleName();
-auto [it, itEnd] = 
maRegisteredCellAttributes.equal_range(pCandidateStyleName);
-for (; it != itEnd; ++it)
+auto it = maRegisteredCellAttributes.lower_bound(pCandidateStyleName);
+for (; it != maRegisteredCellAttributes.end(); ++it)
 {
 const ScPatternAttr* pCheck = *it;
+if (CompareStringPtr(pCheck->GetStyleName(), pCandidateStyleName) != 0)
+break;
 if (ScPatternAttr::areSame(pCheck, &rCandidate))
 {
 pCheck->mnRefCount++;


core.git: Branch 'libreoffice-25-8' - sc/source sw/source

2025-09-01 Thread Andreas Heinisch (via logerrit)
 sc/source/ui/unoobj/filtuno.cxx |2 +-
 sw/source/uibase/utlui/glbltree.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 8bb3402ec5c352ef6eb4e6424394ff2cda60f595
Author: Andreas Heinisch 
AuthorDate: Tue Aug 26 19:07:58 2025 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Mon Sep 1 13:24:39 2025 +0200

tdf#127978, tdf#132421 - Change URL encoding for filename

Change URL encoding for the filename of the import ASCII dialog's title
and of the navigator's tooltip. Otherwise, filenames including a hash
don't display correctly.

Change-Id: Ib2f56e77649184f53dd226f4a77e80d270770135
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190240
Reviewed-by: Andreas Heinisch 
Tested-by: Jenkins
(cherry picked from commit 930186296cabd00dc0fb1b11dd6bb1b5ef042da0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190269
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sc/source/ui/unoobj/filtuno.cxx b/sc/source/ui/unoobj/filtuno.cxx
index 0bb3db3453f8..ef9a32696bdd 100644
--- a/sc/source/ui/unoobj/filtuno.cxx
+++ b/sc/source/ui/unoobj/filtuno.cxx
@@ -183,7 +183,7 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute()
 
 INetURLObject aURL( aFileName );
 // tdf#132421 - don't URL encode filename for the import ASCII dialog 
title
-OUString 
aPrivDatName(aURL.GetLastName(INetURLObject::DecodeMechanism::Unambiguous));
+OUString 
aPrivDatName(aURL.GetLastName(INetURLObject::DecodeMechanism::WithCharset));
 std::unique_ptr pInStream;
 if ( xInputStream.is() )
 pInStream = utl::UcbStreamHelper::CreateStream( xInputStream );
diff --git a/sw/source/uibase/utlui/glbltree.cxx 
b/sw/source/uibase/utlui/glbltree.cxx
index 62097fdc93b0..ab9aa234ccfc 100644
--- a/sw/source/uibase/utlui/glbltree.cxx
+++ b/sw/source/uibase/utlui/glbltree.cxx
@@ -532,7 +532,7 @@ void SwGlobalTree::InsertRegion( const SwGlblDocContent* 
pCont, const OUString*
 aFileName.SetSmartURL( *pFileName );
 // tdf#127978 - don't URL encode filename for navigator's tooltip
 aFileNames.getArray()[0]
-= 
aFileName.GetMainURL(INetURLObject::DecodeMechanism::Unambiguous);
+= 
aFileName.GetMainURL(INetURLObject::DecodeMechanism::WithCharset);
 InsertRegion( pCont, aFileNames );
 }
 }


core.git: Branch 'libreoffice-25-8' - sc/source

2025-08-25 Thread Mike Kaganski (via logerrit)
 sc/source/ui/unoobj/cellsuno.cxx |   15 ---
 1 file changed, 4 insertions(+), 11 deletions(-)

New commits:
commit 2bdf8d96a1356fc74ec271cdbb88954ae0d84240
Author: Mike Kaganski 
AuthorDate: Sat Aug 23 12:38:01 2025 +0200
Commit: Xisco Fauli 
CommitDate: Mon Aug 25 13:44:47 2025 +0200

This code is dead

If getFromUnoTunnel failed, there's no
need to test getFromUnoTunnel: it is derived
from SvxUnoTextRangeBase, and will always fail.

Change-Id: I9faac80c6d58ff8d5b84cdb6ab5682ffc06f6b3a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190093
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190162

diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 1f474688a098..15b1fb9314fc 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -5866,20 +5866,13 @@ uno::Reference SAL_CALL 
ScCellObj::createTextCursorByRange(
 const uno::Reference& 
aTextPosition )
 {
 SolarMutexGuard aGuard;
-rtl::Reference pCursor = new ScCellTextCursor( *this );
 
 SvxUnoTextRangeBase* pRange = 
comphelper::getFromUnoTunnel( aTextPosition );
-if(pRange)
-pCursor->SetSelection( pRange->GetSelection() );
-else
-{
-ScCellTextCursor* pOther = 
comphelper::getFromUnoTunnel( aTextPosition );
-if(!pOther)
-throw uno::RuntimeException();
-
-pCursor->SetSelection( pOther->GetSelection() );
+if (!pRange)
+throw uno::RuntimeException();
 
-}
+rtl::Reference pCursor = new ScCellTextCursor(*this);
+pCursor->SetSelection(pRange->GetSelection());
 
 return pCursor;
 }


core.git: Branch 'libreoffice-25-8' - sc/source

2025-08-19 Thread Noel Grandin (via logerrit)
 sc/source/ui/miscdlgs/autofmt.cxx |5 -
 sc/source/ui/view/printfun.cxx|5 -
 2 files changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 11c6d25f6729028a0ea4ab106ec0f76ddf220846
Author: Noel Grandin 
AuthorDate: Mon Jun 30 12:00:15 2025 +0200
Commit: Xisco Fauli 
CommitDate: Tue Aug 19 13:00:10 2025 +0200

tdf#166842 do not use FillColor==COL_TRANSPARENT...

.. on OutputDevice if that OutputDevice does not support alpha

Change-Id: Ic6e5e2637a30d4588866a10b1519a5ffec3ae21d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187180
Reviewed-by: Noel Grandin 
Tested-by: Jenkins
(cherry picked from commit 850a98962c0bbf6e11eb1a571a6160d896127167)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189896
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/ui/miscdlgs/autofmt.cxx 
b/sc/source/ui/miscdlgs/autofmt.cxx
index a8dbe981d386..8c8f946f0e77 100644
--- a/sc/source/ui/miscdlgs/autofmt.cxx
+++ b/sc/source/ui/miscdlgs/autofmt.cxx
@@ -370,7 +370,10 @@ void ScAutoFmtPreview::DrawBackground(vcl::RenderContext& 
rRenderContext)
 
 rRenderContext.Push( vcl::PushFlags::LINECOLOR | 
vcl::PushFlags::FILLCOLOR );
 rRenderContext.SetLineColor();
-rRenderContext.SetFillColor( pItem->GetColor() );
+if (pItem->GetColor() == COL_TRANSPARENT)
+rRenderContext.SetFillColor();
+else
+rRenderContext.SetFillColor( pItem->GetColor() );
 
 const basegfx::B2DRange aCellRange(maArray.GetCellRange( nCol, 
nRow ));
 rRenderContext.DrawRect(
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index 60055b9aed97..4476326c9685 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -1334,7 +1334,10 @@ void ScPrintFunc::DrawBorder( tools::Long nScrX, 
tools::Long nScrY, tools::Long
 }
 else
 {
-pDev->SetFillColor(pBackground->GetColor());
+if (pBackground->GetColor() == COL_TRANSPARENT)
+pDev->SetFillColor();
+else
+pDev->SetFillColor(pBackground->GetColor());
 pDev->SetLineColor();
 pDev->DrawRect(aFrameRect);
 }


core.git: Branch 'libreoffice-25-8' - sc/source

2025-08-14 Thread Markus Mohrhard (via logerrit)
 sc/source/core/data/colorscale.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 7a3ce14ad4a464676fe54a91169c215cd0dc
Author: Markus Mohrhard 
AuthorDate: Thu Aug 14 22:59:34 2025 +0800
Commit: Xisco Fauli 
CommitDate: Thu Aug 14 21:37:12 2025 +0200

prevent crash during colorscale calculation

This should fix 
https://crashreport.libreoffice.org/stats/signature/static%20double%20%60anonymous%20namespace'::GetPercentile(const%20class%20std::vector%3Cdouble,std::allocator%3Cdouble%3E%20%3E%20&%20const,%20double)

Change-Id: Ifb4cc3a8120e9f85eb2029e88268e11f4ae2526a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189613
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard 
(cherry picked from commit 9d03d31dabc31902be18aa6b4905b155d06e3afa)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189619
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/core/data/colorscale.cxx 
b/sc/source/core/data/colorscale.cxx
index 736f2c76582d..1690b66918af 100644
--- a/sc/source/core/data/colorscale.cxx
+++ b/sc/source/core/data/colorscale.cxx
@@ -613,13 +613,15 @@ double GetPercentile( const std::vector& rArray, 
double fPercentile )
 SAL_WARN_IF(fPercentile < 0, "sc", "negative percentile");
 if (fPercentile < 0)
 return rArray.front();
-assert(fPercentile <= 1);
+
+fPercentile = std::min(1.0, fPercentile);
+
 size_t nSize = rArray.size();
 double fFloor = ::rtl::math::approxFloor(fPercentile * (nSize-1));
 size_t nIndex = static_cast(fFloor);
 double fDiff = fPercentile * (nSize-1) - fFloor;
 std::vector::const_iterator iter = rArray.begin() + nIndex;
-if (fDiff == 0.0)
+if (fDiff == 0.0 || nIndex == nSize - 1)
 return *iter;
 else
 {


core.git: Branch 'libreoffice-25-8' - sc/source

2025-08-12 Thread Xisco Fauli (via logerrit)
 sc/source/ui/app/transobj.cxx |   12 +++-
 sc/source/ui/inc/transobj.hxx |2 +-
 2 files changed, 8 insertions(+), 6 deletions(-)

New commits:
commit 4f05e09bd0e54dc0bd1102c15e2ee62a7a92d9fd
Author: Xisco Fauli 
AuthorDate: Mon Aug 11 17:33:10 2025 +0200
Commit: Christian Lohmaier 
CommitDate: Tue Aug 12 13:18:57 2025 +0200

tdf#167901: Revert "tdf#167075: init doc shell before pasting as png/bmp"

This reverts commit eb99e28a92517cac9534a6a52b9266777f735ce5.

Reverting for now until I find a better solution, specially towards
LibreOffice 25.8.0. The fix for tdf#167075 only works when working
with one table but it crashes when working with more than one table,
so it's better to have tdf#167075 reproducible than a crash

I'll add a test in a follow-up commit

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

diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index 36ab35001b04..112282e65a56 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -97,18 +97,21 @@ void ScTransferObj::GetAreaSize( const ScDocument& rDoc, 
SCTAB nTab1, SCTAB nTab
 nCol = nMaxCol;
 }
 
-void ScTransferObj::PaintToDev( OutputDevice* pDev, ScDocShell& rDocSh, double 
nPrintFactor,
+void ScTransferObj::PaintToDev( OutputDevice* pDev, ScDocument& rDoc, double 
nPrintFactor,
 const ScRange& rBlock )
 {
+if (!rDoc.GetDocumentShell())
+return;
+
 tools::Rectangle aBound( Point(), pDev->GetOutputSize() );  //! use 
size from clip area?
 
-ScViewData aViewData(rDocSh, nullptr);
+ScViewData aViewData(*rDoc.GetDocumentShell(), nullptr);
 
 aViewData.SetTabNo( rBlock.aEnd.Tab() );
 aViewData.SetScreen( rBlock.aStart.Col(), rBlock.aStart.Row(),
 rBlock.aEnd.Col(), rBlock.aEnd.Row() );
 
-ScPrintFunc::DrawToDev( rDocSh.GetDocument(), pDev, nPrintFactor, aBound, 
aViewData, false/*bMetaFile*/ );
+ScPrintFunc::DrawToDev( rDoc, pDev, nPrintFactor, aBound, aViewData, 
false/*bMetaFile*/ );
 }
 
 ScTransferObj::ScTransferObj( const std::shared_ptr& pClipDoc, 
TransferableObjectDescriptor aDesc ) :
@@ -434,8 +437,7 @@ bool ScTransferObj::GetData( const 
datatransfer::DataFlavor& rFlavor, const OUSt
 
 pVirtDev->SetOutputSizePixel(aPixelSize);
 
-InitDocShell(true);
-PaintToDev( pVirtDev, *m_aDocShellRef, 1.0, aReducedBlock );
+PaintToDev( pVirtDev, *m_pDoc, 1.0, aReducedBlock );
 
 pVirtDev->SetMapMode( MapMode( MapUnit::MapPixel, Point(), aScale, 
aScale ) );
 BitmapEx aBmp = pVirtDev->GetBitmapEx( Point(), 
pVirtDev->GetOutputSize() );
diff --git a/sc/source/ui/inc/transobj.hxx b/sc/source/ui/inc/transobj.hxx
index d84f5cb3e0df..4ad4a93be7f7 100644
--- a/sc/source/ui/inc/transobj.hxx
+++ b/sc/source/ui/inc/transobj.hxx
@@ -58,7 +58,7 @@ private:
 static void StripRefs( ScDocument& rDoc, SCCOL nStartX, SCROW nStartY,
 SCCOL nEndX, SCROW nEndY,
 ScDocument& rDestDoc );
-static void PaintToDev( OutputDevice* pDev, ScDocShell& rDocSh, double 
nPrintFactor,
+static void PaintToDev( OutputDevice* pDev, ScDocument& rDoc, double 
nPrintFactor,
 const ScRange& rBlock );
 static void GetAreaSize( const ScDocument& rDoc, SCTAB nTab1, SCTAB nTab2, 
SCROW& nRow, SCCOL& nCol );
 


core.git: Branch 'libreoffice-25-8' - sc/source

2025-08-08 Thread Xisco Fauli (via logerrit)
 sc/source/ui/app/transobj.cxx |   12 +---
 sc/source/ui/inc/transobj.hxx |2 +-
 2 files changed, 6 insertions(+), 8 deletions(-)

New commits:
commit eaddb0695a687fc6638337eeb82da73543d7ca0a
Author: Xisco Fauli 
AuthorDate: Fri Aug 8 13:34:54 2025 +0200
Commit: Christian Lohmaier 
CommitDate: Fri Aug 8 16:19:17 2025 +0200

tdf#167075: init doc shell before pasting as png/bmp

Regression after
commit d8ab8992bd35aedfc1d2b0debebab0d623aa8d09
Author: Xisco Fauli 
Date:   Mon May 26 11:06:06 2025 +0200

ScViewData: pass ScDocShell by ref

and

commit 52e3b2b040ac54c2a5661e3676b135170f028f50
Author: Xisco Fauli 
Date:   Mon May 26 16:06:12 2025 +0200

ScViewData: simplify constructors

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

diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index 112282e65a56..36ab35001b04 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -97,21 +97,18 @@ void ScTransferObj::GetAreaSize( const ScDocument& rDoc, 
SCTAB nTab1, SCTAB nTab
 nCol = nMaxCol;
 }
 
-void ScTransferObj::PaintToDev( OutputDevice* pDev, ScDocument& rDoc, double 
nPrintFactor,
+void ScTransferObj::PaintToDev( OutputDevice* pDev, ScDocShell& rDocSh, double 
nPrintFactor,
 const ScRange& rBlock )
 {
-if (!rDoc.GetDocumentShell())
-return;
-
 tools::Rectangle aBound( Point(), pDev->GetOutputSize() );  //! use 
size from clip area?
 
-ScViewData aViewData(*rDoc.GetDocumentShell(), nullptr);
+ScViewData aViewData(rDocSh, nullptr);
 
 aViewData.SetTabNo( rBlock.aEnd.Tab() );
 aViewData.SetScreen( rBlock.aStart.Col(), rBlock.aStart.Row(),
 rBlock.aEnd.Col(), rBlock.aEnd.Row() );
 
-ScPrintFunc::DrawToDev( rDoc, pDev, nPrintFactor, aBound, aViewData, 
false/*bMetaFile*/ );
+ScPrintFunc::DrawToDev( rDocSh.GetDocument(), pDev, nPrintFactor, aBound, 
aViewData, false/*bMetaFile*/ );
 }
 
 ScTransferObj::ScTransferObj( const std::shared_ptr& pClipDoc, 
TransferableObjectDescriptor aDesc ) :
@@ -437,7 +434,8 @@ bool ScTransferObj::GetData( const 
datatransfer::DataFlavor& rFlavor, const OUSt
 
 pVirtDev->SetOutputSizePixel(aPixelSize);
 
-PaintToDev( pVirtDev, *m_pDoc, 1.0, aReducedBlock );
+InitDocShell(true);
+PaintToDev( pVirtDev, *m_aDocShellRef, 1.0, aReducedBlock );
 
 pVirtDev->SetMapMode( MapMode( MapUnit::MapPixel, Point(), aScale, 
aScale ) );
 BitmapEx aBmp = pVirtDev->GetBitmapEx( Point(), 
pVirtDev->GetOutputSize() );
diff --git a/sc/source/ui/inc/transobj.hxx b/sc/source/ui/inc/transobj.hxx
index 4ad4a93be7f7..d84f5cb3e0df 100644
--- a/sc/source/ui/inc/transobj.hxx
+++ b/sc/source/ui/inc/transobj.hxx
@@ -58,7 +58,7 @@ private:
 static void StripRefs( ScDocument& rDoc, SCCOL nStartX, SCROW nStartY,
 SCCOL nEndX, SCROW nEndY,
 ScDocument& rDestDoc );
-static void PaintToDev( OutputDevice* pDev, ScDocument& rDoc, double 
nPrintFactor,
+static void PaintToDev( OutputDevice* pDev, ScDocShell& rDocSh, double 
nPrintFactor,
 const ScRange& rBlock );
 static void GetAreaSize( const ScDocument& rDoc, SCTAB nTab1, SCTAB nTab2, 
SCROW& nRow, SCCOL& nCol );
 


core.git: Branch 'libreoffice-25-8' - sc/source

2025-08-07 Thread Markus Mohrhard (via logerrit)
 sc/source/filter/xml/XMLExportDatabaseRanges.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b3715bd480b44dfedb48b5f3a6ce6a5e2f3d431e
Author: Markus Mohrhard 
AuthorDate: Sat Jul 19 15:13:19 2025 +0800
Commit: Xisco Fauli 
CommitDate: Thu Aug 7 16:58:29 2025 +0200

tdf#164014: export value filters through the value property to ODS

Change-Id: Ia6f8a2d65d1f90488ae1c8d2ca5bb48fc772464d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188061
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard 
(cherry picked from commit 02431246070d3468a0360b212f96a4ea75cac52c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188701
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/filter/xml/XMLExportDatabaseRanges.cxx 
b/sc/source/filter/xml/XMLExportDatabaseRanges.cxx
index 5089bea2ca6b..7310a5a83097 100644
--- a/sc/source/filter/xml/XMLExportDatabaseRanges.cxx
+++ b/sc/source/filter/xml/XMLExportDatabaseRanges.cxx
@@ -474,7 +474,7 @@ private:
 else
 {
 mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DATA_TYPE, 
XML_NUMBER);
-mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_VALUE, 
rItem.maString.getString());
+mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_VALUE, 
OUString::number(rItem.mfVal));
 }
 
 mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_OPERATOR, 
getOperatorXML(rEntry, eSearchType));


core.git: Branch 'libreoffice-25-8' - sc/source

2025-08-07 Thread Markus Mohrhard (via logerrit)
 sc/source/filter/oox/sheetdatacontext.cxx |   18 ++
 1 file changed, 10 insertions(+), 8 deletions(-)

New commits:
commit 9d80c4ee2a9b368236107375511b1880692ef5f2
Author: Markus Mohrhard 
AuthorDate: Sat Jul 19 16:16:07 2025 +0800
Commit: Xisco Fauli 
CommitDate: Thu Aug 7 16:58:07 2025 +0200

tdf#122336: handle OOXML files with invalid cell refs better

Change-Id: Ib1e95ea0254f04852eb4c1ac4f95a587a68a9b10
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188059
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard 
(cherry picked from commit 2c171226eeac51c6082734dc854e9c045a963f04)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188696
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/filter/oox/sheetdatacontext.cxx 
b/sc/source/filter/oox/sheetdatacontext.cxx
index b90f1fc5eb52..920f64dd6149 100644
--- a/sc/source/filter/oox/sheetdatacontext.cxx
+++ b/sc/source/filter/oox/sheetdatacontext.cxx
@@ -322,22 +322,24 @@ void SheetDataContext::importRow( const AttributeList& 
rAttribs )
 
 bool SheetDataContext::importCell( const AttributeList& rAttribs )
 {
-bool bValid = true;
+bool bValid = false;
 std::string_view p = rAttribs.getView(XML_r);
 
-if (p.empty())
+if (!p.empty())
+{
+bValid = mrAddressConv.convertToCellAddress(maCellData.maCellAddr, 
OUString::fromUtf8(p),
+mnSheet, true);
+if (bValid)
+mnCol = maCellData.maCellAddr.Col();
+}
+
+if (!bValid)
 {
 ++mnCol;
 ScAddress aAddress( mnCol, mnRow, mnSheet );
 bValid = mrAddressConv.checkCellAddress( aAddress, true );
 maCellData.maCellAddr = aAddress;
 }
-else
-{
-bValid = mrAddressConv.convertToCellAddress(maCellData.maCellAddr, 
OUString::fromUtf8(p),
-mnSheet, true);
-mnCol = maCellData.maCellAddr.Col();
-}
 
 if( bValid )
 {


core.git: Branch 'libreoffice-25-8' - sc/source

2025-08-07 Thread Markus Mohrhard (via logerrit)
 sc/source/filter/oox/autofilterbuffer.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d32d90ac556ce75e30e7ecf2d6b6eccbbf4de244
Author: Markus Mohrhard 
AuthorDate: Thu Jul 17 09:09:54 2025 +0800
Commit: Xisco Fauli 
CommitDate: Thu Aug 7 15:59:46 2025 +0200

properly display autofilter buttons for XLSB on filtered columns

The XLSB property has the inverted logic compared to the XLSX property

XLSB: fNoBtn: 0 means "The AutoFilter button for this column will NOT
appear in the next column (1) after this one"

XLSX: showButton: Flag indicating whether an application intended for
editing documents should show filtering interface
elements on this cell
Change-Id: I440149e28cf31cd16b834cdcc9eb05be4af45fbe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187978
Reviewed-by: Markus Mohrhard 
Tested-by: Jenkins
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188697

diff --git a/sc/source/filter/oox/autofilterbuffer.cxx 
b/sc/source/filter/oox/autofilterbuffer.cxx
index 233f81c5a48b..d5567250fc3a 100644
--- a/sc/source/filter/oox/autofilterbuffer.cxx
+++ b/sc/source/filter/oox/autofilterbuffer.cxx
@@ -641,7 +641,7 @@ void FilterColumn::importFilterColumn( SequenceInputStream& 
rStrm )
 mnColId = rStrm.readInt32();
 nFlags = rStrm.readuInt16();
 mbHiddenButton = getFlag( nFlags, BIFF12_FILTERCOLUMN_HIDDENBUTTON );
-mbShowButton = getFlag( nFlags, BIFF12_FILTERCOLUMN_SHOWBUTTON );
+mbShowButton = !getFlag( nFlags, BIFF12_FILTERCOLUMN_SHOWBUTTON );
 }
 
 ApiFilterSettings FilterColumn::finalizeImport()


core.git: Branch 'libreoffice-25-8' - sc/source

2025-08-07 Thread Caolán McNamara (via logerrit)
 sc/source/ui/condformat/condformatmgr.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a51a775ea87010286e6624b06e9805bcca2bb95f
Author: Caolán McNamara 
AuthorDate: Sun Aug 3 21:48:04 2025 +0100
Commit: Xisco Fauli 
CommitDate: Thu Aug 7 12:52:51 2025 +0200

cid#1660263 Explicit null dereferenced

Change-Id: Id6d36908f93783b8b742e59861452cef00a43dca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188895
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins
(cherry picked from commit 916d3500d1e7cc1ee62da902552ee747493b0abd)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189048
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/ui/condformat/condformatmgr.cxx 
b/sc/source/ui/condformat/condformatmgr.cxx
index 2e5cef3a01a0..5e60a2a2a70d 100644
--- a/sc/source/ui/condformat/condformatmgr.cxx
+++ b/sc/source/ui/condformat/condformatmgr.cxx
@@ -124,7 +124,7 @@ std::unique_ptr 
ScCondFormatManagerDlg::GetConditionalF
 
 void ScCondFormatManagerDlg::UpdateButtonSensitivity()
 {
-bool bNewSensitivity = !m_xFormatList->empty();
+bool bNewSensitivity = m_xFormatList && !m_xFormatList->empty();
 m_xBtnRemove->set_sensitive(bNewSensitivity);
 m_xBtnEdit->set_sensitive(bNewSensitivity);
 }


core.git: Branch 'libreoffice-25-8' - sc/source

2025-08-07 Thread Markus Mohrhard (via logerrit)
 sc/source/filter/oox/worksheetbuffer.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0a7db57656df704bfed869f743c8669b29d0eebd
Author: Markus Mohrhard 
AuthorDate: Sat Jul 19 15:41:16 2025 +0800
Commit: Xisco Fauli 
CommitDate: Thu Aug 7 10:20:55 2025 +0200

tdf#118668: handle wrong XLSX sheet visibility settings in line with Excel

Change-Id: I97b3b894a66c3108d67e0c8ef3b6b77aea11f365
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188060
Reviewed-by: Markus Mohrhard 
Tested-by: Jenkins
(cherry picked from commit 098a900142491477223e3340f29a15505efe99cc)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188700
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/filter/oox/worksheetbuffer.cxx 
b/sc/source/filter/oox/worksheetbuffer.cxx
index 0783c27a147e..241474359f44 100644
--- a/sc/source/filter/oox/worksheetbuffer.cxx
+++ b/sc/source/filter/oox/worksheetbuffer.cxx
@@ -243,7 +243,7 @@ void WorksheetBuffer::finalizeImport( sal_Int16 
nActiveSheet )
 if ( aSheetInfo->mnCalcSheet == nActiveSheet)
 rDoc.SetVisible( aSheetInfo->mnCalcSheet, true );
 else
-rDoc.SetVisible( aSheetInfo->mnCalcSheet, aSheetInfo->mnState == 
XML_visible );
+rDoc.SetVisible( aSheetInfo->mnCalcSheet, aSheetInfo->mnState != 
XML_hidden && aSheetInfo->mnState != XML_veryHidden);
 }
 }
 


core.git: Branch 'libreoffice-25-8' - sc/source

2025-07-02 Thread Noel Grandin (via logerrit)
 sc/source/core/data/documen4.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit f0d57a7df2452ed142b9aaa5511def521d26980a
Author: Noel Grandin 
AuthorDate: Sat Jun 28 16:13:53 2025 +0200
Commit: Xisco Fauli 
CommitDate: Wed Jul 2 09:50:17 2025 +0200

crashtesting ooo120243-1.ods

regression from
commit c8742f36fa2bdc9d23042378f5b587ccda8b54dd
Author: Noel Grandin 
Date:   Thu May 22 10:18:48 2025 +0200
tdf#166684 reduce cost of CellAttributeHelper::registerAndCheck

This is strictly speaking a workaround. I have no idea how improving the 
speed of
searching ends up triggering a re-allocation of these data-structures.

Change-Id: I13ac6d85aae7c56d1adfcabf1ca73381bfb81ac4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187134
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit 68db5b64b8db405f9e6c0368836a8ee671b46830)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187164
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx
index 771c4d81964a..61b9670a6f84 100644
--- a/sc/source/core/data/documen4.cxx
+++ b/sc/source/core/data/documen4.cxx
@@ -804,6 +804,11 @@ const SfxItemSet* ScDocument::GetCondResult( SCCOL nCol, 
SCROW nRow, SCTAB nTab,
 aCell.assign(const_cast(*this), aPos);
 pCell = &aCell;
 }
+// if the underlying cell needs evaluation, ScPatternAttr
+// and ScCondFormatIndexes might end up being deleted under
+// us, so we need to trigger evaluation before accessing them.
+if (pCell->getType() == CELLTYPE_FORMULA)
+pCell->getFormula()->IsValue();
 const ScPatternAttr* pPattern = GetPattern( nCol, nRow, nTab );
 const ScCondFormatIndexes& rIndex =
 pPattern->GetItem(ATTR_CONDITIONAL).GetCondFormatData();


core.git: Branch 'libreoffice-25-8' - sc/source

2025-07-01 Thread Noel Grandin (via logerrit)
 sc/source/filter/oox/worksheethelper.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit c71c712857d14747fc700594d6f6878b7bd6231b
Author: Noel Grandin 
AuthorDate: Mon Jun 30 08:33:01 2025 +0200
Commit: Xisco Fauli 
CommitDate: Tue Jul 1 09:07:44 2025 +0200

crashtesting forum-mso-en4-307539.xlsx

regression from
commit 79322a7025bb6fd61928204f90230560b09b4ba9
Author: Noel Grandin 
Date:   Wed May 21 15:28:41 2025 +0200
tdf#166684 strip out some unnecessary UNO work

Change-Id: Ifab9b928f6c4dd660e9bf3812a8f6e4c2cd73b6c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187160
Reviewed-by: Noel Grandin 
Tested-by: Jenkins
(cherry picked from commit 8ebd114b91678d3cc4f1582fbe2ba4f7d479993e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187163
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/filter/oox/worksheethelper.cxx 
b/sc/source/filter/oox/worksheethelper.cxx
index c74b2dd6d204..a7bf39b6cfb9 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -1073,6 +1073,8 @@ void WorksheetGlobals::finalizeValidationRanges() const
 for (auto const& validation : maValidations)
 {
 rtl::Reference xRanges = 
getCellRangeList(validation.maRanges);
+if (!xRanges)
+continue;
 rtl::Reference xValidation = 
xRanges->getValidation();
 
 if( xValidation.is() )


core.git: Branch 'libreoffice-25-8' - sc/source

2025-06-30 Thread Mike Kaganski (via logerrit)
 sc/source/core/data/patattr.cxx |5 +++--
 sc/source/ui/view/tabvwsha.cxx  |2 ++
 2 files changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 91f79e292c263418d4171c86e062764bd7687b3f
Author: Mike Kaganski 
AuthorDate: Sun Jun 22 19:18:28 2025 +0500
Commit: Xisco Fauli 
CommitDate: Mon Jun 30 13:35:50 2025 +0200

tdf#167161: different ATTR_LANGUAGE_FORMAT mean different number formats

Extend ScPatternAttr::HasNumberFormat to check ATTR_LANGUAGE_FORMAT
when detecting different number formats, which will disable controls
in SvxNumberFormatTabPage::Reset (see handling of pValFmtAttr there).
Also invalidate ATTR_VALUE_FORMAT explicitly in ExecuteCellFormatDlg,
when HasNumberFormat returned false.

Change-Id: I7c415903e71149f4fabb98840fae36e2379d4830
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186794
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186944

diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx
index 2a1528456c8e..3a0a6aa2d6ae 100644
--- a/sc/source/core/data/patattr.cxx
+++ b/sc/source/core/data/patattr.cxx
@@ -1651,9 +1651,10 @@ LanguageType getLanguageType(const SfxItemSet& rSet)
 
 bool ScPatternAttr::HasNumberFormat() const
 {
-// If ATTR_VALUE_FORMAT is invalid in the pattern,
+// If either ATTR_VALUE_FORMAT or ATTR_LANGUAGE_FORMAT are invalid in the 
pattern,
 // it means a multiselection with different formats
-return GetItemSet().GetItemState(ATTR_VALUE_FORMAT) != 
SfxItemState::INVALID;
+return GetItemSet().GetItemState(ATTR_VALUE_FORMAT) != 
SfxItemState::INVALID
+   && GetItemSet().GetItemState(ATTR_LANGUAGE_FORMAT) != 
SfxItemState::INVALID;
 }
 
 sal_uInt32 ScPatternAttr::GetNumberFormatKey() const
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index c96e9494d49d..461d363d0f3a 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -601,6 +601,8 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& rReq, 
const OUString &rNam
 if (pOldAttrs->HasNumberFormat()) // tdf#42989: don't set it for 
multi-format selection
 xOldSet->Put(
 SfxUInt32Item(ATTR_VALUE_FORMAT, 
pOldAttrs->GetNumberFormat(rDoc.GetFormatTable(;
+else // Make sure it's invalid, when ATTR_LANGUAGE_FORMAT is invalid
+xOldSet->InvalidateItem(ATTR_VALUE_FORMAT);
 
 std::unique_ptr pNumberInfoItem = 
MakeNumberInfoItem(rDoc, GetViewData());
 xOldSet->MergeRange( SID_ATTR_NUMBERFORMAT_INFO, 
SID_ATTR_NUMBERFORMAT_INFO );


core.git: Branch 'libreoffice-25-8' - sc/source

2025-06-30 Thread Mike Kaganski (via logerrit)
 sc/source/core/data/patattr.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit f6959f2682d4b43464098c1ea4c12887fc276572
Author: Mike Kaganski 
AuthorDate: Sun Jun 22 18:38:27 2025 +0500
Commit: Xisco Fauli 
CommitDate: Mon Jun 30 13:35:27 2025 +0200

tdf#167062: fix ScPatternAttr::HasNumberFormat implementation

It must only return false, when respective item is invalidated.

See ScViewFunc::ApplyAttributes, which may avoid setting cell
number format, when only language has changed; this may create
cells having ATTR_LANGUAGE_FORMAT, but not ATTR_VALUE_FORMAT.
This case must be handled as "having a number format", for the
purposes of preparing item set for number format dialog. See
ScTabViewShell::ExecuteCellFormatDlg, where it is checked and
prepared.

Change-Id: Ida0c8495ce582739a3ddfa0ced392b3d9c7651de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186793
Reviewed-by: Mike Kaganski 
Tested-by: Jenkins
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186943

diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx
index 2dfcf5383771..2a1528456c8e 100644
--- a/sc/source/core/data/patattr.cxx
+++ b/sc/source/core/data/patattr.cxx
@@ -1651,7 +1651,9 @@ LanguageType getLanguageType(const SfxItemSet& rSet)
 
 bool ScPatternAttr::HasNumberFormat() const
 {
-return GetItemSet().HasItem(ATTR_VALUE_FORMAT);
+// If ATTR_VALUE_FORMAT is invalid in the pattern,
+// it means a multiselection with different formats
+return GetItemSet().GetItemState(ATTR_VALUE_FORMAT) != 
SfxItemState::INVALID;
 }
 
 sal_uInt32 ScPatternAttr::GetNumberFormatKey() const


core.git: Branch 'libreoffice-25-8' - sc/source

2025-06-27 Thread Noel Grandin (via logerrit)
 sc/source/filter/oox/condformatbuffer.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit a33c5a4298b6292871f818fc57275840c519af6c
Author: Noel Grandin 
AuthorDate: Fri Jun 27 12:00:02 2025 +0200
Commit: Xisco Fauli 
CommitDate: Fri Jun 27 15:36:38 2025 +0200

tdf#167019 Conditional formatting is not handled properly

regression from
commit e2cc1f8a6bd27907800416a5396942a0c7ca56ce
Author: Noel Grandin 
Date:   Fri Feb 28 10:51:44 2025 +0200
tdf#134864 speedup load of pathological conditional formats in XLS

Change-Id: I9e9383e9ccb572e7cbca2b4f32c95213e6464a92
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187094
Reviewed-by: Noel Grandin 
Tested-by: Jenkins
(cherry picked from commit a67ab7ea6f090ee90871bfb97243b9cd66b44af4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187105
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/filter/oox/condformatbuffer.cxx 
b/sc/source/filter/oox/condformatbuffer.cxx
index 1739b71b7915..4bde48c3899e 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -1440,6 +1440,8 @@ private:
 }
 bool equals(const CondFormatRuleModel& lhs, const CondFormatRuleModel& 
rhs) const
 {
+if (lhs.maFormulas != rhs.maFormulas)
+return false;
 if (lhs.maText != rhs.maText)
 return false;
 // we skip mnPriority, because that is implicitly compared by the 
ordering of these objects


core.git: Branch 'libreoffice-25-8' - sc/source

2025-06-26 Thread Noel Grandin (via logerrit)
 sc/source/filter/xml/XMLStylesExportHelper.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit d0c11a08ed4bea6405411d4e590ae819806b7613
Author: Noel Grandin 
AuthorDate: Wed Jun 25 21:10:51 2025 +0200
Commit: Xisco Fauli 
CommitDate: Thu Jun 26 18:03:02 2025 +0200

tdf#165481 memory leak in Save AutoRecovery information

regression from
  commit b8720d1e1f0842d52f1830c48ef7551b1868ae6f
  Author: Luboš Luňák 
  Date:   Fri Mar 25 12:42:58 2022 +0100
  fix ScTable::GetLastChangedCol() for unallocated columns

Change-Id: I639ecc87839a9149c45583d524850db66769bfc7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187003
Reviewed-by: Noel Grandin 
Tested-by: Jenkins
(cherry picked from commit 0668573914ccf9f8611b38289471909c4d0f7888)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187017
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/filter/xml/XMLStylesExportHelper.cxx 
b/sc/source/filter/xml/XMLStylesExportHelper.cxx
index 09e38476df83..afa0e9b87a71 100644
--- a/sc/source/filter/xml/XMLStylesExportHelper.cxx
+++ b/sc/source/filter/xml/XMLStylesExportHelper.cxx
@@ -425,7 +425,7 @@ sal_Int32 ScMyDefaultStyles::GetStyleNameIndex(const 
ScFormatRangeStyles* pCellS
 }
 
 void ScMyDefaultStyles::FillDefaultStyles(const sal_Int32 nTable,
-const sal_Int32 nLastRow, const sal_Int32 nLastCol,
+const sal_Int32 nLastRow, sal_Int32 nLastCol,
 const ScFormatRangeStyles* pCellStyles, ScDocument* pDoc)
 {
 maColDefaults.clear();
@@ -434,7 +434,7 @@ void ScMyDefaultStyles::FillDefaultStyles(const sal_Int32 
nTable,
 return ;
 
 SCTAB nTab = static_cast(nTable);
-pDoc->CreateColumnIfNotExists(nTab, nLastCol);
+nLastCol = pDoc->ClampToAllocatedColumns(nTab, nLastCol);
 sal_Int32 nPos;
 ScMyDefaultStyleList* pDefaults = &maColDefaults;
 bool bPrevAutoStyle(false);


core.git: Branch 'libreoffice-25-8' - sc/source

2025-06-19 Thread Andreas Heinisch (via logerrit)
 sc/source/ui/view/cellsh2.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit bd90bfb91c2378f2e0aca502c44b5c6502da4170
Author: Andreas Heinisch 
AuthorDate: Wed Jun 18 22:38:19 2025 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Thu Jun 19 22:18:47 2025 +0200

tdf#117346 - Show current data range of the filter without selection

After resetting the filter, show current data range of the filter with
selection. This reset also the filter button.

Change-Id: I3885e3d21ce3849abe4786621d0fc391b29f8b71
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186695
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 
(cherry picked from commit 06135b1102d28ae1c2d95e52504e824a9847bf12)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186722
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index ee2812608bd2..a8e494abeeae 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -672,7 +672,8 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
 case SID_UNFILTER:
 {
 ScQueryParam aParam;
-ScDBData*pDBData = pTabViewShell->GetDBData();
+// tdf#117346 - show current data range of the filter with 
selection
+ScDBData* pDBData = pTabViewShell->GetDBData(true, SC_DB_OLD);
 
 pDBData->GetQueryParam( aParam );
 SCSIZE nEC = aParam.GetEntryCount();


core.git: Branch 'libreoffice-25-8' - sc/source

2025-06-18 Thread Balazs Varga (via logerrit)
 sc/source/ui/view/drawview.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 71dfc16dae3232024242e7d3c009a34a51f411a6
Author: Balazs Varga 
AuthorDate: Tue Jun 17 17:29:23 2025 +0200
Commit: Xisco Fauli 
CommitDate: Wed Jun 18 10:23:49 2025 +0200

Related: tdf#166633 - sc fix wrong context menu for textboxes

Remove unnecessary statement from else if.

Change-Id: I91f2417404ecce1eefd056806fa1cc78a9267517
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186625
Tested-by: Jenkins
Reviewed-by: Balazs Varga 
(cherry picked from commit cf339d5f79551dec606e4872d2bb0307be382080)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186637
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx
index edab516f7f41..0221a047cd26 100644
--- a/sc/source/ui/view/drawview.cxx
+++ b/sc/source/ui/view/drawview.cxx
@@ -407,7 +407,7 @@ void ScDrawView::MarkListHasChanged()
 if (!pViewSh->IsDrawTextShell()) // when creating a text object 
@#70206#
 pViewSh->SetDrawShell(true);
 }
-else if (nSdrObjKind != SdrObjKind::Text && 
!pViewSh->IsDrawTextShell())
+else if (!pViewSh->IsDrawTextShell())
 {
 // tdf#166481: we only need to switch to draw shell if we have not
 // already created a text shell for text edit mode


core.git: Branch 'libreoffice-25-8' - sc/source

2025-06-10 Thread Stephan Bergmann (via logerrit)
 sc/source/core/data/dptabsrc.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 047b8074d9f9edb2e9f3058b4380ca024b5713f8
Author: Stephan Bergmann 
AuthorDate: Mon Jun 9 22:07:46 2025 +0200
Commit: Xisco Fauli 
CommitDate: Tue Jun 10 10:21:58 2025 +0200

Missing include (for LONG_MAX)

Change-Id: I8f03310ab1b5da503670f77bf9c5211e956dd48c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186305
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 
(cherry picked from commit 0084c2b22ce26084df5a379135ba8ac174585ac0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186314
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx
index ad8f2490f2ba..61123f89cd8a 100644
--- a/sc/source/core/data/dptabsrc.cxx
+++ b/sc/source/core/data/dptabsrc.cxx
@@ -20,6 +20,7 @@
 #include 
 
 #include 
+#include 
 #include 
 
 #include