core.git: sc/source
sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 7d334ba7467d03e2d890e2926244f783d403878f Author: Michael Weghorn AuthorDate: Mon Jun 10 14:08:15 2024 +0200 Commit: Michael Weghorn CommitDate: Tue Jun 11 03:15:43 2024 +0200 tdf#158914 sc a11y: Remember new cell text again commit 5f9a955042822d05af5c04b2c852738c7e1e21a2 Author: Michael Weghorn Date: Fri Jun 7 13:03:19 2024 +0200 tdf#158914 sc a11y: Send TEXT_CHANGED event when text changes had made sending a `AccessibleEventId::VALUE_CHANGED` event conditional on the cell having a *numerical* value. Assigning the new string to `m_strCurCellValue` should always happen independent of this, though, as this is the string value, not the numerical value. Thanks to Patrick Luby for noting the difference in [1]. [1] https://gerrit.libreoffice.org/c/core/+/167961/comment/1af95eb6_7db33e0b/ Change-Id: I1d1da2caeb7f2199251599313ec4412d7b6e47b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168635 Tested-by: Jenkins Reviewed-by: Patrick Luby Reviewed-by: Michael Weghorn diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx index 39998fa7fee6..1c27bbc94d81 100644 --- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx +++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx @@ -697,8 +697,9 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint AccessibleEventObject aEvent; aEvent.EventId = AccessibleEventId::VALUE_CHANGED; mpAccCell->CommitChange(aEvent); -m_strCurCellValue=valStr; } + +m_strCurCellValue = valStr; } OUString tabName; pScDoc->GetName( maActiveCell.Tab(), tabName );
core.git: sc/source
sc/source/core/tool/address.cxx | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) New commits: commit 6cd7d9322e24ffed4dbaa4cd9b09c3c8e65d9128 Author: Caolán McNamara AuthorDate: Sat Jun 8 21:00:09 2024 +0100 Commit: Caolán McNamara CommitDate: Sun Jun 9 15:28:02 2024 +0200 ofz#69444 Integer-overflow Change-Id: I24d93f4c61256cd0750ab01cf5a8f313e875d35b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168580 Reviewed-by: Caolán McNamara Tested-by: Jenkins diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index c419d9f3a312..ffbeb495d4ab 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -147,25 +147,25 @@ static sal_Int64 sal_Unicode_strtol ( const sal_Unicode* p, const sal_Unicode** else if( *p == '+' ) p++; -const sal_Int64 cutoff = is_neg ? -(std::numeric_limits::min() / 10) -: std::numeric_limits::max() / 10; -const sal_Int64 cutlim = is_neg ? -(std::numeric_limits::min() % 10) -: std::numeric_limits::max() % 10; +const sal_Int64 cutoff = is_neg ? std::numeric_limits::min() / 10 +: -(std::numeric_limits::max() / 10); +const int cutlim = is_neg ? -(std::numeric_limits::min() % 10) + : std::numeric_limits::max() % 10; while (rtl::isAsciiDigit( *p )) { int val = *p - '0'; -if (accum > cutoff || (accum == cutoff && val > cutlim)) +if (accum < cutoff || (accum == cutoff && val > cutlim)) { *pEnd = nullptr; return 0; } -accum = accum * 10 + val; +accum = accum * 10 - val; p++; } *pEnd = p; -return is_neg ? -accum : accum; +return is_neg ? accum : -accum; } static const sal_Unicode* lcl_eatWhiteSpace( const sal_Unicode* p )
core.git: sc/source
sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit d2eab48f697a1e6097778158f623f11306ac7a3d Author: Caolán McNamara AuthorDate: Sat Jun 8 19:56:21 2024 +0100 Commit: Caolán McNamara CommitDate: Sat Jun 8 22:01:04 2024 +0200 cid#1603563 Unchecked return value Change-Id: Ie41d77d8809b28e44b2fa084f2f9e6cdfb6e167f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168579 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx index 64d220619c7f..39998fa7fee6 100644 --- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx +++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx @@ -685,7 +685,7 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint { uno::Any aOldValue; uno::Any aNewValue; - comphelper::OCommonAccessibleText::implInitTextChangedEvent(m_strCurCellValue, valStr, aOldValue, aNewValue); + (void)comphelper::OCommonAccessibleText::implInitTextChangedEvent(m_strCurCellValue, valStr, aOldValue, aNewValue); AccessibleEventObject aTextChangedEvent; aTextChangedEvent.EventId = AccessibleEventId::TEXT_CHANGED; aTextChangedEvent.OldValue = aOldValue;
core.git: sc/source
sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx | 21 +++ 1 file changed, 17 insertions(+), 4 deletions(-) New commits: commit 5f9a955042822d05af5c04b2c852738c7e1e21a2 Author: Michael Weghorn AuthorDate: Fri Jun 7 13:03:19 2024 +0200 Commit: Michael Weghorn CommitDate: Fri Jun 7 14:44:14 2024 +0200 tdf#158914 sc a11y: Send TEXT_CHANGED event when text changes Don't always send an `AccessibleEventId::VALUE_CHANGED` event when the string value of a Calc cell changes, but send a `AccessibleEventId::TEXT_CHANGED` event instead. Only send an `AccessibleEventId::VALUE_CHANGED` event in addition if the cell actually has value data, as the `XAccessibleValue` interface and the related `VALUE_CHANGED` event are meant to handle numerical values only. Together with changes like the one in PS 11 of [1], sending the `TEXT_CHANGE` event might help with missing text updates on the AT side, e.g. the NVDA or Accerciser scenarios described in [2], s. further discussion there. [1] https://gerrit.libreoffice.org/c/core/+/167961 [2] https://gerrit.libreoffice.org/c/core/+/167961/comments/16394c5a_338dbbf2 Change-Id: Ideba61a9200100c66d55fa18e81ea28e75092905 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168526 Reviewed-by: Patrick Luby Tested-by: Jenkins Reviewed-by: Michael Weghorn diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx index 7296863d0cee..64d220619c7f 100644 --- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx +++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -682,10 +683,22 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint OUString valStr(pScDoc->GetString(aNewCell.Col(),aNewCell.Row(),aNewCell.Tab())); if(m_strCurCellValue != valStr) { -AccessibleEventObject aEvent; -aEvent.EventId = AccessibleEventId::VALUE_CHANGED; -mpAccCell->CommitChange(aEvent); -m_strCurCellValue=valStr; +uno::Any aOldValue; +uno::Any aNewValue; + comphelper::OCommonAccessibleText::implInitTextChangedEvent(m_strCurCellValue, valStr, aOldValue, aNewValue); +AccessibleEventObject aTextChangedEvent; +aTextChangedEvent.EventId = AccessibleEventId::TEXT_CHANGED; +aTextChangedEvent.OldValue = aOldValue; +aTextChangedEvent.NewValue = aNewValue; +mpAccCell->CommitChange(aTextChangedEvent); + +if (pScDoc->HasValueData(maActiveCell)) +{ +AccessibleEventObject aEvent; +aEvent.EventId = AccessibleEventId::VALUE_CHANGED; +mpAccCell->CommitChange(aEvent); +m_strCurCellValue=valStr; +} } OUString tabName; pScDoc->GetName( maActiveCell.Tab(), tabName );
core.git: sc/source
sc/source/filter/excel/xeformula.cxx | 39 -- sc/source/filter/excel/xelink.cxx| 60 ++- 2 files changed, 47 insertions(+), 52 deletions(-) New commits: commit 243e811abc441ec7f55e1395f23343dfa6f7c812 Author: Caolán McNamara AuthorDate: Wed Jun 5 10:14:49 2024 +0100 Commit: Caolán McNamara CommitDate: Wed Jun 5 13:40:42 2024 +0200 cid#1603200 Uninitialized scalar variable cid#1603199 Uninitialized scalar variable and other fixups for: commit fbe8071e4f6be57d3e372d69a4c7cc4d37a83eb9 Date: Sat Oct 15 14:20:31 2022 +0200 refactor functions: return optional instead of bool Change-Id: I192017d0fc710ada7686e4c6dd313727b02f3889 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168453 Reviewed-by: Eike Rathke Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sc/source/filter/excel/xeformula.cxx b/sc/source/filter/excel/xeformula.cxx index 688a9f147217..16bd88715d54 100644 --- a/sc/source/filter/excel/xeformula.cxx +++ b/sc/source/filter/excel/xeformula.cxx @@ -452,6 +452,13 @@ private: voidAppendExt( double fData ); voidAppendExt( const OUString& rString ); +std::optional> InsertDde(const OUString& rApplic, const OUString& rTopic, const OUString& rItem) +{ +if (!mxData->mpLinkMgr) +return {}; +return mxData->mpLinkMgr->InsertDde(rApplic, rTopic, rItem); +} + private: typedef std::map< XclFormulaType, XclExpCompConfig > XclExpCompConfigMap; typedef std::shared_ptr< XclExpCompData > XclExpCompDataRef; @@ -1292,16 +1299,13 @@ void XclExpFmlaCompImpl::ProcessDdeLink( const XclExpScToken& rTokData ) if( mxData->mbOk ) mxData->mbOk = !aApplic.isEmpty() && !aTopic.isEmpty() && !aItem.isEmpty(); if( mxData->mbOk ) { -if ( mxData->mpLinkMgr ) -{ -const auto oResult = mxData->mpLinkMgr->InsertDde( aApplic, aTopic, aItem); +const auto oResult = InsertDde(aApplic, aTopic, aItem); -if ( oResult ) { -AppendNameXToken( oResult->first, oResult->second, rTokData.mnSpaces ); -} -else { -AppendErrorToken( EXC_ERR_NA, rTokData.mnSpaces ); -} +if ( oResult ) { +AppendNameXToken( oResult->first, oResult->second, rTokData.mnSpaces ); +} +else { +AppendErrorToken( EXC_ERR_NA, rTokData.mnSpaces ); } } } @@ -2438,9 +2442,11 @@ void XclExpFmlaCompImpl::AppendAddInCallToken( const XclExpExtFuncData& rExtFunc if( mxData->mpLinkMgr && ScGlobal::GetAddInCollection()->GetExcelName( rExtFuncData.maFuncName, GetUILanguage(), aXclFuncName ) ) { const auto oResult = mxData->mpLinkMgr->InsertAddIn( aXclFuncName ); -AppendNameXToken(oResult->first, oResult->second); -return; - +if (oResult) +{ +AppendNameXToken(oResult->first, oResult->second); +return; +} } AppendMacroCallToken( rExtFuncData ); } @@ -2450,14 +2456,13 @@ void XclExpFmlaCompImpl::AppendEuroToolCallToken( const XclExpExtFuncData& rExtF if ( mxData->mpLinkMgr ) { const auto oResult = mxData->mpLinkMgr->InsertEuroTool( rExtFuncData.maFuncName ); - -if ( oResult ) { +if ( oResult ) +{ AppendNameXToken( oResult->first, oResult->second ); -} -else { -AppendMacroCallToken( rExtFuncData ); +return; } } +AppendMacroCallToken( rExtFuncData ); } void XclExpFmlaCompImpl::AppendOperatorTokenId( sal_uInt8 nTokenId, const XclExpOperandListRef& rxOperands, sal_uInt8 nSpaces ) diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx index dff69ed799ab..47217e2d775c 100644 --- a/sc/source/filter/excel/xelink.cxx +++ b/sc/source/filter/excel/xelink.cxx @@ -1989,18 +1989,17 @@ std::optional> XclExpSupbookBuffer::InsertEuro { XclExpSupbookRef xSupbook; OUString aUrl( u"EUROTOOL.XLA"_ustr ); -const auto& nSupbookId = GetSupbookUrl(xSupbook, aUrl); -sal_uInt16 nSupbook; -if( !nSupbookId ) +auto nSupbookId = GetSupbookUrl(xSupbook, aUrl); +if (!nSupbookId) { xSupbook = new XclExpSupbook( GetRoot(), aUrl, XclSupbookType::Eurotool ); -nSupbook = Append( xSupbook ); +nSupbookId = Append(xSupbook); } auto nExtName = xSupbook->InsertEuroTool( rName ); if( nExtName > 0) { -return std::make_pair(nSupbook, nExtName); +return std::make_pair(*nSupbookId, nExtName); } return {}; } @@ -2010,16 +2009,15 @@ std::optional> XclExpSupbookBuffer::InsertDde( { XclExpSupbookRef xSupbook; auto nSupbookDde = GetSupbookDde( xSupbook, rApplic, rTopic ); -sal_uInt16 nSupbook; -if( !nSupbookDde )
core.git: sc/source
sc/source/filter/excel/xeformula.cxx | 56 +++--- sc/source/filter/excel/xelink.cxx| 323 +-- sc/source/filter/inc/xelink.hxx | 33 +-- 3 files changed, 207 insertions(+), 205 deletions(-) New commits: commit fbe8071e4f6be57d3e372d69a4c7cc4d37a83eb9 Author: Andrea Rosetti AuthorDate: Sat Oct 15 14:20:31 2022 +0200 Commit: Hossein CommitDate: Tue Jun 4 12:22:53 2024 +0200 refactor functions: return optional instead of bool Change-Id: Ic4ff3ddaac161df13bf1e3e1372811a0685ec6c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141417 Reviewed-by: Jonathan Clark Reviewed-by: Hossein Tested-by: Jenkins diff --git a/sc/source/filter/excel/xeformula.cxx b/sc/source/filter/excel/xeformula.cxx index 1d0ce72e9c36..688a9f147217 100644 --- a/sc/source/filter/excel/xeformula.cxx +++ b/sc/source/filter/excel/xeformula.cxx @@ -1292,11 +1292,17 @@ void XclExpFmlaCompImpl::ProcessDdeLink( const XclExpScToken& rTokData ) if( mxData->mbOk ) mxData->mbOk = !aApplic.isEmpty() && !aTopic.isEmpty() && !aItem.isEmpty(); if( mxData->mbOk ) { -sal_uInt16 nExtSheet(0), nExtName(0); -if( mxData->mpLinkMgr && mxData->mpLinkMgr->InsertDde( nExtSheet, nExtName, aApplic, aTopic, aItem ) ) -AppendNameXToken( nExtSheet, nExtName, rTokData.mnSpaces ); -else -AppendErrorToken( EXC_ERR_NA, rTokData.mnSpaces ); +if ( mxData->mpLinkMgr ) +{ +const auto oResult = mxData->mpLinkMgr->InsertDde( aApplic, aTopic, aItem); + +if ( oResult ) { +AppendNameXToken( oResult->first, oResult->second, rTokData.mnSpaces ); +} +else { +AppendErrorToken( EXC_ERR_NA, rTokData.mnSpaces ); +} +} } } @@ -2215,12 +2221,14 @@ void XclExpFmlaCompImpl::ProcessExternalName( const XclExpScToken& rTokData ) } // insert the new external name and create the tNameX token -sal_uInt16 nExtSheet = 0, nExtName = 0; -const OUString* pFile = rExtRefMgr.getExternalFileName( nFileId ); -if( pFile && mxData->mpLinkMgr->InsertExtName( nExtSheet, nExtName, *pFile, aName, xArray ) ) -{ -AppendNameXToken( nExtSheet, nExtName, rTokData.mnSpaces ); -return; +if (const OUString* pFile = rExtRefMgr.getExternalFileName( nFileId )) { + + +const auto oResult = mxData->mpLinkMgr->InsertExtName( *pFile, aName, xArray ); +if( oResult ) { +AppendNameXToken( oResult->first, oResult->second, rTokData.mnSpaces ); +return; +} } } } @@ -2429,23 +2437,27 @@ void XclExpFmlaCompImpl::AppendAddInCallToken( const XclExpExtFuncData& rExtFunc OUString aXclFuncName; if( mxData->mpLinkMgr && ScGlobal::GetAddInCollection()->GetExcelName( rExtFuncData.maFuncName, GetUILanguage(), aXclFuncName ) ) { -sal_uInt16 nExtSheet, nExtName; -if( mxData->mpLinkMgr->InsertAddIn( nExtSheet, nExtName, aXclFuncName ) ) -{ -AppendNameXToken( nExtSheet, nExtName ); -return; -} +const auto oResult = mxData->mpLinkMgr->InsertAddIn( aXclFuncName ); +AppendNameXToken(oResult->first, oResult->second); +return; + } AppendMacroCallToken( rExtFuncData ); } void XclExpFmlaCompImpl::AppendEuroToolCallToken( const XclExpExtFuncData& rExtFuncData ) { -sal_uInt16 nExtSheet(0), nExtName(0); -if( mxData->mpLinkMgr && mxData->mpLinkMgr->InsertEuroTool( nExtSheet, nExtName, rExtFuncData.maFuncName ) ) -AppendNameXToken( nExtSheet, nExtName ); -else -AppendMacroCallToken( rExtFuncData ); +if ( mxData->mpLinkMgr ) +{ +const auto oResult = mxData->mpLinkMgr->InsertEuroTool( rExtFuncData.maFuncName ); + +if ( oResult ) { +AppendNameXToken( oResult->first, oResult->second ); +} +else { +AppendMacroCallToken( rExtFuncData ); +} +} } void XclExpFmlaCompImpl::AppendOperatorTokenId( sal_uInt8 nTokenId, const XclExpOperandListRef& rxOperands, sal_uInt8 nSpaces ) diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx index dd27be049429..dff69ed799ab 100644 --- a/sc/source/filter/excel/xelink.cxx +++ b/sc/source/filter/excel/xelink.cxx @@ -413,25 +413,24 @@ public: voidStoreCellRange( sal_uInt16 nFileId, const OUString& rTabName, const ScRange& rRange ); /** Finds or inserts an EXTERNNAME record for an add-in function name. -@param rnSupbook Returns the index of the SUPBOOK record which contains the add-in function name. -@param rnExtName Returns the 1-based EXTERNNAME record index. */ -boolInsertAddIn( -
core.git: sc/source
sc/source/core/tool/interpr1.cxx | 22 +- 1 file changed, 21 insertions(+), 1 deletion(-) New commits: commit a523e9bf2d54fc84583c9da05af592297b055e40 Author: Eike Rathke AuthorDate: Fri May 31 17:34:35 2024 +0200 Commit: Eike Rathke CommitDate: Sat Jun 1 22:21:38 2024 +0200 Resolves: tdf#158789 operate on query array if no extra array or range given Also push error and bail out early if there was an error, or more important pResultMatrix is nullptr. Change-Id: I1094ed9d14795ea1bc3f4ff61d687cc28d0b94fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168300 Tested-by: Jenkins Reviewed-by: Eike Rathke diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 621e3d9ee8a0..b8ece94894b4 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -5740,7 +5740,8 @@ void ScInterpreter::IterateParametersIf( ScIterFuncIf eFunc ) ScMatrixRef pResultMatrix = QueryMat( pQueryMatrix, aOptions); if (nGlobalError != FormulaError::NONE || !pResultMatrix) { -SetError( FormulaError::IllegalParameter); +PushIllegalParameter(); +return; } if (pSumExtraMatrix) @@ -5764,6 +5765,25 @@ void ScInterpreter::IterateParametersIf( ScIterFuncIf eFunc ) } } } +else if (!bSumExtraRange) +{ +for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol) +{ +for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow) +{ +if (pResultMatrix->IsValue( nCol, nRow) && +pResultMatrix->GetDouble( nCol, nRow)) +{ +if (pQueryMatrix->IsValue( nCol, nRow)) +{ +fVal = pQueryMatrix->GetDouble( nCol, nRow); +++fCount; +fSum += fVal; +} +} +} +} +} else { for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
core.git: sc/source
sc/source/ui/view/SparklineShell.cxx |7 +-- sc/source/ui/view/auditsh.cxx|4 ++-- sc/source/ui/view/cellsh.cxx |8 sc/source/ui/view/cellsh1.cxx| 18 +- sc/source/ui/view/cellsh2.cxx|6 +++--- sc/source/ui/view/cellsh3.cxx| 18 +- sc/source/ui/view/drawvie4.cxx |4 ++-- sc/source/ui/view/editsh.cxx |8 sc/source/ui/view/formatsh.cxx |4 ++-- sc/source/ui/view/gridwin.cxx| 18 +- sc/source/ui/view/gridwin4.cxx |2 +- sc/source/ui/view/hdrcont.cxx|6 +++--- sc/source/ui/view/output2.cxx| 12 ++-- sc/source/ui/view/pgbrksh.cxx|4 ++-- sc/source/ui/view/pivotsh.cxx|4 ++-- sc/source/ui/view/prevwsh.cxx|6 +++--- sc/source/ui/view/printfun.cxx |6 +++--- sc/source/ui/view/tabcont.cxx|6 +++--- sc/source/ui/view/tabvwsh4.cxx |6 +++--- sc/source/ui/view/tabvwsha.cxx |2 +- sc/source/ui/view/tabvwshb.cxx |4 ++-- sc/source/ui/view/tabvwshg.cxx | 12 ++-- sc/source/ui/view/viewdata.cxx |2 +- sc/source/ui/view/viewfun2.cxx | 10 +- sc/source/ui/view/viewfun3.cxx | 24 sc/source/ui/view/viewfun4.cxx |6 +++--- sc/source/ui/view/viewfun5.cxx |2 +- sc/source/ui/view/viewfun6.cxx |2 +- sc/source/ui/view/viewfun7.cxx |4 ++-- sc/source/ui/view/viewfunc.cxx | 32 30 files changed, 125 insertions(+), 122 deletions(-) New commits: commit f9ffaeaf7b2dce382474dbbb61819a2c039c0bf6 Author: Noel Grandin AuthorDate: Sat Jun 1 10:27:57 2024 +0200 Commit: Noel Grandin CommitDate: Sat Jun 1 20:00:59 2024 +0200 loplugin:ostr in sc/../view Change-Id: I24e84cd42e3f55761fbc1fb8ae9b2cf3fc7bd385 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168309 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sc/source/ui/view/SparklineShell.cxx b/sc/source/ui/view/SparklineShell.cxx index 9de6c6af1e02..1cf505df8a37 100644 --- a/sc/source/ui/view/SparklineShell.cxx +++ b/sc/source/ui/view/SparklineShell.cxx @@ -23,7 +23,10 @@ namespace sc { SFX_IMPL_INTERFACE(SparklineShell, SfxShell) -void SparklineShell::InitInterface_Impl() { GetStaticInterface()->RegisterPopupMenu("sparkline"); } +void SparklineShell::InitInterface_Impl() +{ +GetStaticInterface()->RegisterPopupMenu(u"sparkline"_ustr); +} SparklineShell::SparklineShell(ScTabViewShell* pViewShell) : SfxShell(pViewShell) @@ -37,7 +40,7 @@ SparklineShell::SparklineShell(ScTabViewShell* pViewShell) { pUndoManager->SetMaxUndoActionCount(0); } -SetName("Sparkline"); +SetName(u"Sparkline"_ustr); SfxShell::SetContextName( vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Sparkline)); } diff --git a/sc/source/ui/view/auditsh.cxx b/sc/source/ui/view/auditsh.cxx index 2ea903f59e75..d1dcff0aa65f 100644 --- a/sc/source/ui/view/auditsh.cxx +++ b/sc/source/ui/view/auditsh.cxx @@ -36,7 +36,7 @@ SFX_IMPL_INTERFACE(ScAuditingShell, SfxShell) void ScAuditingShell::InitInterface_Impl() { -GetStaticInterface()->RegisterPopupMenu("audit"); +GetStaticInterface()->RegisterPopupMenu(u"audit"_ustr); } ScAuditingShell::ScAuditingShell(ScViewData& rData) : @@ -51,7 +51,7 @@ ScAuditingShell::ScAuditingShell(ScViewData& rData) : { pMgr->SetMaxUndoActionCount( 0 ); } -SetName("Auditing"); +SetName(u"Auditing"_ustr); SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Auditing)); } diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx index d907daf51ac2..b61a5618 100644 --- a/sc/source/ui/view/cellsh.cxx +++ b/sc/source/ui/view/cellsh.cxx @@ -67,7 +67,7 @@ void ScCellShell::InitInterface_Impl() SfxVisibilityFlags::Standard | SfxVisibilityFlags::Server, ToolbarId::Objectbar_Format); -GetStaticInterface()->RegisterPopupMenu("cell"); +GetStaticInterface()->RegisterPopupMenu(u"cell"_ustr); } ScCellShell::ScCellShell(ScViewData& rData, const VclPtr& frameWin) : @@ -76,7 +76,7 @@ ScCellShell::ScCellShell(ScViewData& rData, const VclPtr& frameWin) bPastePossible(false), pFrameWin(frameWin) { -SetName("Cell"); +SetName(u"Cell"_ustr); SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Cell)); } @@ -883,7 +883,7 @@ void ScCellShell::GetState(SfxItemSet ) // In interpreter may happen via rescheduled Basic if ( rDoc.IsInInterpreter() ) -rSet.Put( SvxStatusItem( SID_TABLE_CELL, "...", StatusCategory::Formula ) ); +
core.git: sc/source
sc/source/ui/view/hdrcont.cxx | 31 +-- sc/source/ui/view/tabview.cxx |2 +- 2 files changed, 14 insertions(+), 19 deletions(-) New commits: commit 0a0d3d1f8a34e0b8542c71fe9c3bd3b75d974e7c Author: Heiko Tietze AuthorDate: Wed May 29 17:36:08 2024 +0200 Commit: Heiko Tietze CommitDate: Sat Jun 1 08:41:04 2024 +0200 Resolves tdf#152923 - Make column header outstanding from background * Background color made darker/lighter depending on system settings * Separator lines with less contrast (ShadowColor instead of DarkShadowColor) * Extra line for selection removed as it extends the actual header * Todo: Vertical header starts at a few pixels distance to the edge (patchset 4 fails) Change-Id: If3c47b77ad0bca2db1c25ec46b488a2e338b8133 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168225 Tested-by: Jenkins Reviewed-by: Heiko Tietze diff --git a/sc/source/ui/view/hdrcont.cxx b/sc/source/ui/view/hdrcont.cxx index ec64067f2507..251f9f6f3cf7 100644 --- a/sc/source/ui/view/hdrcont.cxx +++ b/sc/source/ui/view/hdrcont.cxx @@ -321,7 +321,12 @@ void ScHeaderControl::Paint( vcl::RenderContext& /*rRenderContext*/, const tools if ( nLineEnd * nLayoutSign >= nInitScrPos * nLayoutSign ) { -GetOutDev()->SetFillColor( rStyleSettings.GetFaceColor() ); +Color aFaceColor(rStyleSettings.GetFaceColor()); +if (bDark) +aFaceColor.IncreaseLuminance(20); +else +aFaceColor.DecreaseLuminance(20); +GetOutDev()->SetFillColor( aFaceColor ); if ( bVertical ) aFillRect = tools::Rectangle( 0, nInitScrPos, nBarSize-1, nLineEnd ); else @@ -374,26 +379,16 @@ void ScHeaderControl::Paint( vcl::RenderContext& /*rRenderContext*/, const tools } } -GetOutDev()->SetLineColor( rStyleSettings.GetDarkShadowColor() ); +GetOutDev()->SetLineColor( rStyleSettings.GetShadowColor() ); if (bVertical) { -tools::Long nDarkPos = bMirrored ? 0 : nBarSize-1; -GetOutDev()->DrawLine( Point( nDarkPos, nPStart ), Point( nDarkPos, nLineEnd ) ); +GetOutDev()->DrawLine( Point( 0, nPStart ), Point( 0, nLineEnd ) ); //left +GetOutDev()->DrawLine( Point( nBarSize-1, nPStart ), Point( nBarSize-1, nLineEnd ) ); //right } else -GetOutDev()->DrawLine( Point( nPStart, nBarSize-1 ), Point( nLineEnd, nBarSize-1 ) ); - -// line in different color for selection -if ( nTransEnd * nLayoutSign >= nTransStart * nLayoutSign && !bHighContrast ) { -GetOutDev()->SetLineColor(aSelLineColor); -if (bVertical) -{ -tools::Long nDarkPos = bMirrored ? 0 : nBarSize-1; -GetOutDev()->DrawLine( Point( nDarkPos, nTransStart ), Point( nDarkPos, nTransEnd ) ); -} -else -GetOutDev()->DrawLine( Point( nTransStart, nBarSize-1 ), Point( nTransEnd, nBarSize-1 ) ); +GetOutDev()->DrawLine( Point( nPStart, nBarSize-1 ), Point( nLineEnd, nBarSize-1 ) ); //bottom +GetOutDev()->DrawLine( Point( nPStart, 0 ), Point( nLineEnd, 0 ) ); //top } } @@ -464,10 +459,10 @@ void ScHeaderControl::Paint( vcl::RenderContext& /*rRenderContext*/, const tools { case SC_HDRPAINT_SEL_BOTTOM: // same as non-selected for high contrast -GetOutDev()->SetLineColor( bHighContrast ? rStyleSettings.GetDarkShadowColor() : aSelLineColor ); +GetOutDev()->SetLineColor( bHighContrast ? rStyleSettings.GetShadowColor() : aSelLineColor ); break; case SC_HDRPAINT_BOTTOM: -GetOutDev()->SetLineColor( rStyleSettings.GetDarkShadowColor() ); +GetOutDev()->SetLineColor( rStyleSettings.GetShadowColor() ); break; case SC_HDRPAINT_TEXT: // DrawSelectionBackground is used only for high contrast on light background diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 17e4d8859231..8eba950c48ce 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -101,7 +101,7 @@ void ScCornerButton::Paint(vcl::RenderContext& rRenderContext, const tools::Rect tools::Long nDarkX = bLayoutRTL ? 0 : nPosX; // both buttons have the same look now - only dark right/bottom lines -rRenderContext.SetLineColor(rStyleSettings.GetDarkShadowColor()); +rRenderContext.SetLineColor(rStyleSettings.GetShadowColor()); rRenderContext.DrawLine(Point(0, nPosY), Point(nPosX, nPosY)); rRenderContext.DrawLine(Point(nDarkX, 0), Point(nDarkX, nPosY)); }
core.git: sc/source
sc/source/ui/inc/navipi.hxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit a20d5df3f9546947e23cbe6f5718049a1a61a823 Author: Xisco Fauli AuthorDate: Fri May 31 13:42:19 2024 +0200 Commit: Xisco Fauli CommitDate: Fri May 31 23:24:49 2024 +0200 sc: use SAL_RET_MAYBENULL in GetTabViewShell() Change-Id: Icbe2b301aea66a74baf100609f726fc0a6e824c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168292 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/sc/source/ui/inc/navipi.hxx b/sc/source/ui/inc/navipi.hxx index dbaae24657b6..e251a3b47e1d 100644 --- a/sc/source/ui/inc/navipi.hxx +++ b/sc/source/ui/inc/navipi.hxx @@ -144,7 +144,7 @@ private: voidUpdateSelection(); voidContentUpdated(); // stop aContentIdle because content is up to date -static ScTabViewShell* GetTabViewShell(); +SAL_RET_MAYBENULL static ScTabViewShell* GetTabViewShell(); static ScNavigatorSettings* GetNavigatorSettings(); ScViewData* GetViewData();
core.git: sc/source
sc/source/ui/dbgui/PivotLayoutDialog.cxx |2 ++ sc/source/ui/dbgui/consdlg.cxx |1 + sc/source/ui/dbgui/dbnamdlg.cxx |1 + sc/source/ui/dbgui/pvfundlg.cxx |1 + sc/source/ui/inc/PivotLayoutDialog.hxx |3 +++ sc/source/ui/inc/consdlg.hxx |1 + sc/source/ui/inc/dbnamdlg.hxx|1 + sc/source/ui/inc/namedefdlg.hxx |1 + sc/source/ui/inc/namedlg.hxx |2 ++ sc/source/ui/inc/pvfundlg.hxx|1 + sc/source/ui/namedlg/namedefdlg.cxx |1 + sc/source/ui/namedlg/namedlg.cxx |1 + 12 files changed, 16 insertions(+) New commits: commit ebb50b6d89dcbd04073830ec05c9df368a235786 Author: Caolán McNamara AuthorDate: Fri May 31 09:44:11 2024 +0100 Commit: Caolán McNamara CommitDate: Fri May 31 17:52:44 2024 +0200 partial revert to restore existence of Expander wrappers partial revert of: commit 8288d2e3061327fd91e241c0b514cd973e3fcea8 Date: Mon Nov 21 11:04:53 2022 +0200 loplugin:unusedfields because the existence of the welded expander wrappers matters for some of the backends to fully work Change-Id: Ie75e27329a47f708514466401e24eae6ddcd4c0f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168208 Reviewed-by: Caolán McNamara Tested-by: Jenkins diff --git a/sc/source/ui/dbgui/PivotLayoutDialog.cxx b/sc/source/ui/dbgui/PivotLayoutDialog.cxx index db93d6c5cee2..8da65589ffb3 100644 --- a/sc/source/ui/dbgui/PivotLayoutDialog.cxx +++ b/sc/source/ui/dbgui/PivotLayoutDialog.cxx @@ -110,6 +110,8 @@ ScPivotLayoutDialog::ScPivotLayoutDialog( , mxSourceLabel(mxSourceFrame->weld_label_widget()) , mxDestFrame(m_xBuilder->weld_frame(u"frame1"_ustr)) , mxDestLabel(mxDestFrame->weld_label_widget()) +, mxOptions(m_xBuilder->weld_expander("options")) +, mxMore(m_xBuilder->weld_expander("more")) { // Source UI Link aLink2 = LINK(this, ScPivotLayoutDialog, ToggleSource); diff --git a/sc/source/ui/dbgui/consdlg.cxx b/sc/source/ui/dbgui/consdlg.cxx index 90da5447b1bd..22911ed16f6f 100644 --- a/sc/source/ui/dbgui/consdlg.cxx +++ b/sc/source/ui/dbgui/consdlg.cxx @@ -88,6 +88,7 @@ ScConsolidateDlg::ScConsolidateDlg(SfxBindings* pB, SfxChildWindow* pCW, weld::W , m_xLbDestArea(m_xBuilder->weld_combo_box(u"lbdestarea"_ustr)) , m_xEdDestArea(new formula::RefEdit(m_xBuilder->weld_entry(u"eddestarea"_ustr))) , m_xRbDestArea(new formula::RefButton(m_xBuilder->weld_button(u"rbdestarea"_ustr))) +, m_xExpander(m_xBuilder->weld_expander(u"more"_ustr)) , m_xBtnByRow(m_xBuilder->weld_check_button(u"byrow"_ustr)) , m_xBtnByCol(m_xBuilder->weld_check_button(u"bycol"_ustr)) , m_xBtnRefs(m_xBuilder->weld_check_button(u"refs"_ustr)) diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx index 473fbc715215..e8a582da45f7 100644 --- a/sc/source/ui/dbgui/dbnamdlg.cxx +++ b/sc/source/ui/dbgui/dbnamdlg.cxx @@ -148,6 +148,7 @@ ScDbNameDlg::ScDbNameDlg(SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pPa , m_xModifyPB(m_xBuilder->weld_button(u"modify"_ustr)) , m_xInvalidFT(m_xBuilder->weld_label(u"invalid"_ustr)) , m_xFrameLabel(m_xAssignFrame->weld_label_widget()) +, m_xExpander(m_xBuilder->weld_expander("more")) { m_xEdName->set_height_request_by_rows(4); m_xEdAssign->SetReferences(this, m_xFrameLabel.get()); diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx index 8a605fd6d9fe..7c19279945ab 100644 --- a/sc/source/ui/dbgui/pvfundlg.cxx +++ b/sc/source/ui/dbgui/pvfundlg.cxx @@ -246,6 +246,7 @@ ScDPFunctionDlg::ScDPFunctionDlg( , mxLbBaseItem(m_xBuilder->weld_combo_box(u"baseitem"_ustr)) , mxBtnOk(m_xBuilder->weld_button(u"ok"_ustr)) , mxBtnCancel(m_xBuilder->weld_button(u"cancel"_ustr)) +, mxExpander(m_xBuilder->weld_expander(u"expander"_ustr)) , mrLabelVec(rLabelVec) , mbEmptyItem(false) { diff --git a/sc/source/ui/inc/PivotLayoutDialog.hxx b/sc/source/ui/inc/PivotLayoutDialog.hxx index c07693e3518f..c2923ce34ae2 100644 --- a/sc/source/ui/inc/PivotLayoutDialog.hxx +++ b/sc/source/ui/inc/PivotLayoutDialog.hxx @@ -85,6 +85,9 @@ private: std::unique_ptr mxDestFrame; std::unique_ptr mxDestLabel; +std::unique_ptr mxOptions; +std::unique_ptr mxMore; + DECL_LINK(CancelClicked, weld::Button&, void); DECL_LINK(OKClicked, weld::Button&, void); DECL_LINK(GetEditFocusHandler, formula::RefEdit&, void); diff --git a/sc/source/ui/inc/consdlg.hxx b/sc/source/ui/inc/consdlg.hxx index 07fb1f3ed561..140472cbbaf4 100644 --- a/sc/source/ui/inc/consdlg.hxx +++ b/sc/source/ui/inc/consdlg.hxx @@ -66,6 +66,7 @@ private: std::unique_ptr m_xEdDestArea; std::unique_ptr m_xRbDestArea; +std::unique_ptr m_xExpander; std::unique_ptr m_xBtnByRow; std::unique_ptr m_xBtnByCol; diff --git a/sc/source/ui/inc/dbnamdlg.hxx
core.git: sc/source
sc/source/ui/miscdlgs/acredlin.cxx | 12 +- sc/source/ui/miscdlgs/conflictsdlg.cxx | 12 +- sc/source/ui/miscdlgs/crdlg.cxx|9 +- sc/source/ui/miscdlgs/crnrdlg.cxx | 30 +++--- sc/source/ui/miscdlgs/datafdlg.cxx | 26 ++--- sc/source/ui/miscdlgs/dataproviderdlg.cxx | 128 ++--- sc/source/ui/miscdlgs/datastreamdlg.cxx| 33 +++ sc/source/ui/miscdlgs/delcldlg.cxx | 11 +- sc/source/ui/miscdlgs/delcodlg.cxx | 18 ++-- sc/source/ui/miscdlgs/filldlg.cxx | 42 - sc/source/ui/miscdlgs/gototabdlg.cxx | 11 +- sc/source/ui/miscdlgs/groupdlg.cxx | 12 +- sc/source/ui/miscdlgs/highred.cxx | 16 +-- sc/source/ui/miscdlgs/inscldlg.cxx | 15 +-- sc/source/ui/miscdlgs/inscodlg.cxx | 52 +-- sc/source/ui/miscdlgs/instbdlg.cxx | 26 ++--- sc/source/ui/miscdlgs/lbseldlg.cxx |4 sc/source/ui/miscdlgs/linkarea.cxx | 18 ++-- sc/source/ui/miscdlgs/mergecellsdialog.cxx |9 +- sc/source/ui/miscdlgs/mtrindlg.cxx |4 sc/source/ui/miscdlgs/mvtabdlg.cxx | 25 ++--- sc/source/ui/miscdlgs/namecrea.cxx | 11 +- sc/source/ui/miscdlgs/optsolver.cxx| 110 sc/source/ui/miscdlgs/protectiondlg.cxx| 30 +++--- sc/source/ui/miscdlgs/retypepassdlg.cxx| 41 - sc/source/ui/miscdlgs/scuiautofmt.cxx | 28 +++--- sc/source/ui/miscdlgs/sharedocdlg.cxx | 10 +- sc/source/ui/miscdlgs/shtabdlg.cxx |7 - sc/source/ui/miscdlgs/simpref.cxx | 12 +- sc/source/ui/miscdlgs/solveroptions.cxx| 20 ++-- sc/source/ui/miscdlgs/solvrdlg.cxx | 20 ++-- sc/source/ui/miscdlgs/strindlg.cxx |8 - sc/source/ui/miscdlgs/tabbgcolordlg.cxx| 10 +- sc/source/ui/miscdlgs/tabopdlg.cxx | 26 ++--- sc/source/ui/miscdlgs/textdlgs.cxx | 24 ++--- sc/source/ui/miscdlgs/warnbox.cxx |6 - 36 files changed, 443 insertions(+), 433 deletions(-) New commits: commit efe386b01668c9a67224857773849916d44d56cd Author: Noel Grandin AuthorDate: Fri May 31 09:58:06 2024 +0200 Commit: Noel Grandin CommitDate: Fri May 31 16:29:42 2024 +0200 loplugin:ostr in sc/../miscdlgs Change-Id: I9cc24ed6692d9495e6ace3ccacbbe488ef82eea6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168282 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx index 957661186906..782b08b87d47 100644 --- a/sc/source/ui/miscdlgs/acredlin.cxx +++ b/sc/source/ui/miscdlgs/acredlin.cxx @@ -70,7 +70,7 @@ ScRedlinData::~ScRedlinData() ScAcceptChgDlg::ScAcceptChgDlg(SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pParent, ScViewData* ptrViewData) : SfxModelessDialogController(pB, pCW, pParent, -"svx/ui/acceptrejectchangesdialog.ui", "AcceptRejectChangesDialog") +u"svx/ui/acceptrejectchangesdialog.ui"_ustr, u"AcceptRejectChangesDialog"_ustr) , aSelectionIdle( "ScAcceptChgDlg aSelectionIdle" ) , aReOpenIdle("ScAcceptChgDlg ReOpenIdle") , pViewData( ptrViewData ) @@ -91,14 +91,14 @@ ScAcceptChgDlg::ScAcceptChgDlg(SfxBindings* pB, SfxChildWindow* pCW, weld::Windo , aStrChildContent(ScResId(STR_CHG_CHILD_CONTENT)) , aStrChildOrgContent(ScResId(STR_CHG_CHILD_ORGCONTENT)) , aStrEmpty(ScResId(STR_CHG_EMPTY)) -, aUnknown("Unknown") +, aUnknown(u"Unknown"_ustr) , bIgnoreMsg(false) , bNoSelection(false) , bHasFilterEntry(false) , bUseColor(false) , m_xContentArea(m_xDialog->weld_content_area()) -, m_xPopup(m_xBuilder->weld_menu("calcmenu")) -, m_xSortMenu(m_xBuilder->weld_menu("calcsortmenu")) +, m_xPopup(m_xBuilder->weld_menu(u"calcmenu"_ustr)) +, m_xSortMenu(m_xBuilder->weld_menu(u"calcsortmenu"_ustr)) { m_xAcceptChgCtr.reset(new SvxAcceptChgCtr(m_xContentArea.get())); nAcceptCount=0; @@ -1602,7 +1602,7 @@ IMPL_LINK(ScAcceptChgDlg, CommandHdl, const CommandEvent&, rCEvt, bool) for (sal_Int32 i = 0; i < 5; ++i) m_xSortMenu->set_active("calcsort" + OUString::number(i), i == nSortedCol); -m_xPopup->set_sensitive("calcedit", false); +m_xPopup->set_sensitive(u"calcedit"_ustr, false); if (pDoc->IsDocEditable() && bEntry) { @@ -1611,7 +1611,7 @@ IMPL_LINK(ScAcceptChgDlg, CommandHdl, const CommandEvent&, rCEvt, bool) { ScChangeAction* pScChangeAction = static_cast(pEntryData->pData); if (pScChangeAction && !rTreeView.get_iter_depth(*xEntry)) -m_xPopup->set_sensitive("calcedit", true); +m_xPopup->set_sensitive(u"calcedit"_ustr, true); } } diff --git a/sc/source/ui/miscdlgs/conflictsdlg.cxx b/sc/source/ui/miscdlgs/conflictsdlg.cxx index 3a48325aa52c..a70cff4641b0 100644 ---
core.git: sc/source
sc/source/filter/xml/xmlexprt.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit 068befc95ab8d7c368e76f08447827dbdea21014 Author: Justin Luth AuthorDate: Thu May 30 09:22:55 2024 -0400 Commit: Justin Luth CommitDate: Fri May 31 15:27:51 2024 +0200 tdf#114398 ods export: output when CELLTYPE_EDIT assume regression since LO 4.2 based on LO 7.5 a7589f621fcbe6305335730d2dd86b9230a18594 for tdf#103829. Change-Id: I12726697565722e132941875fb32cad95c8f9768 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168270 Tested-by: Jenkins Reviewed-by: Justin Luth diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 1f56ece42e9c..00231fc4ae38 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -3145,6 +3145,11 @@ void flushParagraph( SvXMLElementExport Tab(rExport, XML_NAMESPACE_TEXT, XML_TAB, false, false); break; } +else if (p->Which() == EE_FEATURE_LINEBR) +{ +SvXMLElementExport L(rExport, XML_NAMESPACE_TEXT, XML_LINE_BREAK, false, false); +break; +} } } else
core.git: sc/source
sc/source/ui/Accessibility/AccessibleDocument.cxx |4 +- sc/source/ui/drawfunc/drawsh.cxx | 17 +++- sc/source/ui/drawfunc/drawsh2.cxx |5 ++- sc/source/ui/drawfunc/drawsh5.cxx | 10 --- sc/source/ui/drawfunc/fuconstr.cxx| 12 sc/source/ui/drawfunc/fudraw.cxx | 31 +- sc/source/ui/drawfunc/fuins1.cxx |5 ++- sc/source/ui/drawfunc/fupoor.cxx |4 +- sc/source/ui/drawfunc/fusel.cxx | 14 - sc/source/ui/drawfunc/futext.cxx | 15 -- sc/source/ui/drawfunc/graphsh.cxx |8 ++--- sc/source/ui/view/cliputil.cxx| 12 +--- sc/source/ui/view/drawvie3.cxx| 24 - sc/source/ui/view/drawvie4.cxx|4 +- sc/source/ui/view/drawview.cxx| 13 - sc/source/ui/view/gridwin.cxx |5 ++- sc/source/ui/view/gridwin3.cxx|8 +++-- sc/source/ui/view/tabvwsh2.cxx|9 +++--- sc/source/ui/view/tabvwshb.cxx| 20 +++--- sc/source/ui/view/viewfun7.cxx|8 ++--- 20 files changed, 122 insertions(+), 106 deletions(-) New commits: commit 049dd8300b1b5f97612e18ec2ef893645a38b9fa Author: Xisco Fauli AuthorDate: Fri May 31 10:12:33 2024 +0200 Commit: Xisco Fauli CommitDate: Fri May 31 13:57:49 2024 +0200 sc: Reduce number of calls to GetMarkedObjectList() From 152 to 102 Change-Id: I43907965e5b1ef0819495d6a1e7b18597a1b5947 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168283 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx index 12b8d8c88014..94909b4fa21f 100644 --- a/sc/source/ui/Accessibility/AccessibleDocument.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx @@ -1007,9 +1007,9 @@ bool ScChildrenShapes::FindSelectedShapesChanges(const uno::ReferenceGetViewData().GetScDrawView(); if( pScDrawView ) { -if( pScDrawView->GetMarkedObjectList().GetMarkCount() == 1 ) +pMarkList = &(pScDrawView->GetMarkedObjectList()); +if( pMarkList->GetMarkCount() == 1 ) { -pMarkList = &(pScDrawView->GetMarkedObjectList()); pMarkedObj = pMarkList->GetMark(0)->GetMarkedSdrObj(); uno::Reference< drawing::XShape > xMarkedXShape (pMarkedObj->getUnoShape(), uno::UNO_QUERY); if( aFocusedItr != aDataEndItr && diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx index 68f277a1756c..2e11d3817ee5 100644 --- a/sc/source/ui/drawfunc/drawsh.cxx +++ b/sc/source/ui/drawfunc/drawsh.cxx @@ -255,7 +255,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq ) } -if( pView->GetMarkedObjectList().GetMarkCount() != 0 ) +if( rMarkList.GetMarkCount() != 0 ) { std::unique_ptr pNewArgs = rReq.GetArgs()->Clone(); lcl_convertStringArguments(*pNewArgs); @@ -327,7 +327,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq ) case SID_ATTR_TRANSFORM: { -if ( pView->GetMarkedObjectList().GetMarkCount() != 0 ) +if ( rMarkList.GetMarkCount() != 0 ) { const SfxItemSet* pArgs = rReq.GetArgs(); @@ -476,9 +476,9 @@ void ScDrawShell::ExecuteMacroAssign(SdrObject* pObj, weld::Window* pWin) void ScDrawShell::ExecuteLineDlg( const SfxRequest& rReq ) { ScDrawView* pView = rViewData.GetScDrawView(); -boolbHasMarked = pView->GetMarkedObjectList().GetMarkCount() != 0; +const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); +boolbHasMarked = rMarkList.GetMarkCount() != 0; const SdrObject*pObj= nullptr; -const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); std::shared_ptr xRequest = std::make_shared(rReq); @@ -514,7 +514,8 @@ void ScDrawShell::ExecuteLineDlg( const SfxRequest& rReq ) void ScDrawShell::ExecuteAreaDlg( const SfxRequest& rReq ) { ScDrawView* pView = rViewData.GetScDrawView(); -boolbHasMarked = pView->GetMarkedObjectList().GetMarkCount() != 0; +const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); +boolbHasMarked = rMarkList.GetMarkCount() != 0; std::shared_ptr xRequest = std::make_shared(rReq); @@ -546,7 +547,8 @@ void ScDrawShell::ExecuteAreaDlg( const SfxRequest& rReq ) void ScDrawShell::ExecuteTextAttrDlg( SfxRequest& rReq ) { ScDrawView* pView = rViewData.GetScDrawView(); -bool
core.git: sc/source
sc/source/ui/view/hdrcont.cxx |5 + 1 file changed, 1 insertion(+), 4 deletions(-) New commits: commit 2269b418f7af598ff8194acb9929c8bd6c4baeb1 Author: Heiko Tietze AuthorDate: Wed May 29 14:09:20 2024 +0200 Commit: Heiko Tietze CommitDate: Fri May 31 08:17:18 2024 +0200 Resolves tdf#160324 - Larger hitarea for column header Finalizes patch I6d527d2b0d0de3b48f123b626ebf0b6ce60299a5 Change-Id: Iff5cd4f6252e42cf8fad0aa2f37f70db0b8a15ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168210 Reviewed-by: Heiko Tietze Tested-by: Jenkins diff --git a/sc/source/ui/view/hdrcont.cxx b/sc/source/ui/view/hdrcont.cxx index bf97dbb01f95..ec64067f2507 100644 --- a/sc/source/ui/view/hdrcont.cxx +++ b/sc/source/ui/view/hdrcont.cxx @@ -628,9 +628,6 @@ void ScHeaderControl::Paint( vcl::RenderContext& /*rRenderContext*/, const tools SCCOLROW ScHeaderControl::GetMousePos(const Point& rPos, bool& rBorder) const { -// #define nHitArea 5 -const int nHitArea( officecfg::Office::Common::Misc::ExperimentalMode::get() ? 5 : 2 ); - boolbFound = false; SCCOLROWnPos = GetPos(); SCCOLROWnHitNo = nPos; @@ -654,7 +651,7 @@ SCCOLROW ScHeaderControl::GetMousePos(const Point& rPos, bool& rBorder) const nScrPos += GetEntrySize( nEntryNo - 1 ) * nLayoutSign; //! GetHiddenCount() ?? nDif = nMousePos - nScrPos; -if (nDif >= -nHitArea && nDif <= +nHitArea) +if (nDif >= -5 && nDif <= 5) { bFound = true; nHitNo=nEntryNo-1;
core.git: sc/source
sc/source/ui/view/gridwin.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit a78e908093d5c5e1b1f1401b0863c98b9b523ea9 Author: Rafael Lima AuthorDate: Wed May 29 14:09:40 2024 +0200 Commit: Rafael Lima CommitDate: Fri May 31 03:23:39 2024 +0200 tdf#161309 Update AutoFill overlay after changes Right after the cursor changes, the AutoFill overlay needs to be updated as well. Change-Id: Ie82d36a3ff60635225c794650aaba6e6bfbed5ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168191 Reviewed-by: Rafael Lima Tested-by: Jenkins Reviewed-by: Heiko Tietze diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index b948bf837f41..f1141dc3d8ab 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -6200,6 +6200,7 @@ void ScGridWindow::CursorChanged() // now, just re-create them UpdateCursorOverlay(); +UpdateAutoFillOverlay(); UpdateSparklineGroupOverlay(); }
core.git: sc/source
sc/source/ui/optdlg/calcoptionsdlg.cxx | 10 - sc/source/ui/optdlg/opredlin.cxx| 20 +-- sc/source/ui/optdlg/tpcalc.cxx | 74 ++--- sc/source/ui/optdlg/tpcompatibility.cxx | 12 +- sc/source/ui/optdlg/tpdefaults.cxx | 16 +- sc/source/ui/optdlg/tpformula.cxx | 40 +++ sc/source/ui/optdlg/tpprint.cxx | 18 +-- sc/source/ui/optdlg/tpusrlst.cxx| 30 ++--- sc/source/ui/optdlg/tpview.cxx | 176 9 files changed, 198 insertions(+), 198 deletions(-) New commits: commit 0ba6f0678eb8749decc5e31aa4dff9f4858e3ab1 Author: Noel Grandin AuthorDate: Thu May 30 10:06:57 2024 +0200 Commit: Noel Grandin CommitDate: Thu May 30 17:21:46 2024 +0200 loplugin:ostr in sc/../optdlg Change-Id: Ia441dd7c41cebec5fa40f9eb1e5b8fbb993b453a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168249 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx b/sc/source/ui/optdlg/calcoptionsdlg.cxx index ec65fb9d8014..794c850c229e 100644 --- a/sc/source/ui/optdlg/calcoptionsdlg.cxx +++ b/sc/source/ui/optdlg/calcoptionsdlg.cxx @@ -57,14 +57,14 @@ sal_Int32 toSelectedItem( formula::FormulaGrammar::AddressConvention eConv ) } ScCalcOptionsDialog::ScCalcOptionsDialog(weld::Window* pParent, const ScCalcConfig& rConfig, bool bWriteConfig) -: GenericDialogController(pParent, "modules/scalc/ui/formulacalculationoptions.ui", "FormulaCalculationOptions") +: GenericDialogController(pParent, u"modules/scalc/ui/formulacalculationoptions.ui"_ustr, u"FormulaCalculationOptions"_ustr) , maConfig(rConfig) , mbSelectedEmptyStringAsZero(rConfig.mbEmptyStringAsZero) , mbWriteConfig(bWriteConfig) -, mxEmptyAsZero(m_xBuilder->weld_check_button("checkEmptyAsZero")) -, mxConversion(m_xBuilder->weld_combo_box("comboConversion")) -, mxCurrentDocOnly(m_xBuilder->weld_check_button("current_doc")) -, mxSyntax(m_xBuilder->weld_combo_box("comboSyntaxRef")) +, mxEmptyAsZero(m_xBuilder->weld_check_button(u"checkEmptyAsZero"_ustr)) +, mxConversion(m_xBuilder->weld_combo_box(u"comboConversion"_ustr)) +, mxCurrentDocOnly(m_xBuilder->weld_check_button(u"current_doc"_ustr)) +, mxSyntax(m_xBuilder->weld_combo_box(u"comboSyntaxRef"_ustr)) { mxConversion->set_active(static_cast(rConfig.meStringConversion)); mxConversion->connect_changed(LINK(this, ScCalcOptionsDialog, ConversionModifiedHdl)); diff --git a/sc/source/ui/optdlg/opredlin.cxx b/sc/source/ui/optdlg/opredlin.cxx index 9d3c1835dfc3..a5613649ddc0 100644 --- a/sc/source/ui/optdlg/opredlin.cxx +++ b/sc/source/ui/optdlg/opredlin.cxx @@ -30,19 +30,19 @@ #include ScRedlineOptionsTabPage::ScRedlineOptionsTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet) -: SfxTabPage(pPage, pController, "modules/scalc/ui/optchangespage.ui", "OptChangesPage", ) -, m_xContentColorLB(new ColorListBox(m_xBuilder->weld_menu_button("changes"), +: SfxTabPage(pPage, pController, u"modules/scalc/ui/optchangespage.ui"_ustr, u"OptChangesPage"_ustr, ) +, m_xContentColorLB(new ColorListBox(m_xBuilder->weld_menu_button(u"changes"_ustr), [this]{ return GetDialogController()->getDialog(); })) -, m_xContentColorImg(m_xBuilder->weld_widget("lockchanges")) -, m_xRemoveColorLB(new ColorListBox(m_xBuilder->weld_menu_button("deletions"), +, m_xContentColorImg(m_xBuilder->weld_widget(u"lockchanges"_ustr)) +, m_xRemoveColorLB(new ColorListBox(m_xBuilder->weld_menu_button(u"deletions"_ustr), [this]{ return GetDialogController()->getDialog(); })) -, m_xRemoveColorImg(m_xBuilder->weld_widget("lockdeletions")) -, m_xInsertColorLB(new ColorListBox(m_xBuilder->weld_menu_button("entries"), +, m_xRemoveColorImg(m_xBuilder->weld_widget(u"lockdeletions"_ustr)) +, m_xInsertColorLB(new ColorListBox(m_xBuilder->weld_menu_button(u"entries"_ustr), [this]{ return GetDialogController()->getDialog(); })) -, m_xInsertColorImg(m_xBuilder->weld_widget("lockentries")) -, m_xMoveColorLB(new ColorListBox(m_xBuilder->weld_menu_button("insertions"), +, m_xInsertColorImg(m_xBuilder->weld_widget(u"lockentries"_ustr)) +, m_xMoveColorLB(new ColorListBox(m_xBuilder->weld_menu_button(u"insertions"_ustr), [this]{ return GetDialogController()->getDialog(); })) -, m_xMoveColorImg(m_xBuilder->weld_widget("lockinsertions")) +, m_xMoveColorImg(m_xBuilder->weld_widget(u"lockinsertions"_ustr)) { m_xContentColorLB->SetSlotId(SID_AUTHOR_COLOR); m_xRemoveColorLB->SetSlotId(SID_AUTHOR_COLOR); @@ -66,7 +66,7 @@ std::unique_ptr ScRedlineOptionsTabPage::Create( weld::Container* pP OUString ScRedlineOptionsTabPage::GetAllStrings() { OUString sAllStrings; -OUString labels[] = { "label1", "label2", "label3", "label4", "label5" }; +
core.git: sc/source vcl/inc vcl/source
sc/source/ui/view/output2.cxx |8 vcl/inc/pdf/pdfwriter_impl.hxx|8 vcl/source/gdi/pdfwriter_impl.cxx | 11 --- 3 files changed, 16 insertions(+), 11 deletions(-) New commits: commit cc94f402853bbdce40165a00fe317910d6270562 Author: Caolán McNamara AuthorDate: Wed May 29 16:59:04 2024 +0100 Commit: Caolán McNamara CommitDate: Thu May 30 09:48:46 2024 +0200 'tagged' pdf export of spreadsheets doesn't perform well m_aStructure is appended to for every row and cell, so a spreadsheet with 20 cols and 100,000 rows is many seconds slower to export in 24.8 than 24.4 since: commit b3c93b16d62e80955edc749af4b8ad10162c Date: Wed Jan 3 11:18:19 2024 +0100 tdf#123870 sc: fix tagged content for accessible PDF export Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161581 shave a sliver of work off. Change-Id: Ibeb817083fef3c9499326abe381527a31917303b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168226 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index 1e9bb41a2716..8ddb8722f6ea 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -1486,7 +1486,7 @@ void ScOutputData::LayoutStrings(bool bPixelToLogic) if (!bReopenTag) { sal_Int32 nId = pPDF->EnsureStructureElement(nullptr); -pPDF->InitStructureElement(nId, vcl::PDFWriter::Table, "Table"); +pPDF->InitStructureElement(nId, vcl::PDFWriter::Table, u"Table"_ustr); pPDF->BeginStructureElement(nId); pPDF->GetScPDFState()->m_TableId = nId; } @@ -1565,7 +1565,7 @@ void ScOutputData::LayoutStrings(bool bPixelToLogic) if (!bReopenTag) { sal_Int32 nId = pPDF->EnsureStructureElement(nullptr); -pPDF->InitStructureElement(nId, vcl::PDFWriter::TableRow, "TR"); +pPDF->InitStructureElement(nId, vcl::PDFWriter::TableRow, u"TR"_ustr); pPDF->BeginStructureElement(nId); pPDF->GetScPDFState()->m_TableRowMap.emplace(nY, nId); } @@ -1577,7 +1577,7 @@ void ScOutputData::LayoutStrings(bool bPixelToLogic) for (SCCOL nX=nLoopStartX; nX<=nX2; nX++) { if (bTaggedPDF) -pPDF->WrapBeginStructureElement(vcl::PDFWriter::TableData, "TD"); +pPDF->WrapBeginStructureElement(vcl::PDFWriter::TableData, u"TD"_ustr); bool bMergeEmpty = false; const ScCellInfo* pInfo = >cellInfo(nX); @@ -2123,7 +2123,7 @@ void ScOutputData::LayoutStrings(bool bPixelToLogic) if (!aString.isEmpty()) { if (bTaggedPDF) - pPDF->WrapBeginStructureElement(vcl::PDFWriter::Paragraph, "P"); + pPDF->WrapBeginStructureElement(vcl::PDFWriter::Paragraph, u"P"_ustr); // If the string is clipped, make it shorter for // better performance since drawing by HarfBuzz is diff --git a/vcl/inc/pdf/pdfwriter_impl.hxx b/vcl/inc/pdf/pdfwriter_impl.hxx index b0388ecd27a1..2afab075dbe6 100644 --- a/vcl/inc/pdf/pdfwriter_impl.hxx +++ b/vcl/inc/pdf/pdfwriter_impl.hxx @@ -603,6 +603,14 @@ struct PDFStructureElement { } +PDFStructureElement(sal_Int32 nOwnElement, sal_Int32 nParentElement, sal_Int32 nFirstPageObject) +: m_nObject(0) +, m_nOwnElement(nOwnElement) +, m_nParentElement(nParentElement) +, m_nFirstPageObject(nFirstPageObject) +, m_bOpenMCSeq(false ) +{ +} }; // helper structure for drawLayout and friends diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 17e7c2744a23..ba786d7bb34b 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -10813,13 +10813,10 @@ sal_Int32 PDFWriterImpl::ensureStructureElement() return -1; sal_Int32 nNewId = sal_Int32(m_aStructure.size()); -m_aStructure.emplace_back(); -PDFStructureElement& rEle = m_aStructure.back(); -// leave rEle.m_oType uninitialised -rEle.m_nOwnElement = nNewId; -// temporary parent -rEle.m_nParentElement = m_nCurrentStructElement; -rEle.m_nFirstPageObject = m_aPages[ m_nCurrentPage ].m_nPageObject; + +// use m_nCurrentStructElement as temporary parent +m_aStructure.emplace_back(nNewId, m_nCurrentStructElement, m_aPages[m_nCurrentPage].m_nPageObject); + m_aStructure[ m_nCurrentStructElement ].m_aChildren.push_back( nNewId ); return nNewId; }
core.git: sc/source
sc/source/ui/view/gridwin.cxx | 24 1 file changed, 20 insertions(+), 4 deletions(-) New commits: commit a764f661e0e1b94af128cc2290ee6510adad5ffd Author: Rafael Lima AuthorDate: Fri May 24 14:31:04 2024 +0200 Commit: Rafael Lima CommitDate: Wed May 29 14:03:16 2024 +0200 tdf#161234 New design for the cell outline The change introduced by commit I9df98 made the cell outline a bit wider than the actual cell. However, that change did not play well with higher zoom levels because: 1) The AutoFill handle disconnected from the cell outline 2) The distance between the outline and the cell was too far in at higher zoom levels This patch proposes an alternative design that deals with both issues. Change-Id: Ic3cd7d240f6cfc1af4a39409537e264912ef61b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167945 Tested-by: Jenkins Reviewed-by: Heiko Tietze Reviewed-by: Rafael Lima diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 2762929ccb9b..1b62cfb695e4 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -6589,7 +6589,8 @@ void ScGridWindow::UpdateCursorOverlay() tools::Long nSizeYPix; mrViewData.GetMergeSizePixel( nX, nY, nSizeXPix, nSizeYPix ); -const double nAdjustBorder(mrViewData.GetZoomX() * 3); +// tdf#143733 Make cell outline wider than the cell +const double nAdjustBorder(2 + mrViewData.GetZoomX()); aScrPos.AdjustX(-nAdjustBorder); aScrPos.AdjustY(-nAdjustBorder); @@ -6888,12 +6889,27 @@ void ScGridWindow::UpdateAutoFillOverlay() tools::Long nSizeYPix; mrViewData.GetMergeSizePixel( nX, nY, nSizeXPix, nSizeYPix ); +// tdf#161234 Make AutoFill handle follow cell outline. This happens only when the +// autofill handle is in the same cell as the outline. Note that nAdjustBorder needs +// to be calculated the same way as in ScGridWindow::UpdateCursorOverlay() +double nAdjustBorder(0); +SCCOL nX2 = mrViewData.GetCurX(); +SCCOL nY2 = mrViewData.GetCurY(); +const ScMergeAttr* pMerge = rDoc.GetAttr(nX2, nY2, nTab, ATTR_MERGE); +if (pMerge->GetColMerge() >= 1 || pMerge->GetRowMerge() >= 1) +{ +nX2 += pMerge->GetColMerge() - 1; +nY2 += pMerge->GetRowMerge() - 1; +} +if (nX == nX2 && nY == nY2) +nAdjustBorder = 2 + static_cast(mrViewData.GetZoomX()); + if (bLayoutRTL && !comphelper::LibreOfficeKit::isActive()) -aFillPos.AdjustX( -(nSizeXPix - 2 + (aFillHandleSize.Width() / 2)) ); +aFillPos.AdjustX( -(nSizeXPix + nAdjustBorder + (aFillHandleSize.Width() / 2)) ); else -aFillPos.AdjustX(nSizeXPix - (aFillHandleSize.Width() / 2) ); +aFillPos.AdjustX(nSizeXPix + nAdjustBorder - (aFillHandleSize.Width() / 2) ); -aFillPos.AdjustY(nSizeYPix ); +aFillPos.AdjustY(nSizeYPix + nAdjustBorder); aFillPos.AdjustY( -(aFillHandleSize.Height() / 2) ); tools::Rectangle aFillRect(aFillPos, aFillHandleSize);
core.git: sc/source
sc/source/ui/vba/excelvbahelper.hxx |8 1 file changed, 4 insertions(+), 4 deletions(-) New commits: commit 75776e7fb94affecb60ae5b9816d72ecafa3e340 Author: Xisco Fauli AuthorDate: Mon May 27 11:49:25 2024 +0200 Commit: Xisco Fauli CommitDate: Mon May 27 23:29:09 2024 +0200 sc: use SAL_RET_MAYBENULL in getBestViewShell(), getDocShell()... ... getCurrentBestViewShell() and getViewFrame() See 286a1c03fa10acf60f076a0af987112d24cb2ff5 "sc: check excel::getDocShell" Change-Id: Ibdd3f83d4f0571dccdd009f4b1790043144def0d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168090 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/sc/source/ui/vba/excelvbahelper.hxx b/sc/source/ui/vba/excelvbahelper.hxx index 6f0d71d67789..8216e37963c0 100644 --- a/sc/source/ui/vba/excelvbahelper.hxx +++ b/sc/source/ui/vba/excelvbahelper.hxx @@ -51,10 +51,10 @@ void implnCopy( const css::uno::Reference< css::frame::XModel>& xModel ); void implnPaste ( const css::uno::Reference< css::frame::XModel>& xModel ); void implnCut( const css::uno::Reference< css::frame::XModel>& xModel ); void implnPasteSpecial( const css::uno::Reference< css::frame::XModel>& xModel, InsertDeleteFlags nFlags, ScPasteFunc nFunction, bool bSkipEmpty, bool bTranspose); -ScTabViewShell* getBestViewShell( const css::uno::Reference< css::frame::XModel>& xModel ) ; -ScDocShell* getDocShell( const css::uno::Reference< css::frame::XModel>& xModel ) ; -ScTabViewShell* getCurrentBestViewShell( const css::uno::Reference< css::uno::XComponentContext >& xContext ); -SfxViewFrame* getViewFrame( const css::uno::Reference< css::frame::XModel >& xModel ); +SAL_RET_MAYBENULL ScTabViewShell* getBestViewShell( const css::uno::Reference< css::frame::XModel>& xModel ) ; +SAL_RET_MAYBENULL ScDocShell* getDocShell( const css::uno::Reference< css::frame::XModel>& xModel ) ; +SAL_RET_MAYBENULL ScTabViewShell* getCurrentBestViewShell( const css::uno::Reference< css::uno::XComponentContext >& xContext ); +SAL_RET_MAYBENULL SfxViewFrame* getViewFrame( const css::uno::Reference< css::frame::XModel >& xModel ); /// @throws css::uno::RuntimeException css::uno::Reference< css::sheet::XUnnamedDatabaseRanges > GetUnnamedDataBaseRanges( const ScDocShell* pShell );
core.git: sc/source
sc/source/ui/vba/vbaapplication.cxx | 10 ++- sc/source/ui/vba/vbawindow.cxx | 46 +++- sc/source/ui/vba/vbaworksheet.cxx | 13 -- 3 files changed, 39 insertions(+), 30 deletions(-) New commits: commit fbf3ef5e32d88655eb28b83cad3b1cf84dcc83b0 Author: Xisco Fauli AuthorDate: Mon May 27 13:14:55 2024 +0200 Commit: Xisco Fauli CommitDate: Mon May 27 23:28:40 2024 +0200 sc: warning C6011: Dereferencing NULL pointer Change-Id: I37d541f4c75f053023f67fc3617492bf38a13ea3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168095 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx index 2fceecb58024..299e6adb4527 100644 --- a/sc/source/ui/vba/vbaapplication.cxx +++ b/sc/source/ui/vba/vbaapplication.cxx @@ -664,11 +664,14 @@ ScVbaApplication::GoTo( const uno::Any& Reference, const uno::Any& Scroll ) OUString sRangeName; if( Reference >>= sRangeName ) { +ScTabViewShell* pShell = excel::getCurrentBestViewShell( mxContext ); +if (!pShell) +return; + uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_SET_THROW ); uno::Reference< sheet::XSpreadsheetView > xSpreadsheet( xModel->getCurrentController(), uno::UNO_QUERY_THROW ); -ScTabViewShell* pShell = excel::getCurrentBestViewShell( mxContext ); ScGridWindow* gridWindow = static_cast(pShell->GetWindow()); try { @@ -709,8 +712,11 @@ ScVbaApplication::GoTo( const uno::Any& Reference, const uno::Any& Scroll ) uno::Reference< excel::XRange > xRange; if( Reference >>= xRange ) { -uno::Reference< excel::XRange > xVbaRange( Reference, uno::UNO_QUERY ); ScTabViewShell* pShell = excel::getCurrentBestViewShell( mxContext ); +if (!pShell) +return; + +uno::Reference< excel::XRange > xVbaRange( Reference, uno::UNO_QUERY ); ScGridWindow* gridWindow = static_cast(pShell->GetWindow()); if ( xVbaRange.is() ) { diff --git a/sc/source/ui/vba/vbawindow.cxx b/sc/source/ui/vba/vbawindow.cxx index 4608a2a73f02..2c860eadcf86 100644 --- a/sc/source/ui/vba/vbawindow.cxx +++ b/sc/source/ui/vba/vbawindow.cxx @@ -380,15 +380,17 @@ ScVbaWindow::getWindowState() { sal_Int32 nwindowState = xlNormal; // !! TODO !! get view shell from controller -ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel ); -SfxViewFrame& rViewFrame = pViewShell->GetViewFrame(); -WorkWindow* pWork = static_cast( rViewFrame.GetFrame().GetSystemWindow() ); -if ( pWork ) +if (ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel )) { -if ( pWork -> IsMaximized()) -nwindowState = xlMaximized; -else if (pWork -> IsMinimized()) -nwindowState = xlMinimized; +SfxViewFrame& rViewFrame = pViewShell->GetViewFrame(); +WorkWindow* pWork = static_cast( rViewFrame.GetFrame().GetSystemWindow() ); +if ( pWork ) +{ +if ( pWork -> IsMaximized()) +nwindowState = xlMaximized; +else if (pWork -> IsMinimized()) +nwindowState = xlMinimized; +} } return uno::Any( nwindowState ); } @@ -399,19 +401,21 @@ ScVbaWindow::setWindowState( const uno::Any& _windowstate ) sal_Int32 nwindowState = xlMaximized; _windowstate >>= nwindowState; // !! TODO !! get view shell from controller -ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel ); -SfxViewFrame& rViewFrame = pViewShell->GetViewFrame(); -WorkWindow* pWork = static_cast( rViewFrame.GetFrame().GetSystemWindow() ); -if ( pWork ) -{ -if ( nwindowState == xlMaximized) -pWork -> Maximize(); -else if (nwindowState == xlMinimized) -pWork -> Minimize(); -else if (nwindowState == xlNormal) -pWork -> Restore(); -else -throw uno::RuntimeException(u"Invalid Parameter"_ustr ); +if (ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel )) +{ +SfxViewFrame& rViewFrame = pViewShell->GetViewFrame(); +WorkWindow* pWork = static_cast( rViewFrame.GetFrame().GetSystemWindow() ); +if ( pWork ) +{ +if ( nwindowState == xlMaximized) +pWork -> Maximize(); +else if (nwindowState == xlMinimized) +pWork -> Minimize(); +else if (nwindowState == xlNormal) +pWork -> Restore(); +else +throw uno::RuntimeException(u"Invalid Parameter"_ustr ); +} } } diff --git a/sc/source/ui/vba/vbaworksheet.cxx b/sc/source/ui/vba/vbaworksheet.cxx index b5aa32dce8f7..4501c967e07b 100644 --- a/sc/source/ui/vba/vbaworksheet.cxx +++
core.git: sc/source
sc/source/filter/lotus/lotform.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit f292fd3ac15109ad9ced85f2141922f403460618 Author: Caolán McNamara AuthorDate: Sun May 26 15:10:28 2024 +0100 Commit: Caolán McNamara CommitDate: Sun May 26 20:19:17 2024 +0200 ofz: Use-of-uninitialized-value Change-Id: I8e43bdea51b7ab4943a2243e4d2ddb9d714f1895 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168049 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sc/source/filter/lotus/lotform.cxx b/sc/source/filter/lotus/lotform.cxx index 88ddfcfe251c..b5f9ee055a7a 100644 --- a/sc/source/filter/lotus/lotform.cxx +++ b/sc/source/filter/lotus/lotform.cxx @@ -479,7 +479,7 @@ void LotusToSc::Convert( std::unique_ptr& rpErg, sal_Int32& rRest } case FT_ConstFloat: { -double fDouble; +double fDouble(0.0); Read( fDouble ); aStack << aPool.Store( fDouble ); break; @@ -638,7 +638,7 @@ void LotusToSc::Convert( std::unique_ptr& rpErg, sal_Int32& rRest } case FT_Const10Float: { -double fValue; +double fValue(0.0); if (bWK123) Read(fValue); else
core.git: sc/source
sc/source/filter/excel/xistyle.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit d1e065ea7ac98c31997f1af9be82c5da18c38369 Author: Caolán McNamara AuthorDate: Sat May 25 20:15:41 2024 +0100 Commit: Caolán McNamara CommitDate: Sun May 26 00:51:48 2024 +0200 ofz#69215 Heap-use-after-free maybe since? commit 397d7af2cbb1f2786ba857d350fb4641525e3bb2 Date: Wed May 22 15:03:40 2024 +0200 tdf#161210 speedup loading large XLS ==344604== Invalid read of size 4 ==344604==at 0x1D74DEC5: XclImpXFRange::XclImpXFRange(int, int, XclImpXFIndex const&) (xistyle.hxx:555) ==344604==by 0x1D746AFB: XclImpXFRangeColumn::SetXF(int, XclImpXFIndex const&) (xistyle.cxx:1777) ==344604==by 0x1D747483: XclImpXFRangeBuffer::SetXF(ScAddress const&, unsigned short, XclImpXFRangeBuffer::XclImpXFInsertMode) (xistyle.cxx:1908) ==344604==by 0x1D747629: XclImpXFRangeBuffer::SetXF(ScAddress const&, unsigned short) (xistyle.cxx:1929) ==344604==by 0x1D2C0334: ImportExcel8::Labelsst() (excimp8.cxx:250) ==344604==by 0x1D32AB78: ImportExcel8::Read() (read.cxx:1196) ==344604==by 0x1D29FC2A: ScFormatFilterPluginImpl::ScImportExcel(SfxMedium&, ScDocument*, EXCIMPFORMAT) (excel.cxx:256) ==344604==by 0x1D2A28BC: TestImportXLS (excel.cxx:483) ==344604==by 0x405D76: sal_main_with_args(int, char**) (fftester.cxx:393) ==344604==by 0x40363D: main (fftester.cxx:100) ==344604== Address 0x2ab5fc08 is 8 bytes inside a block of size 12 free'd ==344604==at 0x48463F3: operator delete(void*) (vg_replace_malloc.c:1051) ==344604==by 0x1D761DDC: std::__new_allocator::deallocate(XclImpXFRange*, unsigned long) (new_allocator.h:172) ==344604==by 0x1D761B27: std::__cxx1998::_Vector_base >::_M_deallocate(XclImpXFRange*, unsigned long) (allocator.h:210) ==344604==by 0x1D76170E: void std::__cxx1998::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, XclImpXFRange&&) (vector.tcc:519) ==344604==by 0x1D763576: std::__cxx1998::vector >::_M_insert_rval(__gnu_cxx::__normal_iterator > >, XclImpXFRange&&) (vector.tcc:372) ==344604==by 0x1D763409: std::__cxx1998::vector >::_M_emplace_aux(__gnu_cxx::__normal_iterator > >, XclImpXFRange&&) (stl_vector.h:1887) ==344604==by 0x1D762F29: __gnu_cxx::__normal_iterator > > std::__cxx1998::vector >::emplace(__gnu_cxx::__normal_iterator > >, XclImpXFRange&&) (stl_vector.h:1344) ==344604==by 0x1D762CCB: __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator > >, std::__debug::vector >, std::random_access_iterator_tag> std::__debug::vector >::emplace(__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator > >, std::__debug::vector >, std::random_access_iterator_tag>, XclImpXFRange&&) (vector:545) ==344604==by 0x1D74E0FD: __gnu_cxx::__enable_if::__value, __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator > >, std::__debug::vector >, std::random_access_iterator_tag> >::__type std::__debug::vector >::insert(__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator > >, std::__debug::vector >, std::random_access_iterator_tag>, XclImpXFRange&&) (vector:580) ==344604==by 0x1D74712E: XclImpXFRangeColumn::Insert(XclImpXFRange, unsigned long) (xistyle.cxx:1798) ==344604==by 0x1D746AD8: XclImpXFRangeColumn::SetXF(int, XclImpXFIndex const&) (xistyle.cxx:1776) ==344604==by 0x1D747483: XclImpXFRangeBuffer::SetXF(ScAddress const&, unsigned short, XclImpXFRangeBuffer::XclImpXFInsertMode) (xistyle.cxx:1908) ==344604== Block was alloc'd at ==344604==at 0x4842F95: operator new(unsigned long) (vg_replace_malloc.c:483) ==344604==by 0x1D761C4A: std::__new_allocator::allocate(unsigned long, void const*) (new_allocator.h:151) ==344604==by 0x1D761A33: std::__cxx1998::_Vector_base >::_M_allocate(unsigned long) (allocator.h:198) ==344604==by 0x1D7615F1: void std::__cxx1998::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, XclImpXFRange&&) (vector.tcc:459) ==344604==by 0x1D76148D: XclImpXFRange& std::__cxx1998::vector >::emplace_back(XclImpXFRange&&) (vector.tcc:123) ==344604==by 0x1D761371: XclImpXFRange& std::__debug::vector >::emplace_back(XclImpXFRange&&) (vector:519) ==344604==by 0x1D74DE8C: __gnu_cxx::__enable_if::__value, void>::__type std::__debug::vector >::push_back(XclImpXFRange&&) (vector:508) ==344604==by 0x1D7467AD: XclImpXFRangeColumn::SetDefaultXF(XclImpXFIndex const&, XclImpRoot const&) (xistyle.cxx:1727) ==344604==by 0x1D7478A7: XclImpXFRangeBuffer::SetColumnDefXF(short, unsigned short) (xistyle.cxx:1956) ==344604==by 0x1D2713A5: XclImpColRowSettings::SetDefaultXF(short, short, unsigned short) (colrowst.cxx:175) ==344604==by 0x1D30E12F: ImportExcel::Colinfo() (impop.cxx:682) ==344604==by 0x1D32A34E:
core.git: sc/source
sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx |4 1 file changed, 4 insertions(+) New commits: commit 4d2c41e8171139e210d94b0c3c2b6b3d6392665a Author: Michael Weghorn AuthorDate: Thu May 23 12:57:46 2024 +0200 Commit: Michael Weghorn CommitDate: Sat May 25 09:02:38 2024 +0200 related tdf#158914 sc a11y: Release references when disposing sheet Clear all `ScAccessibleCell` references that are owned by `ScAccessibleSpreadsheet` when disposing the sheet instead of when the sheet is deleted. While `ScAccessibleSpreadsheet::disposing` is always called, `ScAccessibleSpreadsheet::~ScAccessibleSpreadsheet` is not called until all of the sheet's `ScAccessibleCell` instances have been deleted. So make sure that `ScAccessibleSpreadsheet::disposing` releases all `ScAccessibleCell` references. This might possibly reduce some of the leaks mentioned in [1]. [1] https://gerrit.libreoffice.org/c/core/+/167961/comments/15a6a4e4_91a77291 Change-Id: Iaf14338945c1899d54c8e7f8a16f38a48316ac98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167985 Tested-by: Jenkins Reviewed-by: Michael Weghorn diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx index fdeea8d7579a..7296863d0cee 100644 --- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx +++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx @@ -310,7 +310,11 @@ void SAL_CALL ScAccessibleSpreadsheet::disposing() mpViewShell->RemoveAccessibilityObject(*this); mpViewShell = nullptr; } + mpAccCell.clear(); +m_mapSelectionSend.clear(); +m_mapFormulaSelectionSend.clear(); +m_pAccFormulaCell.clear(); ScAccessibleTableBase::disposing(); }
core.git: sc/source
sc/source/filter/excel/xlroot.cxx |5 - sc/source/filter/inc/xlroot.hxx |2 +- 2 files changed, 1 insertion(+), 6 deletions(-) New commits: commit 137f423cc18e23f64b3b2bc6075c5f1581ac6537 Author: Noel Grandin AuthorDate: Wed May 22 16:40:31 2024 +0200 Commit: Noel Grandin CommitDate: Fri May 24 20:11:12 2024 +0200 tdf#161210 speedup loading large XLS (2) shave 2% off time by inlining GetDoc which is quite hot Change-Id: I20ede177e6032761598b1b977e90ff969bd2162a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168012 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx index 836c08b3f5e4..593a4d1583da 100644 --- a/sc/source/filter/excel/xlroot.cxx +++ b/sc/source/filter/excel/xlroot.cxx @@ -286,11 +286,6 @@ rtl::Reference XclRoot::OpenStream(const OUString& rStrmName) return OpenStream( GetRootStorage(), rStrmName ); } -ScDocument& XclRoot::GetDoc() const -{ -return mrData.mrDoc; -} - ScDocShell* XclRoot::GetDocShell() const { return GetDoc().GetDocumentShell(); diff --git a/sc/source/filter/inc/xlroot.hxx b/sc/source/filter/inc/xlroot.hxx index aa86378416b4..603307fb3476 100644 --- a/sc/source/filter/inc/xlroot.hxx +++ b/sc/source/filter/inc/xlroot.hxx @@ -198,7 +198,7 @@ public: rtl::Reference OpenStream(const OUString& rStrmName) const; /** Returns reference to the destination document (import) or source document (export). */ -ScDocument& GetDoc() const; +ScDocument& GetDoc() const { return mrData.mrDoc; } /** Returns the object shell of the Calc document. May be 0 (i.e. import from clipboard). */ ScDocShell* GetDocShell() const;
core.git: sc/source
sc/source/filter/excel/xistyle.cxx | 33 - sc/source/filter/inc/xistyle.hxx |4 ++-- 2 files changed, 18 insertions(+), 19 deletions(-) New commits: commit 397d7af2cbb1f2786ba857d350fb4641525e3bb2 Author: Noel Grandin AuthorDate: Wed May 22 15:03:40 2024 +0200 Commit: Noel Grandin CommitDate: Fri May 24 18:29:02 2024 +0200 tdf#161210 speedup loading large XLS takes the time from 22s to 20s for me Change-Id: Ib401c03ba13f82047c8376741e3547aadf5b18df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168011 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx index 23db22d23ed8..00bc34c744bd 100644 --- a/sc/source/filter/excel/xistyle.cxx +++ b/sc/source/filter/excel/xistyle.cxx @@ -1724,7 +1724,7 @@ void XclImpXFRangeColumn::SetDefaultXF( const XclImpXFIndex& rXFIndex, const Xcl OSL_ENSURE( maIndexList.empty(), "XclImpXFRangeColumn::SetDefaultXF - Setting Default Column XF is not empty" ); // insert a complete row range with one insert. -maIndexList.push_back( std::make_unique( 0, rRoot.GetDoc().MaxRow(), rXFIndex ) ); +maIndexList.push_back( XclImpXFRange( 0, rRoot.GetDoc().MaxRow(), rXFIndex ) ); } void XclImpXFRangeColumn::SetXF( SCROW nScRow, const XclImpXFIndex& rXFIndex ) @@ -1748,7 +1748,7 @@ void XclImpXFRangeColumn::SetXF( SCROW nScRow, const XclImpXFIndex& rXFIndex ) SCROW nLastScRow = pPrevRange->mnScRow2; sal_uLong nIndex = nNextIndex - 1; XclImpXFRange* pThisRange = pPrevRange; -pPrevRange = (nIndex > 0 && nIndex <= maIndexList.size()) ? maIndexList[ nIndex - 1 ].get() : nullptr; +pPrevRange = (nIndex > 0 && nIndex <= maIndexList.size()) ? [ nIndex - 1 ] : nullptr; if( nFirstScRow == nLastScRow ) // replace solely XF { @@ -1761,20 +1761,20 @@ void XclImpXFRangeColumn::SetXF( SCROW nScRow, const XclImpXFIndex& rXFIndex ) ++(pThisRange->mnScRow1); // try to concatenate with previous of this if( !pPrevRange || !pPrevRange->Expand( nScRow, rXFIndex ) ) -Insert( new XclImpXFRange( nScRow, rXFIndex ), nIndex ); +Insert( XclImpXFRange( nScRow, rXFIndex ), nIndex ); } else if( nLastScRow == nScRow ) // replace last XF { --(pThisRange->mnScRow2); if( !pNextRange || !pNextRange->Expand( nScRow, rXFIndex ) ) -Insert( new XclImpXFRange( nScRow, rXFIndex ), nNextIndex ); +Insert( XclImpXFRange( nScRow, rXFIndex ), nNextIndex ); } else// insert in the middle of the range { pThisRange->mnScRow1 = nScRow + 1; // List::Insert() moves entries towards end of list, so insert twice at nIndex -Insert( new XclImpXFRange( nScRow, rXFIndex ), nIndex ); -Insert( new XclImpXFRange( nFirstScRow, nScRow - 1, pThisRange->maXFIndex ), nIndex ); +Insert( XclImpXFRange( nScRow, rXFIndex ), nIndex ); +Insert( XclImpXFRange( nFirstScRow, nScRow - 1, pThisRange->maXFIndex ), nIndex ); } return; } @@ -1790,12 +1790,12 @@ void XclImpXFRangeColumn::SetXF( SCROW nScRow, const XclImpXFIndex& rXFIndex ) return; // create new range -Insert( new XclImpXFRange( nScRow, rXFIndex ), nNextIndex ); +Insert( XclImpXFRange( nScRow, rXFIndex ), nNextIndex ); } -void XclImpXFRangeColumn::Insert(XclImpXFRange* pXFRange, sal_uLong nIndex) +void XclImpXFRangeColumn::Insert(XclImpXFRange aXFRange, sal_uLong nIndex) { -maIndexList.insert( maIndexList.begin() + nIndex, std::unique_ptr(pXFRange) ); +maIndexList.insert( maIndexList.begin() + nIndex, std::move(aXFRange) ); } void XclImpXFRangeColumn::Find( @@ -1811,8 +1811,8 @@ void XclImpXFRangeColumn::Find( return; } -rpPrevRange = maIndexList.front().get(); -rpNextRange = maIndexList.back().get(); +rpPrevRange = (); +rpNextRange = (); // test whether row is at end of list (contained in or behind last range) // rpPrevRange will contain a possible existing row @@ -1843,7 +1843,7 @@ void XclImpXFRangeColumn::Find( while( ((rnNextIndex - nPrevIndex) > 1) && (rpPrevRange->mnScRow2 < nScRow) ) { nMidIndex = (nPrevIndex + rnNextIndex) / 2; -pMidRange = maIndexList[nMidIndex].get(); +pMidRange = [nMidIndex]; assert(pMidRange && "XclImpXFRangeColumn::Find - missing XF index range"); if( nScRow < pMidRange->mnScRow1 ) // row is really before pMidRange { @@ -1861,7 +1861,7 @@ void XclImpXFRangeColumn::Find( if( nScRow <= rpPrevRange->mnScRow2
core.git: sc/source
sc/source/core/data/column2.cxx | 51 1 file changed, 31 insertions(+), 20 deletions(-) New commits: commit 98dd23286a09e10830c1103039dca5609e8c73a9 Author: Mike Kaganski AuthorDate: Fri May 24 14:46:05 2024 +0500 Commit: Mike Kaganski CommitDate: Fri May 24 15:58:37 2024 +0200 Avoid more cases of unneeded GetTextWidth Change-Id: I45ccf6e3c84f22d46b42c36179cb380ca803d08b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168014 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index e62ac56a1e14..2b0a88aef220 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -307,26 +307,33 @@ tools::Long ScColumn::GetNeededSize( { // SetFont is moved up -Size aSize; +tools::Long nWidth = 0; if ( eOrient != SvxCellOrientation::Standard ) { -aSize = Size( pDev->GetTextWidth( aValStr ), pDev->GetTextHeight() ); -tools::Long nTemp = aSize.Width(); -aSize.setWidth( aSize.Height() ); -aSize.setHeight( nTemp ); +nWidth = pDev->GetTextHeight(); } else if ( nRotate ) { //TODO: take different X/Y scaling into consideration -aSize = Size( pDev->GetTextWidth( aValStr ), pDev->GetTextHeight() ); +// avoid calling the expensive GetTextWidth when not needed +auto TextWidth = [&, w = std::optional()]() mutable +{ +if (!w) +w = pDev->GetTextWidth(aValStr); +return *w; +}; +auto TextHeight = [&, h = std::optional()]() mutable +{ +if (!h) +h = pDev->GetTextHeight(); +return *h; +}; double nRealOrient = toRadians(nRotate); double nCosAbs = fabs( cos( nRealOrient ) ); double nSinAbs = fabs( sin( nRealOrient ) ); -tools::Long nHeight = static_cast( aSize.Height() * nCosAbs + aSize.Width() * nSinAbs ); -tools::Long nWidth; if ( eRotMode == SVX_ROTATE_MODE_STANDARD ) -nWidth = static_cast( aSize.Width() * nCosAbs + aSize.Height() * nSinAbs ); +nWidth = static_cast( TextWidth() * nCosAbs + TextHeight() * nSinAbs ); else if ( rOptions.bTotalSize ) { nWidth = conditionalScaleFunc(rDocument.GetColWidth( nCol,nTab ), nPPT); @@ -338,21 +345,25 @@ tools::Long ScColumn::GetNeededSize( (bInPrintTwips ? 1.0 : nPPT) * nCosAbs / nSinAbs ); } else -nWidth = static_cast( aSize.Height() / nSinAbs ); //TODO: limit? +nWidth = static_cast( TextHeight() / nSinAbs ); //TODO: limit? -if ( bBreak && !rOptions.bTotalSize ) +if (bWidth) +nValue = nWidth; +else { -// limit size for line break -tools::Long nCmp = pDev->GetFont().GetFontSize().Height() * SC_ROT_BREAK_FACTOR; -if ( nHeight > nCmp ) -nHeight = nCmp; +tools::Long nHeight = static_cast( TextHeight() * nCosAbs + TextWidth() * nSinAbs ); +if ( bBreak && !rOptions.bTotalSize ) +{ +// limit size for line break +tools::Long nCmp = pDev->GetFont().GetFontSize().Height() * SC_ROT_BREAK_FACTOR; +if ( nHeight > nCmp ) +nHeight = nCmp; +} +nValue = nHeight; } - -aSize = Size( nWidth, nHeight ); -nValue = bWidth ? aSize.Width() : aSize.Height(); } else if (bBreak && !bWidth) -aSize = Size( pDev->GetTextWidth( aValStr ), pDev->GetTextHeight() ); +nWidth = pDev->GetTextWidth(aValStr); else // in the common case (height), avoid calling the expensive GetTextWidth nValue = bWidth ? pDev->GetTextWidth( aValStr ) : pDev->GetTextHeight(); @@ -382,7 +393,7 @@ tools::Long ScColumn::GetNeededSize( pMargin->GetLeftMargin() - pMargin->GetRightMargin() - nIndent), nPPTX); nDocSize = (nDocSize * 9) / 10; // for safety -if ( aSize.Width() > nDocSize ) +if (nWidth > nDocSize)
core.git: sc/source
sc/source/core/data/patattr.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 7cd07676dfb6a27957d60fb968fd2d3b8abc873c Author: Henry Castro AuthorDate: Tue May 21 17:32:54 2024 -0400 Commit: Caolán McNamara CommitDate: Fri May 24 12:31:29 2024 +0200 lok: sc: fix print mode document back color Signed-off-by: Henry Castro Change-Id: I334ff51230ef01d7a87790409a6d76541c57ba54 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167911 Reviewed-by: Caolán McNamara Tested-by: Jenkins CollaboraOffice (cherry picked from commit 11eaf501798cec2c5758cd7fd447998e202ae1f9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167944 Tested-by: Jenkins diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx index 4e0ab28a07c3..162e46d5de4a 100644 --- a/sc/source/core/data/patattr.cxx +++ b/sc/source/core/data/patattr.cxx @@ -829,7 +829,8 @@ void ScPatternAttr::fillColor(model::ComplexColor& rComplexColor, const SfxItemS if (pViewShell) { const ScViewRenderingOptions& rViewRenderingOptions = pViewShell->GetViewRenderingData(); -aBackColor = rViewRenderingOptions.GetDocColor(); +aBackColor = eAutoMode == ScAutoFontColorMode::Print ? COL_WHITE : +rViewRenderingOptions.GetDocColor(); } } }
core.git: sc/source
sc/source/ui/inc/docsh.hxx |8 1 file changed, 4 insertions(+), 4 deletions(-) New commits: commit b46b0e92e54d871af8c2f2471c991c5d243a089d Author: Xisco Fauli AuthorDate: Thu May 23 15:44:39 2024 +0200 Commit: Xisco Fauli CommitDate: Thu May 23 20:28:22 2024 +0200 use SAL_RET_MAYBENULL in GetViewBindings(), GetBestViewShell()... ... GetViewData() and GetShellByNum() Change-Id: I9a53e2d4cf1241195985cf095d274f596abd6427 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167993 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx index 4cc4ceacfb11..0b82b85ea3e9 100644 --- a/sc/source/ui/inc/docsh.hxx +++ b/sc/source/ui/inc/docsh.hxx @@ -378,9 +378,9 @@ public: const OUString& GetDdeTextFmt() const { return m_aDdeTextFmt; } -SfxBindings*GetViewBindings(); +SAL_RET_MAYBENULL SfxBindings* GetViewBindings(); -SC_DLLPUBLIC ScTabViewShell* GetBestViewShell( bool bOnlyVisible = true ); +SAL_RET_MAYBENULL SC_DLLPUBLIC ScTabViewShell* GetBestViewShell( bool bOnlyVisible = true ); voidSetDocumentModifiedPending( bool bVal ) { m_bDocumentModifiedPending = bVal; } @@ -397,10 +397,10 @@ public: OutputDevice* GetRefDevice(); // WYSIWYG: Printer, otherwise VirtualDevice... -SC_DLLPUBLIC static ScViewData* GetViewData(); +SAL_RET_MAYBENULL SC_DLLPUBLIC static ScViewData* GetViewData(); SC_DLLPUBLIC static SCTAB GetCurTab(); -static ScDocShell* GetShellByNum( sal_uInt16 nDocNo ); +SAL_RET_MAYBENULL static ScDocShell* GetShellByNum( sal_uInt16 nDocNo ); static OUString GetOwnFilterName(); static OUString GetHtmlFilterName(); static OUString GetWebQueryFilterName();
core.git: sc/source
sc/source/ui/docshell/dbdocfun.cxx |2 +- sc/source/ui/docshell/docfunc.cxx |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) New commits: commit 64b14cc6ab688abbea2f87bc25ba42159b5dc904 Author: Xisco Fauli AuthorDate: Thu May 23 15:41:43 2024 +0200 Commit: Xisco Fauli CommitDate: Thu May 23 20:27:24 2024 +0200 sc: warning C6011: Dereferencing NULL pointer Change-Id: Ib6535d167ec741ea0641208d01f01bee334c0e79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167992 Reviewed-by: Xisco Fauli Tested-by: Jenkins diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index ee59f36232ae..204854b09764 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -630,7 +630,7 @@ bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam, while (pViewShell) { ScTabViewShell* pTabViewShell = dynamic_cast(pViewShell); -if (pTabViewShell && pTabViewShell->GetDocId() == pSomeViewForThisDoc->GetDocId()) +if (pTabViewShell && pSomeViewForThisDoc && pTabViewShell->GetDocId() == pSomeViewForThisDoc->GetDocId()) { if (ScPositionHelper* pPosHelper = pTabViewShell->GetViewData().GetLOKHeightHelper(nTab)) pPosHelper->invalidateByIndex(nStartRow); diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index d47f6f0bde40..6e3e050b8366 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -180,7 +180,7 @@ bool ScDocFunc::AdjustRowHeight( const ScRange& rRange, bool bPaint, bool bApi ) while (pViewShell) { ScTabViewShell* pTabViewShell = dynamic_cast(pViewShell); -if (pTabViewShell && pTabViewShell->GetDocId() == pSomeViewForThisDoc->GetDocId()) +if (pTabViewShell && pSomeViewForThisDoc && pTabViewShell->GetDocId() == pSomeViewForThisDoc->GetDocId()) { if (ScPositionHelper* pPosHelper = pTabViewShell->GetViewData().GetLOKHeightHelper(nTab)) pPosHelper->invalidateByIndex(nStartRow);
core.git: sc/source
sc/source/core/data/column2.cxx | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) New commits: commit f91a411340ae204ce1e6997f22e0352a4c6a8355 Author: Noel Grandin AuthorDate: Thu May 23 15:09:52 2024 +0200 Commit: Noel Grandin CommitDate: Thu May 23 19:46:32 2024 +0200 reduce cost of calc column height calculation avoid calling GetTextWidth unless we really need to Change-Id: Ibb0f378e632fa3fce68b4819028630759baf4eb5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167988 Tested-by: Jenkins Reviewed-by: Michael Meeks diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index c4ac17ffe358..e62ac56a1e14 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -307,9 +307,10 @@ tools::Long ScColumn::GetNeededSize( { // SetFont is moved up -Size aSize( pDev->GetTextWidth( aValStr ), pDev->GetTextHeight() ); +Size aSize; if ( eOrient != SvxCellOrientation::Standard ) { +aSize = Size( pDev->GetTextWidth( aValStr ), pDev->GetTextHeight() ); tools::Long nTemp = aSize.Width(); aSize.setWidth( aSize.Height() ); aSize.setHeight( nTemp ); @@ -318,6 +319,7 @@ tools::Long ScColumn::GetNeededSize( { //TODO: take different X/Y scaling into consideration +aSize = Size( pDev->GetTextWidth( aValStr ), pDev->GetTextHeight() ); double nRealOrient = toRadians(nRotate); double nCosAbs = fabs( cos( nRealOrient ) ); double nSinAbs = fabs( sin( nRealOrient ) ); @@ -347,8 +349,13 @@ tools::Long ScColumn::GetNeededSize( } aSize = Size( nWidth, nHeight ); +nValue = bWidth ? aSize.Width() : aSize.Height(); } -nValue = bWidth ? aSize.Width() : aSize.Height(); +else if (bBreak && !bWidth) +aSize = Size( pDev->GetTextWidth( aValStr ), pDev->GetTextHeight() ); +else +// in the common case (height), avoid calling the expensive GetTextWidth +nValue = bWidth ? pDev->GetTextWidth( aValStr ) : pDev->GetTextHeight(); if ( bAddMargin ) {
core.git: sc/source
sc/source/ui/app/inputwin.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 4ee802917bd37665df3fe4116eb31b2a9f6be494 Author: Xisco Fauli AuthorDate: Wed May 22 12:40:25 2024 +0200 Commit: Xisco Fauli CommitDate: Wed May 22 15:40:50 2024 +0200 Partially revert 860d11230d6 "sc: check GetActiveViewShell()" See https://gerrit.libreoffice.org/c/core/+/167923/comment/3b02cf2c_feea2a9f/ Change-Id: I54f9609c934c5d56528fc4175462ff1d4deffaae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167951 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index f39139b7b6e7..e447045e4b51 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -1722,6 +1722,7 @@ bool ScTextWnd::Command( const CommandEvent& rCEvt ) if (m_xEditView) { ScModule* pScMod = SC_MOD(); +ScTabViewShell* pStartViewSh = ScTabViewShell::GetActiveViewShell(); // don't modify the font defaults here - the right defaults are // already set in StartEditEngine when the EditEngine is created @@ -1739,7 +1740,6 @@ bool ScTextWnd::Command( const CommandEvent& rCEvt ) { // Is dragged onto another View? ScTabViewShell* pEndViewSh = ScTabViewShell::GetActiveViewShell(); -ScTabViewShell* pStartViewSh = ScTabViewShell::GetActiveViewShell(); if ( pEndViewSh != pStartViewSh && pStartViewSh != nullptr ) { ScViewData& rViewData = pStartViewSh->GetViewData();
core.git: sc/source
sc/source/ui/Accessibility/AccessibleCell.cxx|4 +-- sc/source/ui/Accessibility/AccessibleCellBase.cxx| 12 - sc/source/ui/Accessibility/AccessibleContextBase.cxx |6 ++-- sc/source/ui/Accessibility/AccessibleCsvControl.cxx | 14 +-- sc/source/ui/Accessibility/AccessibleDocument.cxx|6 ++-- sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx |4 +-- sc/source/ui/Accessibility/AccessibleEditObject.cxx |2 - sc/source/ui/Accessibility/AccessiblePageHeader.cxx |4 +-- sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx |4 +-- sc/source/ui/Accessibility/AccessiblePreviewCell.cxx |4 +-- sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx |4 +-- sc/source/ui/Accessibility/AccessiblePreviewTable.cxx|2 - sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx |4 +-- sc/source/ui/Accessibility/AccessibleTableBase.cxx |2 - 14 files changed, 36 insertions(+), 36 deletions(-) New commits: commit c2a2eb189c45b4eaf53bd2b5656185fa72512322 Author: Noel Grandin AuthorDate: Wed May 22 09:34:38 2024 +0200 Commit: Noel Grandin CommitDate: Wed May 22 12:42:07 2024 +0200 loplugin:ostr in sc/../Accessibility Change-Id: Ibf9981ee800054c10b663d9fc91602d326175a68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167919 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx b/sc/source/ui/Accessibility/AccessibleCell.cxx index b27fbb90671a..3d1fb315965c 100644 --- a/sc/source/ui/Accessibility/AccessibleCell.cxx +++ b/sc/source/ui/Accessibility/AccessibleCell.cxx @@ -300,13 +300,13 @@ uno::Reference SAL_CALL OUString SAL_CALL ScAccessibleCell::getImplementationName() { -return "ScAccessibleCell"; +return u"ScAccessibleCell"_ustr; } uno::Sequence< OUString> SAL_CALL ScAccessibleCell::getSupportedServiceNames() { -const css::uno::Sequence vals { "com.sun.star.sheet.AccessibleCell" }; +const css::uno::Sequence vals { u"com.sun.star.sheet.AccessibleCell"_ustr }; return comphelper::concatSequences(ScAccessibleContextBase::getSupportedServiceNames(), vals); } diff --git a/sc/source/ui/Accessibility/AccessibleCellBase.cxx b/sc/source/ui/Accessibility/AccessibleCellBase.cxx index d8b84fabafc1..ebff91c101e2 100644 --- a/sc/source/ui/Accessibility/AccessibleCellBase.cxx +++ b/sc/source/ui/Accessibility/AccessibleCellBase.cxx @@ -269,7 +269,7 @@ uno::Any SAL_CALL OUString SAL_CALL ScAccessibleCellBase::getImplementationName() { -return "ScAccessibleCellBase"; +return u"ScAccessibleCellBase"_ustr; } //= XTypeProvider === @@ -374,9 +374,9 @@ OUString ScAccessibleCellBase::getShadowAttrs() const } } //construct shadow attributes string -OUString sShadowAttrs("Shadow:"); -OUString sInnerSplit(","); -OUString sOuterSplit(";"); +OUString sShadowAttrs(u"Shadow:"_ustr); +OUString sInnerSplit(u","_ustr); +OUString sOuterSplit(u";"_ustr); sal_Int32 nLocationVal = 0; switch( aShadowFmt.Location ) { @@ -479,8 +479,8 @@ OUString ScAccessibleCellBase::getBorderAttrs() //construct border attributes string OUString sBorderAttrs; -OUString sInnerSplit(","); -OUString sOuterSplit(";"); +OUString sInnerSplit(u","_ustr); +OUString sOuterSplit(u";"_ustr); //top border //if top of the cell has no border if ( aTopBorder.InnerLineWidth == 0 && aTopBorder.OuterLineWidth == 0 ) diff --git a/sc/source/ui/Accessibility/AccessibleContextBase.cxx b/sc/source/ui/Accessibility/AccessibleContextBase.cxx index 59f2f399032e..34826eb80e9d 100644 --- a/sc/source/ui/Accessibility/AccessibleContextBase.cxx +++ b/sc/source/ui/Accessibility/AccessibleContextBase.cxx @@ -416,7 +416,7 @@ void SAL_CALL // XServiceInfo OUString SAL_CALL ScAccessibleContextBase::getImplementationName() { -return "ScAccessibleContextBase"; +return u"ScAccessibleContextBase"_ustr; } sal_Bool SAL_CALL ScAccessibleContextBase::supportsService(const OUString& sServiceName) @@ -427,8 +427,8 @@ sal_Bool SAL_CALL ScAccessibleContextBase::supportsService(const OUString& sServ uno::Sequence< OUString> SAL_CALL ScAccessibleContextBase::getSupportedServiceNames() { -return {"com.sun.star.accessibility.Accessible", -"com.sun.star.accessibility.AccessibleContext"}; +return {u"com.sun.star.accessibility.Accessible"_ustr, +u"com.sun.star.accessibility.AccessibleContext"_ustr}; } //= internal diff --git a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx index c6dc50dc011a..166e1482b057 100644 ---
core.git: sc/source
sc/source/core/data/table1.cxx | 27 ++- 1 file changed, 26 insertions(+), 1 deletion(-) New commits: commit 66f968242ecb17ea82d72ca6198aeec4aa865f05 Author: Pranam Lashkari AuthorDate: Tue May 21 05:56:18 2024 +0300 Commit: Pranam Lashkari CommitDate: Tue May 21 22:43:38 2024 +0200 sc: LOK: invalidate sheet geometry on row height changes sometimes if undo/redeo affected row heights (i.e: undo an autofill) sheet geometry was not updated in LOK Change-Id: I995d23752712f6baf3c348f6fe5fb292f7c9043b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167878 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara (cherry picked from commit bb605f31f92eeeca292824931ef0e8d1db750702) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167828 Reviewed-by: Pranam Lashkari Tested-by: Jenkins diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index c7539a154204..f90c4a73e011 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -52,6 +52,7 @@ #include #include #include +#include #include #include @@ -489,6 +490,18 @@ bool ScTable::SetOptimalHeight( mpRowHeights->enableTreeSearch(true); +if (bChanged) +{ +if (ScViewData* pViewData = ScDocShell::GetViewData()) +{ +ScTabViewShell::notifyAllViewsSheetGeomInvalidation( +pViewData->GetViewShell(), +false /* bColsAffected */, true /* bRowsAffected */, +true /* bSizes*/, false /* bHidden */, false /* bFiltered */, +false /* bGroups */, nTab); +} +} + return bChanged; } @@ -510,10 +523,22 @@ void ScTable::SetOptimalHeightOnly( SetRowHeightOnlyFunc aFunc(this); -SetOptimalHeightsToRows(rCxt, aFunc, pRowFlags.get(), nStartRow, nEndRow, true); +bool bChanged = SetOptimalHeightsToRows(rCxt, aFunc, pRowFlags.get(), nStartRow, nEndRow, true); if ( pProgress != pOuterProgress ) delete pProgress; + +if (bChanged) +{ +if (ScViewData* pViewData = ScDocShell::GetViewData()) +{ +ScTabViewShell::notifyAllViewsSheetGeomInvalidation( +pViewData->GetViewShell(), +false /* bColsAffected */, true /* bRowsAffected */, +true /* bSizes*/, false /* bHidden */, false /* bFiltered */, +false /* bGroups */, nTab); +} +} } bool ScTable::GetCellArea( SCCOL& rEndCol, SCROW& rEndRow ) const
core.git: sc/source
sc/source/ui/inc/tabvwsh.hxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 1ff9bc004e5df7d0dfbd7e58c0cbaadf225fb68d Author: Xisco Fauli AuthorDate: Tue May 21 14:23:16 2024 +0200 Commit: Xisco Fauli CommitDate: Tue May 21 21:36:07 2024 +0200 use SAL_RET_MAYBENULL in GetActiveViewShell() Change-Id: I739a9be7486978b19f34939c7d6d7bb2d1adbf77 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167899 Reviewed-by: Xisco Fauli Tested-by: Jenkins diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx index e05e5370d84f..a3c0d728f90f 100644 --- a/sc/source/ui/inc/tabvwsh.hxx +++ b/sc/source/ui/inc/tabvwsh.hxx @@ -367,7 +367,7 @@ public: voidDeactivateOle(); -SC_DLLPUBLIC static ScTabViewShell* GetActiveViewShell(); +SAL_RET_MAYBENULL SC_DLLPUBLIC static ScTabViewShell* GetActiveViewShell(); std::shared_ptr CreateRefDialogController(SfxBindings* pB, SfxChildWindow* pCW, SfxChildWinInfo* pInfo,
core.git: sc/source
sc/source/ui/app/inputwin.cxx | 21 ++-- sc/source/ui/condformat/condformatdlgentry.cxx | 68 ++--- sc/source/ui/dialogs/searchresults.cxx | 20 ++- sc/source/ui/miscdlgs/mvtabdlg.cxx | 16 +-- sc/source/ui/namedlg/namedefdlg.cxx|8 - sc/source/ui/namedlg/namedlg.cxx |4 sc/source/ui/undo/undoblk.cxx | 55 +- sc/source/ui/undo/undodat.cxx | 129 - sc/source/ui/undo/undotab.cxx | 33 +- sc/source/ui/view/tabvwsh4.cxx |2 10 files changed, 219 insertions(+), 137 deletions(-) New commits: commit 860d11230d67900238f97a06fd2ebd0262c16ae4 Author: Xisco Fauli AuthorDate: Tue May 21 17:22:53 2024 +0200 Commit: Xisco Fauli CommitDate: Tue May 21 21:35:50 2024 +0200 sc: check GetActiveViewShell() See the recently introduced https://crashreport.libreoffice.org/stats/crash_details/3da2dcd1-ca3e-409a-a665-dcb09d2a3ba0 Change-Id: If6ddc71bc2946232d57d5fd8fd6029b45b19495f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167903 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index 3aa9a36c5af0..f39139b7b6e7 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -799,9 +799,11 @@ void ScInputWindow::MouseButtonDown( const MouseEvent& rMEvt ) // I'd prefer to leave at least a single column header and a // row but I don't know how to get that value in pixels. // Use TOOLBOX_WINDOW_HEIGHT for the moment -ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell(); -mnMaxY = GetOutputSizePixel().Height() + (pViewSh->GetGridHeight(SC_SPLIT_TOP) - + pViewSh->GetGridHeight(SC_SPLIT_BOTTOM)) - TOOLBOX_WINDOW_HEIGHT; +if (ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell()) +{ +mnMaxY = GetOutputSizePixel().Height() + (pViewSh->GetGridHeight(SC_SPLIT_TOP) + + pViewSh->GetGridHeight(SC_SPLIT_BOTTOM)) - TOOLBOX_WINDOW_HEIGHT; +} } } @@ -1720,7 +1722,6 @@ bool ScTextWnd::Command( const CommandEvent& rCEvt ) if (m_xEditView) { ScModule* pScMod = SC_MOD(); -ScTabViewShell* pStartViewSh = ScTabViewShell::GetActiveViewShell(); // don't modify the font defaults here - the right defaults are // already set in StartEditEngine when the EditEngine is created @@ -1738,6 +1739,7 @@ bool ScTextWnd::Command( const CommandEvent& rCEvt ) { // Is dragged onto another View? ScTabViewShell* pEndViewSh = ScTabViewShell::GetActiveViewShell(); +ScTabViewShell* pStartViewSh = ScTabViewShell::GetActiveViewShell(); if ( pEndViewSh != pStartViewSh && pStartViewSh != nullptr ) { ScViewData& rViewData = pStartViewSh->GetViewData(); @@ -2663,11 +2665,12 @@ void ScPosWnd::DoEnter() if (bOpenManageNamesDialog) { const sal_uInt16 nId = ScNameDlgWrapper::GetChildWindowId(); -ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell(); -assert(pViewSh); -SfxViewFrame& rViewFrm = pViewSh->GetViewFrame(); -SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); -SC_MOD()->SetRefDialog( nId, pWnd == nullptr ); +if (ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell()) +{ +SfxViewFrame& rViewFrm = pViewSh->GetViewFrame(); +SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); +SC_MOD()->SetRefDialog( nId, pWnd == nullptr ); +} } } diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx index 88de0f73a606..01d13c821981 100644 --- a/sc/source/ui/condformat/condformatdlgentry.cxx +++ b/sc/source/ui/condformat/condformatdlgentry.cxx @@ -446,43 +446,45 @@ void StyleSelect(weld::Window* pDialogParent, weld::ComboBox& rLbStyle, const Sc // unlock the dispatcher so SID_STYLE_NEW can be executed // (SetDispatcherLock would affect all Calc documents) -ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); -SfxDispatcher* pDisp = pViewShell->GetDispatcher(); -bool bLocked = pDisp->IsLocked(); -if (bLocked) -pDisp->Lock(false); - -// Execute the "new style" slot, complete with undo and all necessary updates. -// The return value (SfxUInt16Item) is ignored, look for new styles instead. -pDisp->ExecuteList(SID_STYLE_NEW, -SfxCallMode::SYNCHRON | SfxCallMode::RECORD, -{ , }, { }); - -if (bLocked) -pDisp->Lock(true); - -// Find the new style and add it into the style
core.git: sc/source
sc/source/ui/unoobj/docuno.cxx | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) New commits: commit 7da5bb1ff4a691fb5b55a4bccc0f6c87c9e17692 Author: Julien Nabet AuthorDate: Tue May 21 10:59:29 2024 +0200 Commit: Julien Nabet CommitDate: Tue May 21 14:06:48 2024 +0200 tdf#161190: fix crash when exporting spreadsheet as PDF... with "whole sheet export" option' See bt here: https://bug-attachments.documentfoundation.org/attachment.cgi?id=194240 Change-Id: I453882be5c8bb761a722482f9c94a2b2bb5c7dd4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167890 Reviewed-by: Julien Nabet Tested-by: Jenkins diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 9a6d01a43ed1..13682da51960 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -2384,7 +2384,7 @@ static void lcl_SetMediaScreen(const uno::Reference& xMediaShap pPDF->SetScreenURL(nScreenId, sMediaURL); } -static void lcl_PDFExportMediaShapeScreen(const OutputDevice* pDev, const ScPrintState& rState, +static void lcl_PDFExportMediaShapeScreen(const OutputDevice* pDev, const std::unique_ptr& rState, ScDocument& rDoc, SCTAB nTab, tools::Long nStartPage, bool bSinglePageSheets) { @@ -2434,12 +2434,12 @@ static void lcl_PDFExportMediaShapeScreen(const OutputDevice* pDev, const ScPrin if (bTopDown) // top-bottom page order { nX1 = 0; -for (size_t i = 0; i < rState.m_aRanges.m_nPagesX; ++i) +for (size_t i = 0; i < rState->m_aRanges.m_nPagesX; ++i) { -nX2 = (*rState.m_aRanges.m_xPageEndX)[i]; -for (size_t j = 0; j < rState.m_aRanges.m_nPagesY; ++j) +nX2 = (*rState->m_aRanges.m_xPageEndX)[i]; +for (size_t j = 0; j < rState->m_aRanges.m_nPagesY; ++j) { -auto& rPageRow = (*rState.m_aRanges.m_xPageRows)[j]; +auto& rPageRow = (*rState->m_aRanges.m_xPageRows)[j]; nY1 = rPageRow.GetStartRow(); nY2 = rPageRow.GetEndRow(); @@ -2459,15 +2459,15 @@ static void lcl_PDFExportMediaShapeScreen(const OutputDevice* pDev, const ScPrin } else // left to right page order { -for (size_t i = 0; i < rState.m_aRanges.m_nPagesY; ++i) +for (size_t i = 0; i < rState->m_aRanges.m_nPagesY; ++i) { -auto& rPageRow = (*rState.m_aRanges.m_xPageRows)[i]; +auto& rPageRow = (*rState->m_aRanges.m_xPageRows)[i]; nY1 = rPageRow.GetStartRow(); nY2 = rPageRow.GetEndRow(); nX1 = 0; -for (size_t j = 0; j < rState.m_aRanges.m_nPagesX; ++j) +for (size_t j = 0; j < rState->m_aRanges.m_nPagesX; ++j) { -nX2 = (*rState.m_aRanges.m_xPageEndX)[j]; +nX2 = (*rState->m_aRanges.m_xPageEndX)[j]; tools::Rectangle aPageRect(rDoc.GetMMRect(nX1, nY1, nX2, nY2, nTab)); tools::Rectangle aTmpRect(aPageRect.GetIntersection(pObj->GetCurrentBoundRect())); @@ -2590,7 +2590,7 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, const uno::Any& aSelec tools::Long nTabStart = pPrintFuncCache->GetTabStart(nTab); if (nRenderer == nTabStart) -lcl_PDFExportMediaShapeScreen(pDev, *m_pPrintState, rDoc, nTab, nTabStart, bSinglePageSheets); +lcl_PDFExportMediaShapeScreen(pDev, m_pPrintState, rDoc, nTab, nTabStart, bSinglePageSheets); ScRange aRange; const ScRange* pSelRange = nullptr;
core.git: sc/source
sc/source/ui/vba/excelvbahelper.cxx | 32 ++--- sc/source/ui/vba/excelvbahelper.hxx |2 sc/source/ui/vba/vbaapplication.cxx | 60 +- sc/source/ui/vba/vbaassistant.cxx|4 sc/source/ui/vba/vbaaxes.cxx | 18 +-- sc/source/ui/vba/vbaaxis.cxx | 56 +- sc/source/ui/vba/vbaaxistitle.cxx|4 sc/source/ui/vba/vbaborders.cxx | 22 ++-- sc/source/ui/vba/vbacharacters.cxx |6 - sc/source/ui/vba/vbachart.cxx| 22 ++-- sc/source/ui/vba/vbachartobject.cxx |8 - sc/source/ui/vba/vbachartobjects.cxx | 12 +- sc/source/ui/vba/vbacharttitle.cxx |4 sc/source/ui/vba/vbacomment.cxx |8 - sc/source/ui/vba/vbacomments.cxx |4 sc/source/ui/vba/vbadialog.cxx |4 sc/source/ui/vba/vbadialogs.cxx |4 sc/source/ui/vba/vbaeventshelper.cxx |8 - sc/source/ui/vba/vbafiledialog.cxx |6 - sc/source/ui/vba/vbafiledialogitems.cxx |8 - sc/source/ui/vba/vbafont.cxx | 26 ++-- sc/source/ui/vba/vbaformat.cxx |4 sc/source/ui/vba/vbaformatcondition.cxx |4 sc/source/ui/vba/vbaformatconditions.cxx | 12 +- sc/source/ui/vba/vbaglobals.cxx | 20 +-- sc/source/ui/vba/vbahyperlink.cxx| 14 +- sc/source/ui/vba/vbahyperlinks.cxx |4 sc/source/ui/vba/vbainterior.cxx | 16 +- sc/source/ui/vba/vbamenu.cxx |4 sc/source/ui/vba/vbamenubar.cxx |4 sc/source/ui/vba/vbamenubars.cxx |8 - sc/source/ui/vba/vbamenuitem.cxx |4 sc/source/ui/vba/vbamenuitems.cxx|4 sc/source/ui/vba/vbamenus.cxx|4 sc/source/ui/vba/vbaname.cxx |4 sc/source/ui/vba/vbanames.cxx|8 - sc/source/ui/vba/vbaoleobject.cxx|6 - sc/source/ui/vba/vbaoleobjects.cxx |4 sc/source/ui/vba/vbaoutline.cxx |4 sc/source/ui/vba/vbapagebreak.cxx| 16 +- sc/source/ui/vba/vbapagebreaks.cxx | 10 - sc/source/ui/vba/vbapagesetup.cxx| 88 sc/source/ui/vba/vbapalette.cxx |4 sc/source/ui/vba/vbapane.cxx |4 sc/source/ui/vba/vbapivotcache.cxx |4 sc/source/ui/vba/vbapivottable.cxx |4 sc/source/ui/vba/vbapivottables.cxx |4 sc/source/ui/vba/vbarange.cxx| 170 +++ sc/source/ui/vba/vbarange.hxx|2 sc/source/ui/vba/vbasheetobject.cxx | 42 +++ sc/source/ui/vba/vbasheetobjects.cxx | 18 +-- sc/source/ui/vba/vbastyle.cxx|8 - sc/source/ui/vba/vbastyles.cxx |8 - sc/source/ui/vba/vbatextboxshape.cxx |2 sc/source/ui/vba/vbatextframe.cxx|4 sc/source/ui/vba/vbatitle.hxx| 12 +- sc/source/ui/vba/vbavalidation.cxx | 14 +- sc/source/ui/vba/vbawindow.cxx | 12 +- sc/source/ui/vba/vbawindows.cxx |6 - sc/source/ui/vba/vbaworkbook.cxx | 28 ++--- sc/source/ui/vba/vbaworkbooks.cxx| 22 ++-- sc/source/ui/vba/vbaworksheet.cxx| 30 ++--- sc/source/ui/vba/vbaworksheets.cxx | 12 +- sc/source/ui/vba/vbawsfunction.cxx |8 - 64 files changed, 489 insertions(+), 489 deletions(-) New commits: commit 5a602ed852b872f87893169062ec47041e013fb9 Author: Noel Grandin AuthorDate: Mon May 20 09:13:38 2024 +0200 Commit: Noel Grandin CommitDate: Mon May 20 14:40:36 2024 +0200 loplugin:ostr in sc/.../vba Change-Id: Ifdf0ebba617432f49e2c14c8a52c495dc1c6a36a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167853 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/sc/source/ui/vba/excelvbahelper.cxx b/sc/source/ui/vba/excelvbahelper.cxx index 3224171677e9..0f00dae66ed7 100644 --- a/sc/source/ui/vba/excelvbahelper.cxx +++ b/sc/source/ui/vba/excelvbahelper.cxx @@ -64,7 +64,7 @@ GetUnnamedDataBaseRanges( const ScDocShell* pShell ) if ( pShell ) xModel.set( pShell->GetModel(), uno::UNO_SET_THROW ); uno::Reference< beans::XPropertySet > xModelProps( xModel, uno::UNO_QUERY_THROW ); -uno::Reference< sheet::XUnnamedDatabaseRanges > xUnnamedDBRanges( xModelProps->getPropertyValue("UnnamedDatabaseRanges"), uno::UNO_QUERY_THROW ); +uno::Reference< sheet::XUnnamedDatabaseRanges > xUnnamedDBRanges( xModelProps->getPropertyValue(u"UnnamedDatabaseRanges"_ustr), uno::UNO_QUERY_THROW ); return xUnnamedDBRanges; } @@ -80,7 +80,7 @@ GetAutoFiltRange( const ScDocShell* pShell, sal_Int16 nSheet ) uno::Reference< sheet::XDatabaseRange > xDBRange( xUnnamedDBRanges->getByTable( nSheet ) , uno::UNO_QUERY_THROW ); bool bHasAuto = false; uno::Reference< beans::XPropertySet > xProps( xDBRange, uno::UNO_QUERY_THROW ); -xProps->getPropertyValue("AutoFilter") >>=
core.git: sc/source
sc/source/filter/excel/excform.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit e3bd3c7e3178dc091fd002628f052666b4db3be6 Author: Andrea Gelmini AuthorDate: Fri May 17 13:37:25 2024 +0200 Commit: Taichi Haradaguchi <20001...@ymail.ne.jp> CommitDate: Mon May 20 08:56:49 2024 +0200 Fix typo Change-Id: I10d05b41028df776713db37d60e688d4f04bb739 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167774 Reviewed-by: Taichi Haradaguchi <20001...@ymail.ne.jp> Tested-by: Taichi Haradaguchi <20001...@ymail.ne.jp> diff --git a/sc/source/filter/excel/excform.cxx b/sc/source/filter/excel/excform.cxx index 10119bb1d338..ee7b4a65e542 100644 --- a/sc/source/filter/excel/excform.cxx +++ b/sc/source/filter/excel/excform.cxx @@ -927,7 +927,7 @@ ConvErr ExcelToSc::Convert( ScRangeListTabs& rRangeList, XclImpStream& aIn, std: case 0x04: // Subtraction [313 264] case 0x05: // Multiplication[313 264] case 0x06: // Division [313 264] -case 0x07: // Exponetiation [313 265] +case 0x07: // Exponentiation [313 265] case 0x08: // Concatenation [313 265] case 0x09: // Less Than [313 265] case 0x0A: // Less Than or Equal[313 265] @@ -1410,7 +1410,7 @@ void ExcelToSc::GetAbsRefs( ScRangeList& rRangeList, XclImpStream& rStrm, std::s case 0x04: // Subtraction [313 264] case 0x05: // Multiplication[313 264] case 0x06: // Division [313 264] -case 0x07: // Exponetiation [313 265] +case 0x07: // Exponentiation [313 265] case 0x08: // Concatenation [313 265] case 0x09: // Less Than [313 265] case 0x0A: // Less Than or Equal[313 265]
core.git: sc/source
sc/source/filter/excel/excform8.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit eadcbef8b30da2704a8bdc9dc0c11b8db258b13e Author: Andrea Gelmini AuthorDate: Fri May 17 14:07:11 2024 +0200 Commit: <20001...@ymail.ne.jp> CommitDate: Mon May 20 08:54:48 2024 +0200 Fix typo Change-Id: I22cd12c51d91bd7620bca29227871b3081813a36 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167776 Reviewed-by: <20001...@ymail.ne.jp> Tested-by: Jenkins diff --git a/sc/source/filter/excel/excform8.cxx b/sc/source/filter/excel/excform8.cxx index ebd868aeb7d2..6f053373d193 100644 --- a/sc/source/filter/excel/excform8.cxx +++ b/sc/source/filter/excel/excform8.cxx @@ -987,7 +987,7 @@ ConvErr ExcelToSc8::Convert( ScRangeListTabs& rRangeList, XclImpStream& aIn, std case 0x04: // Subtraction [313 264] case 0x05: // Multiplication[313 264] case 0x06: // Division [313 264] -case 0x07: // Exponetiation [313 265] +case 0x07: // Exponentiation [313 265] case 0x08: // Concatenation [313 265] case 0x09: // Less Than [313 265] case 0x0A: // Less Than or Equal[313 265]
core.git: sc/source
sc/source/ui/docshell/docfunc.cxx |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit d4ae5abb4d00cc8adb3c45a9410fc71e56211c46 Author: Eike Rathke AuthorDate: Sun May 19 15:21:19 2024 +0200 Commit: Eike Rathke CommitDate: Sun May 19 19:26:05 2024 +0200 Resolves: tdf#160804 sc: ResizeMatrix: Use document grammar API grammar (old GRAM_PODF_A1) here was always wrong and could never had matched the formula string obtained from the document, but in earlier days array separators weren't configurable so this may have worked accidentally.. Likely GRAM_PODF_A1 was introduced being confused by existance of older bApi parameter that never was true though and got eliminated later. Change-Id: Ie77ad4047c21d999bea1ff97c7c2b451f01121eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167844 Reviewed-by: Eike Rathke Tested-by: Jenkins diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 556cd6e6c940..d47f6f0bde40 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -5521,11 +5521,11 @@ void ScDocFunc::ResizeMatrix( const ScRange& rOldRange, const ScAddress& rNewEnd if ( DeleteContents( aMark, InsertDeleteFlags::CONTENTS, true, false/*bApi*/ ) ) { -// GRAM_API for API compatibility. -if (!EnterMatrix( aNewRange, , nullptr, aFormula, false/*bApi*/, false, OUString(), formula::FormulaGrammar::GRAM_API )) +// Formula string was obtained in document grammar. +if (!EnterMatrix( aNewRange, , nullptr, aFormula, false/*bApi*/, false, OUString(), rDoc.GetGrammar() )) { // try to restore the previous state -EnterMatrix( rOldRange, , nullptr, aFormula, false/*bApi*/, false, OUString(), formula::FormulaGrammar::GRAM_API ); +EnterMatrix( rOldRange, , nullptr, aFormula, false/*bApi*/, false, OUString(), rDoc.GetGrammar() ); } }
core.git: sc/source
sc/source/ui/cctrl/checklistmenu.cxx |4 1 file changed, 4 insertions(+) New commits: commit b2dc515e2a3c8420c7f39c0b4396632c2086126a Author: Caolán McNamara AuthorDate: Fri May 17 21:05:56 2024 +0100 Commit: Caolán McNamara CommitDate: Sat May 18 14:02:35 2024 +0200 Related: tdf#146326 restore correct focus when on submenu launched we still "cancel" a submenu if it never gets around to getting launched so at least set the restore focus wiget to where we initially grab focus. Change-Id: Ida157823a282d08ca908c20f0135db61881adb7f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167798 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx index 1d720cb3b0dd..45202de94fb4 100644 --- a/sc/source/ui/cctrl/checklistmenu.cxx +++ b/sc/source/ui/cctrl/checklistmenu.cxx @@ -686,11 +686,15 @@ ScCheckListMenuControl::ScCheckListMenuControl(weld::Widget* pParent, ScViewData void ScCheckListMenuControl::GrabFocus() { if (mxEdSearch->get_visible()) +{ mxEdSearch->grab_focus(); +meRestoreFocus = RestoreFocus::EdSearch; +} else { mxMenu->set_cursor(0); mxMenu->grab_focus(); +meRestoreFocus = RestoreFocus::Menu; } }
core.git: sc/source
sc/source/core/tool/addincol.cxx |4 - sc/source/core/tool/addinlis.cxx |2 sc/source/core/tool/appoptio.cxx | 42 +-- sc/source/core/tool/calcconfig.cxx|8 +-- sc/source/core/tool/cellform.cxx |2 sc/source/core/tool/cellkeytranslator.cxx |2 sc/source/core/tool/cellkeywords.inl |6 +- sc/source/core/tool/charthelper.cxx | 14 +++--- sc/source/core/tool/compiler.cxx |2 sc/source/core/tool/defaultsoptions.cxx |6 +- sc/source/core/tool/docoptio.cxx | 30 ++--- sc/source/core/tool/editutil.cxx |4 - sc/source/core/tool/filtopt.cxx |6 +- sc/source/core/tool/formulalogger.cxx |2 sc/source/core/tool/formulaopt.cxx| 32 +++--- sc/source/core/tool/formulaparserpool.cxx |2 sc/source/core/tool/grouparealistener.cxx |4 - sc/source/core/tool/inputopt.cxx | 24 +- sc/source/core/tool/interpr1.cxx |4 - sc/source/core/tool/interpr4.cxx |6 +- sc/source/core/tool/interpr5.cxx |2 sc/source/core/tool/printopt.cxx |6 +- sc/source/core/tool/stylehelper.cxx | 38 - sc/source/core/tool/unitconv.cxx |2 sc/source/core/tool/viewopti.cxx | 66 +++--- sc/source/core/tool/zforauto.cxx |2 26 files changed, 159 insertions(+), 159 deletions(-) New commits: commit cb4e9a7bf2231716d4809c682ae4b6b8b91b09b4 Author: Noel Grandin AuthorDate: Fri May 17 12:40:23 2024 +0200 Commit: Noel Grandin CommitDate: Fri May 17 14:15:20 2024 +0200 loplugin:ostr in sc/../tool Change-Id: I04c41c79613397745a2e97c2e8a247e11f114c7c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167767 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx index 66d8902de5f1..f66ff2da554c 100644 --- a/sc/source/core/tool/addincol.cxx +++ b/sc/source/core/tool/addincol.cxx @@ -260,7 +260,7 @@ void ScUnoAddInCollection::Initialize() if ( xEnAc.is() ) { uno::Reference xEnum = -xEnAc->createContentEnumeration( "com.sun.star.sheet.AddIn" ); +xEnAc->createContentEnumeration( u"com.sun.star.sheet.AddIn"_ustr ); if ( xEnum.is() ) { // loop through all AddIns @@ -368,7 +368,7 @@ void ScUnoAddInCollection::ReadConfiguration() const OUString sSlash('/'); // get the list of add-ins (services) -const uno::Sequence aServiceNames = rAddInConfig.GetNodeNames( "" ); +const uno::Sequence aServiceNames = rAddInConfig.GetNodeNames( u""_ustr ); for ( const OUString& aServiceName : aServiceNames ) { diff --git a/sc/source/core/tool/addinlis.cxx b/sc/source/core/tool/addinlis.cxx index f8a236780e07..b7548a78dec7 100644 --- a/sc/source/core/tool/addinlis.cxx +++ b/sc/source/core/tool/addinlis.cxx @@ -31,7 +31,7 @@ using namespace com::sun::star; -SC_SIMPLE_SERVICE_INFO( ScAddInListener, "ScAddInListener", "stardiv.one.sheet.AddInListener" ) +SC_SIMPLE_SERVICE_INFO( ScAddInListener, u"ScAddInListener"_ustr, u"stardiv.one.sheet.AddInListener"_ustr ) ::std::vector> ScAddInListener::aAllListeners; diff --git a/sc/source/core/tool/appoptio.cxx b/sc/source/core/tool/appoptio.cxx index c35524f9588f..7b44ca39fe4f 100644 --- a/sc/source/core/tool/appoptio.cxx +++ b/sc/source/core/tool/appoptio.cxx @@ -213,51 +213,51 @@ Sequence ScAppCfg::GetLayoutPropertyNames() { const bool bIsMetric = ScOptionsUtil::IsMetricSystem(); -return {(bIsMetric ? OUString("Other/MeasureUnit/Metric") - : OUString("Other/MeasureUnit/NonMetric")), // SCLAYOUTOPT_MEASURE - "Other/StatusbarFunction", // SCLAYOUTOPT_STATUSBAR - "Zoom/Value", // SCLAYOUTOPT_ZOOMVAL - "Zoom/Type", // SCLAYOUTOPT_ZOOMTYPE - "Zoom/Synchronize",// SCLAYOUTOPT_SYNCZOOM - "Other/StatusbarMultiFunction"}; // SCLAYOUTOPT_STATUSBARMULTI +return {(bIsMetric ? u"Other/MeasureUnit/Metric"_ustr + : u"Other/MeasureUnit/NonMetric"_ustr), // SCLAYOUTOPT_MEASURE + u"Other/StatusbarFunction"_ustr, // SCLAYOUTOPT_STATUSBAR + u"Zoom/Value"_ustr, // SCLAYOUTOPT_ZOOMVAL + u"Zoom/Type"_ustr, // SCLAYOUTOPT_ZOOMTYPE + u"Zoom/Synchronize"_ustr,// SCLAYOUTOPT_SYNCZOOM + u"Other/StatusbarMultiFunction"_ustr}; //
core.git: sc/source
sc/source/filter/excel/excdoc.cxx|2 sc/source/filter/excel/excel.cxx | 12 - sc/source/filter/excel/excform.cxx |6 sc/source/filter/excel/excform8.cxx |6 sc/source/filter/excel/excimp8.cxx |4 sc/source/filter/excel/expop2.cxx|2 sc/source/filter/excel/xechart.cxx |2 sc/source/filter/excel/xecontent.cxx |4 sc/source/filter/excel/xeescher.cxx | 72 - sc/source/filter/excel/xelink.cxx|4 sc/source/filter/excel/xepivotxml.cxx|2 sc/source/filter/excel/xeroot.cxx|2 sc/source/filter/excel/xestream.cxx |6 sc/source/filter/excel/xestyle.cxx |2 sc/source/filter/excel/xichart.cxx |4 sc/source/filter/excel/xiescher.cxx | 132 - sc/source/filter/excel/xistyle.cxx |2 sc/source/filter/excel/xlchart.cxx | 12 - sc/source/filter/excel/xltoolbar.cxx |6 sc/source/filter/html/htmlexp.cxx|2 sc/source/filter/html/htmlexp2.cxx |2 sc/source/filter/html/htmlpars.cxx |6 sc/source/filter/lotus/lotimpop.cxx |4 sc/source/filter/oox/SparklineFragment.cxx |8 - sc/source/filter/oox/commentsbuffer.cxx |2 sc/source/filter/oox/condformatbuffer.cxx|4 sc/source/filter/oox/drawingfragment.cxx | 32 ++-- sc/source/filter/oox/excelchartconverter.cxx |2 sc/source/filter/oox/excelfilter.cxx |2 sc/source/filter/oox/extlstcontext.cxx |4 sc/source/filter/oox/formulabase.cxx |4 sc/source/filter/oox/numberformatsbuffer.cxx |4 sc/source/filter/oox/ooxformulaparser.cxx|6 sc/source/filter/oox/pivottablefragment.cxx |2 sc/source/filter/oox/querytablebuffer.cxx|6 sc/source/filter/oox/sheetdatabuffer.cxx |2 sc/source/filter/oox/stylesbuffer.cxx|2 sc/source/filter/oox/unitconverter.cxx | 14 - sc/source/filter/oox/viewsettings.cxx|2 sc/source/filter/oox/workbookfragment.cxx|6 sc/source/filter/oox/workbookhelper.cxx |6 sc/source/filter/oox/workbooksettings.cxx| 12 - sc/source/filter/orcus/filterdetect.cxx | 10 - sc/source/filter/xcl97/XclExpChangeTrack.cxx |4 sc/source/filter/xcl97/xcl97esc.cxx |4 sc/source/filter/xcl97/xcl97rec.cxx |2 sc/source/filter/xml/SparklineGroupsExport.cxx |2 sc/source/filter/xml/XMLCodeNameProvider.cxx |2 sc/source/filter/xml/XMLExportDataPilot.cxx | 16 +- sc/source/filter/xml/XMLExportDatabaseRanges.cxx | 16 +- sc/source/filter/xml/XMLStylesExportHelper.cxx |6 sc/source/filter/xml/XMLTableHeaderFooterContext.cxx | 14 - sc/source/filter/xml/XMLTableShapeResizer.cxx|2 sc/source/filter/xml/XMLTrackedChangesContext.cxx|2 sc/source/filter/xml/xmlcondformat.cxx |2 sc/source/filter/xml/xmlcvali.cxx|2 sc/source/filter/xml/xmlexprt.cxx| 98 ++--- sc/source/filter/xml/xmlimprt.cxx| 68 - sc/source/filter/xml/xmlstyli.cxx|8 - sc/source/filter/xml/xmlwrap.cxx | 140 +-- 60 files changed, 407 insertions(+), 407 deletions(-) New commits: commit 000aaf1f8c6b3520a604327445a41ca6b8f568dc Author: Noel Grandin AuthorDate: Fri May 17 08:50:01 2024 +0200 Commit: Noel Grandin CommitDate: Fri May 17 12:15:12 2024 +0200 loplugin:ostr in sc/../filter Change-Id: I3c986d9e7f9780f08653131205626471ac75896f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167759 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx index 00b1ab0a3d72..9b2a29ff62ca 100644 --- a/sc/source/filter/excel/excdoc.cxx +++ b/sc/source/filter/excel/excdoc.cxx @@ -872,7 +872,7 @@ void ExcDocument::WriteXml( XclExpXmlStream& rStrm ) std::shared_ptr pTheme = pDrawLayer->getTheme(); if (pTheme) { -OUString sThemeRelationshipPath = "theme/theme1.xml"; +OUString sThemeRelationshipPath = u"theme/theme1.xml"_ustr; OUString sThemeDocumentPath = "xl/" + sThemeRelationshipPath; oox::ThemeExport aThemeExport(, oox::drawingml::DOCUMENT_XLSX); diff --git
core.git: sc/source
sc/source/core/data/SolverSettings.cxx |2 +- sc/source/core/data/attrib.cxx |2 +- sc/source/core/data/docpool.cxx|4 ++-- sc/source/core/data/documen2.cxx |6 +++--- sc/source/core/data/documen3.cxx |4 ++-- sc/source/core/data/documen5.cxx |8 sc/source/core/data/document.cxx |4 ++-- sc/source/core/data/dptabres.cxx | 14 +++--- sc/source/core/data/dptabsrc.cxx | 24 sc/source/core/data/dputil.cxx |2 +- sc/source/core/data/drwlayer.cxx |8 sc/source/core/data/formulacell.cxx| 30 +++--- sc/source/core/data/funcdesc.cxx | 24 sc/source/core/data/global.cxx |2 +- sc/source/core/data/postit.cxx |4 ++-- sc/source/core/data/table3.cxx |2 +- sc/source/core/data/validat.cxx|6 +++--- 17 files changed, 73 insertions(+), 73 deletions(-) New commits: commit 239641a4df8c137dc59eb4040608e5d7d9f79320 Author: Noel Grandin AuthorDate: Thu May 16 13:33:45 2024 +0200 Commit: Noel Grandin CommitDate: Thu May 16 16:06:22 2024 +0200 loplugin:ostr in sc/../data Change-Id: I5fef1585ccc9492961328affd284f2c60a004e14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167738 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/sc/source/core/data/SolverSettings.cxx b/sc/source/core/data/SolverSettings.cxx index 1320d470efcf..333751d26734 100644 --- a/sc/source/core/data/SolverSettings.cxx +++ b/sc/source/core/data/SolverSettings.cxx @@ -202,7 +202,7 @@ OUString SolverSettings::GetParameter(SolverParameter eParam) return m_sLibrarySize; break; default: -return ""; +return u""_ustr; } } diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx index 1a587d2b6572..35e6e991dd53 100644 --- a/sc/source/core/data/attrib.cxx +++ b/sc/source/core/data/attrib.cxx @@ -540,7 +540,7 @@ bool ScViewObjectModeItem::GetPresentation const IntlWrapper& /* rIntl */ ) const { -OUString aDel(": "); +OUString aDel(u": "_ustr); rText.clear(); switch ( ePres ) diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx index 5ef4c4a4091f..2add110bc0f2 100644 --- a/sc/source/core/data/docpool.cxx +++ b/sc/source/core/data/docpool.cxx @@ -257,7 +257,7 @@ static ItemInfoPackage& getItemInfoPackageScDocument() } ScDocumentPool::ScDocumentPool() -: SfxItemPool("ScDocumentPool") +: SfxItemPool(u"ScDocumentPool"_ustr) { registerItemInfoPackage(getItemInfoPackageScDocument()); } @@ -373,7 +373,7 @@ bool ScDocumentPool::GetPresentation( sal_uInt16 nW = rItem.Which(); OUString aStrYes ( ScResId(STR_YES) ); OUString aStrNo ( ScResId(STR_NO) ); -OUString aStrSep(": "); +OUString aStrSep(u": "_ustr); bool ePresentationRet = true; switch( nW ) diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index a551bf014c42..ca7fbcc938c4 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -578,7 +578,7 @@ void ScDocument::ResetClip( ScDocument* pSourceDoc, SCTAB nTab ) { maTabs.resize(nTab+1); } -maTabs[nTab].reset( new ScTable(*this, nTab, "baeh") ); +maTabs[nTab].reset( new ScTable(*this, nTab, u"baeh"_ustr) ); if (nTab < pSourceDoc->GetTableCount() && pSourceDoc->maTabs[nTab]) maTabs[nTab]->SetLayoutRTL( pSourceDoc->maTabs[nTab]->IsLayoutRTL() ); } @@ -595,7 +595,7 @@ void ScDocument::EnsureTable( SCTAB nTab ) maTabs.resize(nTab+1); if (!maTabs[nTab]) -maTabs[nTab].reset( new ScTable(*this, nTab, "temp", bExtras, bExtras) ); +maTabs[nTab].reset( new ScTable(*this, nTab, u"temp"_ustr, bExtras, bExtras) ); } ScRefCellValue ScDocument::GetRefCellValue( const ScAddress& rPos ) @@ -1107,7 +1107,7 @@ bool ScDocument::TransferTab( ScDocument& rSrcDoc, SCTAB nSrcPos, ScDocShell* pSrcShell = rSrcDoc.GetDocumentShell(); if ( pSrcShell ) { -OUString aLibName("Standard"); +OUString aLibName(u"Standard"_ustr); #if HAVE_FEATURE_SCRIPTING const BasicManager *pBasicManager = pSrcShell->GetBasicManager(); if (pBasicManager && !pBasicManager->GetName().isEmpty()) diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index e31c111a3786..db8a9972e43f 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -2048,7 +2048,7 @@ void ScDocument::DoMergeContents( SCCOL nStartCol, SCROW nStartRow, aCell = ScRefCellValue(*this, aPos); } if (nCol != nStartCol || nRow != nStartRow) -SetString(nCol,nRow,nTab,""); +
core.git: sc/source
sc/source/ui/cctrl/checklistmenu.cxx | 63 +-- sc/source/ui/inc/checklistmenu.hxx | 22 2 files changed, 83 insertions(+), 2 deletions(-) New commits: commit a525895a5f820350dc307969b1e8fd5d218a1ddd Author: Caolán McNamara AuthorDate: Mon May 13 10:43:20 2024 +0100 Commit: Caolán McNamara CommitDate: Tue May 14 17:34:23 2024 +0200 Resolves: tdf#146326 restore focus on autofilter submenu popdown to where it was before the submenu popup, unless the keyboard was used in the submenu, in which case restore focus to the menu instead. Change-Id: Iaa24b4eadf206b877a093529678667927488de8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167580 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx index 60078c335437..1d720cb3b0dd 100644 --- a/sc/source/ui/cctrl/checklistmenu.cxx +++ b/sc/source/ui/cctrl/checklistmenu.cxx @@ -77,6 +77,10 @@ IMPL_LINK_NOARG(ScCheckListMenuControl, RowActivatedHdl, weld::TreeView&, bool) IMPL_LINK(ScCheckListMenuControl, MenuKeyInputHdl, const KeyEvent&, rKEvt, bool) { +// Assume that once the keyboard is used that focus should restore to this menu +// on dismissing a submenu +SetRestoreFocus(ScCheckListMenuControl::RestoreFocus::Menu); + const vcl::KeyCode& rKeyCode = rKEvt.GetKeyCode(); switch (rKeyCode.GetCode()) @@ -328,17 +332,65 @@ void ScCheckListMenuControl::launchSubMenu() if (!mxMenu->get_selected(mxScratchIter.get())) return; +meRestoreFocus = DetermineRestoreFocus(); + tools::Rectangle aRect = GetSubMenuParentRect(); pSubMenu->StartPopupMode(mxMenu.get(), aRect); mxMenu->select(*mxScratchIter); + pSubMenu->GrabFocus(); } +ScCheckListMenuControl::RestoreFocus ScCheckListMenuControl::DetermineRestoreFocus() const +{ +if (mxEdSearch->has_focus()) +return RestoreFocus::EdSearch; +if (mpChecks->has_focus()) +return RestoreFocus::Checks; +if (mxChkToggleAll->has_focus()) +return RestoreFocus::ChkToggleAll; +if (mxChkLockChecked->has_focus()) +return RestoreFocus::ChkLockChecked; +if (mxBtnSelectSingle->has_focus()) +return RestoreFocus::BtnSelectSingle; +if (mxBtnUnselectSingle->has_focus()) +return RestoreFocus::BtnUnselectSingle; +return RestoreFocus::Menu; +} + +void ScCheckListMenuControl::RestorePreviousFocus() +{ +switch (meRestoreFocus) +{ +case RestoreFocus::EdSearch: +mxEdSearch->grab_focus(); +break; +case RestoreFocus::Checks: +mpChecks->grab_focus(); +break; +case RestoreFocus::ChkToggleAll: +mxChkToggleAll->grab_focus(); +break; +case RestoreFocus::ChkLockChecked: +mxChkLockChecked->grab_focus(); +break; +case RestoreFocus::BtnSelectSingle: +mxBtnSelectSingle->grab_focus(); +break; +case RestoreFocus::BtnUnselectSingle: +mxBtnUnselectSingle->grab_focus(); +break; +default: +mxMenu->grab_focus(); +break; +} +} + IMPL_LINK_NOARG(ScCheckListMenuControl, PostPopdownHdl, void*, void) { mnAsyncPostPopdownId = nullptr; -mxMenu->grab_focus(); +RestorePreviousFocus(); } IMPL_LINK(ScCheckListMenuControl, MouseEnterHdl, const MouseEvent&, rMEvt, bool) @@ -522,6 +574,7 @@ ScCheckListMenuControl::ScCheckListMenuControl(weld::Widget* pParent, ScViewData , mrViewData(rViewData) , mnAsyncPostPopdownId(nullptr) , mnAsyncSetDropdownPosId(nullptr) +, meRestoreFocus(RestoreFocus::Menu) , mbHasDates(bHasDates) , mbIsPoppedUp(false) , maOpenTimer(this) @@ -1815,8 +1868,14 @@ IMPL_LINK(ScListSubMenuControl, MenuKeyInputHdl, const KeyEvent&, rKEvt, bool) { bool bConsumed = false; const vcl::KeyCode& rKeyCode = rKEvt.GetKeyCode(); +const sal_uInt16 eKeyCode = rKeyCode.GetCode(); -switch (rKeyCode.GetCode()) +// Assume that once the keyboard is used that focus should restore to the +// parent menu +if (eKeyCode != KEY_ESCAPE) + mrParentControl.SetRestoreFocus(ScCheckListMenuControl::RestoreFocus::Menu); + +switch (eKeyCode) { case KEY_ESCAPE: case KEY_LEFT: diff --git a/sc/source/ui/inc/checklistmenu.hxx b/sc/source/ui/inc/checklistmenu.hxx index 8e24baef433b..558ef9f47e37 100644 --- a/sc/source/ui/inc/checklistmenu.hxx +++ b/sc/source/ui/inc/checklistmenu.hxx @@ -96,6 +96,18 @@ public: }; typedef std::set ResultType; + +enum RestoreFocus +{ +Menu, +EdSearch, +Checks, +ChkToggleAll, +ChkLockChecked, +BtnSelectSingle, +BtnUnselectSingle +}; + struct MenuItemData { bool mbEnabled:1; @@ -190,6 +202,11
core.git: sc/source
sc/source/ui/view/prevwsh.cxx | 19 --- 1 file changed, 8 insertions(+), 11 deletions(-) New commits: commit 78e0626bc7bf37d1eda2e3151dd1a44056f92032 Author: Rafał Dobrakowski AuthorDate: Thu May 9 18:18:43 2024 +0200 Commit: Ilmari Lauhakangas CommitDate: Mon May 13 10:41:43 2024 +0200 tdf#45705 Integrate zoom UI commands into Calc This patch uses basegfx::zoomtools to zoom in and out, making it smoother. Similar to commit c96e1ec61835bc01e2969ec97fce9a1674fbf6d7 done for Writer view shell, this patch makes zoom in and zoom out commands functional for Calc the preview shell. Change-Id: I1612f51d39c507d192237bf2361b91e6e5723c4c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167389 Tested-by: Jenkins Tested-by: Ilmari Lauhakangas Reviewed-by: Ilmari Lauhakangas diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index 9d33bdaf626a..a0dd401b97b2 100644 --- a/sc/source/ui/view/prevwsh.cxx +++ b/sc/source/ui/view/prevwsh.cxx @@ -668,19 +668,16 @@ void ScPreviewShell::Execute( SfxRequest& rReq ) } break; case SID_ZOOM_IN: -{ -sal_uInt16 nNew = pPreview->GetZoom() + 20 ; -nNew -= nNew % 20; -pPreview->SetZoom( nNew ); -eZoom = SvxZoomType::PERCENT; -rReq.Done(); -} -break; case SID_ZOOM_OUT: { -sal_uInt16 nNew = pPreview->GetZoom() - 1; -nNew -= nNew % 20; -pPreview->SetZoom( nNew ); +sal_uInt16 nNewZoom; +const sal_uInt16 nOldZoom {pPreview->GetZoom()}; +if(SID_ZOOM_OUT == nSlot) +nNewZoom = basegfx::zoomtools::zoomOut(nOldZoom); +else +nNewZoom = basegfx::zoomtools::zoomIn(nOldZoom); + +pPreview->SetZoom(nNewZoom); eZoom = SvxZoomType::PERCENT; rReq.Done(); }
core.git: sc/source
sc/source/ui/undo/undobase.cxx | 23 --- 1 file changed, 16 insertions(+), 7 deletions(-) New commits: commit 2b85bceca88ab119fff5cbdc41fe913435a479ca Author: Pranam Lashkari AuthorDate: Fri May 10 02:02:18 2024 +0300 Commit: Pranam Lashkari CommitDate: Sat May 11 01:48:33 2024 +0200 sc: undo: unify height adjust logic in undo with regular logic in ScBlockUndo::AdjustHeight now we use device like ScViewFunc::SetWidthOrHeight This provides unified behavior with user adjusting height or triggered it by undo problem: in online sometimes undoing would cause wrong selection due to incorrect height set steps to reproduce(happened in certain files only): 1. autofill down a couple of cells 2. undo it 3. try to select the same cell again cell selection will act like auto filled cells are merged cells Change-Id: I81b798c4150284792ac3953caf822fefab0ccee2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167424 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara (cherry picked from commit 726b133fd8c823c7f05a30c1995de26db372174d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167454 Tested-by: Jenkins Reviewed-by: Pranam Lashkari diff --git a/sc/source/ui/undo/undobase.cxx b/sc/source/ui/undo/undobase.cxx index 8ce66d95d0c4..a99dec962d89 100644 --- a/sc/source/ui/undo/undobase.cxx +++ b/sc/source/ui/undo/undobase.cxx @@ -36,6 +36,7 @@ #include #include #include +#include ScSimpleUndo::ScSimpleUndo( ScDocShell* pDocSh ) : @@ -285,18 +286,26 @@ bool ScBlockUndo::AdjustHeight() { ScDocument& rDoc = pDocShell->GetDocument(); -ScopedVclPtrInstance< VirtualDevice > pVirtDev; +ScSizeDeviceProvider aProv(pDocShell); Fraction aZoomX( 1, 1 ); Fraction aZoomY = aZoomX; double nPPTX, nPPTY; ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); if (pViewShell) { -ScViewData& rData = pViewShell->GetViewData(); -nPPTX = rData.GetPPTX(); -nPPTY = rData.GetPPTY(); -aZoomX = rData.GetZoomX(); -aZoomY = rData.GetZoomY(); +if (aProv.IsPrinter()) +{ +nPPTX = aProv.GetPPTX(); +nPPTY = aProv.GetPPTY(); +} +else +{ +ScViewData& rData = pViewShell->GetViewData(); +nPPTX = rData.GetPPTX(); +nPPTY = rData.GetPPTY(); +aZoomX = rData.GetZoomX(); +aZoomY = rData.GetZoomY(); +} } else { @@ -305,7 +314,7 @@ bool ScBlockUndo::AdjustHeight() nPPTY = ScGlobal::nScreenPPTY; } -sc::RowHeightContext aCxt(rDoc.MaxRow(), nPPTX, nPPTY, aZoomX, aZoomY, pVirtDev); +sc::RowHeightContext aCxt(rDoc.MaxRow(), nPPTX, nPPTY, aZoomX, aZoomY, aProv.GetDevice()); bool bRet = rDoc.SetOptimalHeight( aCxt, aBlockRange.aStart.Row(), aBlockRange.aEnd.Row(), aBlockRange.aStart.Tab(), true);
core.git: sc/source
sc/source/core/tool/address.cxx | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) New commits: commit be7813b880def3aaea9ae00664067b9946235b59 Author: Caolán McNamara AuthorDate: Fri May 10 11:02:21 2024 +0100 Commit: Caolán McNamara CommitDate: Fri May 10 14:48:37 2024 +0200 ofz#68874 avoid Integer-overflow rather than detect it after the fact to keep ubsan happy Change-Id: I1336f7a23fa7170b754b818c1ec42ca85f5c27d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167445 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index b976443fc649..c419d9f3a312 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -136,7 +136,7 @@ const sal_Unicode* parseQuotedName( const sal_Unicode* p, OUString& rName ) static sal_Int64 sal_Unicode_strtol ( const sal_Unicode* p, const sal_Unicode** pEnd ) { -sal_Int64 accum = 0, prev = 0; +sal_Int64 accum = 0; bool is_neg = false; if( *p == '-' ) @@ -147,15 +147,20 @@ static sal_Int64 sal_Unicode_strtol ( const sal_Unicode* p, const sal_Unicode** else if( *p == '+' ) p++; +const sal_Int64 cutoff = is_neg ? -(std::numeric_limits::min() / 10) +: std::numeric_limits::max() / 10; +const sal_Int64 cutlim = is_neg ? -(std::numeric_limits::min() % 10) +: std::numeric_limits::max() % 10; + while (rtl::isAsciiDigit( *p )) { -accum = accum * 10 + *p - '0'; -if( accum < prev ) +int val = *p - '0'; +if (accum > cutoff || (accum == cutoff && val > cutlim)) { *pEnd = nullptr; return 0; } -prev = accum; +accum = accum * 10 + val; p++; }
core.git: sc/source
sc/source/filter/excel/xicontent.cxx |2 +- sc/source/filter/ftools/ftools.cxx|9 ++--- sc/source/filter/inc/ftools.hxx |7 --- sc/source/filter/oox/stylesbuffer.cxx |4 ++-- 4 files changed, 9 insertions(+), 13 deletions(-) New commits: commit 5cc3d3a4433f538394c4c65b1a80a9ea7e4d7ce6 Author: Noel Grandin AuthorDate: Thu May 9 12:44:13 2024 +0200 Commit: Noel Grandin CommitDate: Thu May 9 17:58:53 2024 +0200 Revert "tdf#160706 speed up loading conditional formatting rule in XLS (3)" This reverts commit e1268721d4266ed1254da99581a7c2c3dfb72ba6. caolanm: With the old "bForceName" of true then previously if the style name existed it was renamed to something else and then a fresh style with the requested name created. While now we just reuse it. I'm not very clued in to what calc does, but in writer we might do something like this if we are inserting into an existing document and don't want to clobber existing styles. Except here we sort of did clobber existing styles by renaming them. So I'm unsure of what on earth the original idea was. So I wonder about a "insert into existing calc document" scenario? noelg: Caolan, I was operating under the assumption that this comment here is the desired behaviour. But now that I read it again, I am not so sure. This commit should probably be backed out. Change-Id: If503efa9fa1a7886eb57bb62d1327f81e4410981 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167318 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx index 8701b3c69204..a2862f7b6988 100644 --- a/sc/source/filter/excel/xicontent.cxx +++ b/sc/source/filter/excel/xicontent.cxx @@ -576,7 +576,7 @@ void XclImpCondFormat::ReadCF( XclImpStream& rStrm ) // *** create style sheet *** OUString aStyleName( XclTools::GetCondFormatStyleName( GetCurrScTab(), mnFormatIndex, mnCondIndex ) ); -SfxItemSet& rStyleItemSet = ScfTools::MakeCellStyleSheet( GetStyleSheetPool(), aStyleName ).GetItemSet(); +SfxItemSet& rStyleItemSet = ScfTools::MakeCellStyleSheet( GetStyleSheetPool(), aStyleName, true ).GetItemSet(); const XclImpPalette& rPalette = GetPalette(); diff --git a/sc/source/filter/ftools/ftools.cxx b/sc/source/filter/ftools/ftools.cxx index 1ce82e5dd1d8..bf2b784a994b 100644 --- a/sc/source/filter/ftools/ftools.cxx +++ b/sc/source/filter/ftools/ftools.cxx @@ -254,14 +254,9 @@ ScStyleSheet& lclMakeStyleSheet( ScStyleSheetPool& rPool, const OUString& rStyle } // namespace -ScStyleSheet& ScfTools::MakeCellStyleSheet( ScStyleSheetPool& rPool, const OUString& rStyleName ) +ScStyleSheet& ScfTools::MakeCellStyleSheet( ScStyleSheetPool& rPool, const OUString& rStyleName, bool bForceName ) { -SfxStyleSheetBase* pOldStyleSheet = rPool.Find( rStyleName, SfxStyleFamily::Para ); -if( pOldStyleSheet ) -return static_cast< ScStyleSheet& >(*pOldStyleSheet); - -// create new style sheet -return static_cast< ScStyleSheet& >( rPool.Make( rStyleName, SfxStyleFamily::Para, SfxStyleSearchBits::UserDefined ) ); +return lclMakeStyleSheet( rPool, rStyleName, SfxStyleFamily::Para, bForceName ); } ScStyleSheet& ScfTools::MakePageStyleSheet( ScStyleSheetPool& rPool, const OUString& rStyleName, bool bForceName ) diff --git a/sc/source/filter/inc/ftools.hxx b/sc/source/filter/inc/ftools.hxx index 0fdb90cc26ae..7e8a07bce8c8 100644 --- a/sc/source/filter/inc/ftools.hxx +++ b/sc/source/filter/inc/ftools.hxx @@ -193,11 +193,12 @@ public: // *** style sheet handling *** --- /** Creates and returns a cell style sheet and inserts it into the pool. -@descr If the style sheet is already in the pool, return the existing style. -*/ +@descr If the style sheet is already in the pool, another unused style name is used. +@param bForceName Controls behaviour, if the style already exists: +true = Old existing style will be renamed; false = New style gets another name. */ static ScStyleSheet& MakeCellStyleSheet( ScStyleSheetPool& rPool, -const OUString& rStyleName ); +const OUString& rStyleName, bool bForceName ); /** Creates and returns a page style sheet and inserts it into the pool. @descr If the style sheet is already in the pool, another unused style name is used. @param bForceName Controls behaviour, if the style already exists: diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx index 76245a6980a3..234d0365bdec 100644 --- a/sc/source/filter/oox/stylesbuffer.cxx +++ b/sc/source/filter/oox/stylesbuffer.cxx @@ -3005,7 +3005,7 @@ OUString StylesBuffer::createDxfStyle( sal_Int32 nDxfId ) const // Create
core.git: sc/source
sc/source/ui/view/hdrcont.cxx |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) New commits: commit f1d69a84ac82034d7f98877780c549f06d93792d Author: Heiko Tietze AuthorDate: Fri May 3 11:16:40 2024 +0200 Commit: Heiko Tietze CommitDate: Tue May 7 15:49:22 2024 +0200 Resolves tdf#160324 - Larger hit area for col/row resize actions Tentative solution made optional depending on experimental settings Change-Id: I6d527d2b0d0de3b48f123b626ebf0b6ce60299a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167041 Tested-by: Jenkins Reviewed-by: Heiko Tietze diff --git a/sc/source/ui/view/hdrcont.cxx b/sc/source/ui/view/hdrcont.cxx index 98ebabb702c3..bf97dbb01f95 100644 --- a/sc/source/ui/view/hdrcont.cxx +++ b/sc/source/ui/view/hdrcont.cxx @@ -35,6 +35,7 @@ #include #include #include +#include #define SC_DRAG_MIN 2 @@ -627,6 +628,9 @@ void ScHeaderControl::Paint( vcl::RenderContext& /*rRenderContext*/, const tools SCCOLROW ScHeaderControl::GetMousePos(const Point& rPos, bool& rBorder) const { +// #define nHitArea 5 +const int nHitArea( officecfg::Office::Common::Misc::ExperimentalMode::get() ? 5 : 2 ); + boolbFound = false; SCCOLROWnPos = GetPos(); SCCOLROWnHitNo = nPos; @@ -650,7 +654,7 @@ SCCOLROW ScHeaderControl::GetMousePos(const Point& rPos, bool& rBorder) const nScrPos += GetEntrySize( nEntryNo - 1 ) * nLayoutSign; //! GetHiddenCount() ?? nDif = nMousePos - nScrPos; -if (nDif >= -2 && nDif <= 2) +if (nDif >= -nHitArea && nDif <= +nHitArea) { bFound = true; nHitNo=nEntryNo-1;
core.git: sc/source
sc/source/ui/app/transobj.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 11dcaad533553999dc643807f6f21f8f98bc9e20 Author: Andrea Gelmini AuthorDate: Tue May 7 11:33:06 2024 +0200 Commit: Julien Nabet CommitDate: Tue May 7 15:32:50 2024 +0200 Fix typo Change-Id: I8772d0e12b169559a3bf99347097939ede5db582 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167266 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx index f242abc497b0..0d926b980fc2 100644 --- a/sc/source/ui/app/transobj.cxx +++ b/sc/source/ui/app/transobj.cxx @@ -418,7 +418,7 @@ bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor, const OUSt // memory limits, lower the resolution of the bitmap by keeping // the VirtualDevice pixel size within an arbitrary number of // pixels. -// Note: the artibrary "maximum number of pixels" limit that +// Note: the arbitrary "maximum number of pixels" limit that // that Skia can handle may need to be raised or lowered for // platforms other than macOS. static constexpr tools::Long nCopyToImageMaxPixels = 8192 * 8192;
core.git: sc/source
sc/source/ui/app/scmod.cxx |7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) New commits: commit e0b87bf9a34a06d344f4b803c31442c2f723a8ee Author: Caolán McNamara AuthorDate: Mon May 6 20:38:54 2024 +0100 Commit: Caolán McNamara CommitDate: Tue May 7 10:21:05 2024 +0200 cid#1596888 Explicit null dereferenced Change-Id: I8b6b99a66913a1a6f30046d1cba9fce87d469415 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167249 Reviewed-by: Caolán McNamara Tested-by: Jenkins diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx index f541ca27b679..50d71a589182 100644 --- a/sc/source/ui/app/scmod.cxx +++ b/sc/source/ui/app/scmod.cxx @@ -217,8 +217,9 @@ void ScModule::ConfigurationChanged(utl::ConfigurationBroadcaster* p, Configurat { SfxViewShell* pSfxViewShell = SfxViewShell::Current(); ScTabViewShell* pViewShell = dynamic_cast(pSfxViewShell); +SfxObjectShell* pCurrentSh = SfxObjectShell::Current(); -if (pViewShell) +if (pViewShell && pCurrentSh) { ScViewRenderingOptions aViewRenderingOptions(pViewShell->GetViewRenderingData()); Color aFillColor(m_pColorConfig->GetColorValue(svtools::DOCCOLOR).nColor); @@ -227,9 +228,7 @@ void ScModule::ConfigurationChanged(utl::ConfigurationBroadcaster* p, Configurat const bool bUnchanged(aViewRenderingOptions == pViewShell->GetViewRenderingData()); if (!bUnchanged) pViewShell->SetViewRenderingData(aViewRenderingOptions); -ScModelObj* pScModelObj = nullptr; -if (SfxObjectShell* pCurrentSh = SfxObjectShell::Current()) -pScModelObj = comphelper::getFromUnoTunnel(pCurrentSh->GetModel()); +ScModelObj* pScModelObj = comphelper::getFromUnoTunnel(pCurrentSh->GetModel()); SfxLokHelper::notifyViewRenderState(pViewShell, pScModelObj); // In Online, the document color is the one used for the background, contrary to // Writer and Draw that use the application background color.
core.git: sc/source
sc/source/ui/app/transobj.cxx | 31 +-- 1 file changed, 29 insertions(+), 2 deletions(-) New commits: commit 8d9f54165d28d83092667b7bfcd0ee48ade54c87 Author: Patrick Luby AuthorDate: Sat May 4 19:58:03 2024 -0400 Commit: Patrick Luby CommitDate: Mon May 6 19:15:21 2024 +0200 tdf#160855 fix crash due to Skia's internal maximum pixel limit Somewhere in the tens of thousands of selected fill cells, the size of the VirtualDevice exceeds 1 GB of pixels. But Skia, at least on macOS, will fail to create a surface. Even if there is ample free memory, Skia/Raster will fail. The second problem is that even if you disable Skia, the crash is just delayed when a BitmapEx is created from the VirtualDevice and malloc() fails. Since this data flavor really triggers one or more system memory limits, lower the resolution of the bitmap by keeping the VirtualDevice pixel size within an arbitrary number of pixels. Note: the artibrary "maximum number of pixels" limit that that Skia can handle may need to be raised or lowered for platforms other than macOS. Change-Id: Ie087f2db152470aa70521fbe5fe6c7cedd8504af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167145 Reviewed-by: Noel Grandin Tested-by: Jenkins Reviewed-by: Patrick Luby diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx index b42154945e89..f242abc497b0 100644 --- a/sc/source/ui/app/transobj.cxx +++ b/sc/source/ui/app/transobj.cxx @@ -405,11 +405,38 @@ bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor, const OUSt aReducedBlock.aEnd.Col(), aReducedBlock.aEnd.Row(), aReducedBlock.aStart.Tab() ); ScopedVclPtrInstance< VirtualDevice > pVirtDev; - pVirtDev->SetOutputSizePixel(pVirtDev->LogicToPixel(aMMRect.GetSize(), MapMode(MapUnit::Map100thMM))); + +// tdf#160855 fix crash due to Skia's internal maximum pixel limit +// Somewhere in the tens of thousands of selected fill cells, +// the size of the VirtualDevice exceeds 1 GB of pixels. But +// Skia, at least on macOS, will fail to create a surface. +// Even if there is ample free memory, Skia/Raster will fail. +// The second problem is that even if you disable Skia, the +// crash is just delayed when a BitmapEx is created from the +// VirtualDevice and malloc() fails. +// Since this data flavor really triggers one or more system +// memory limits, lower the resolution of the bitmap by keeping +// the VirtualDevice pixel size within an arbitrary number of +// pixels. +// Note: the artibrary "maximum number of pixels" limit that +// that Skia can handle may need to be raised or lowered for +// platforms other than macOS. +static constexpr tools::Long nCopyToImageMaxPixels = 8192 * 8192; +Fraction aScale(1.0); +Size aPixelSize = pVirtDev->LogicToPixel(aMMRect.GetSize(), MapMode(MapUnit::Map100thMM)); +tools::Long nPixels(aPixelSize.Width() * aPixelSize.Height()); +if (nPixels < 0 || nPixels > nCopyToImageMaxPixels) +{ +aScale = Fraction(nCopyToImageMaxPixels, nPixels); +aPixelSize = pVirtDev->LogicToPixel(aMMRect.GetSize(), MapMode(MapUnit::Map100thMM, Point(), aScale, aScale)); +nPixels = aPixelSize.Width() * aPixelSize.Height(); +} + +pVirtDev->SetOutputSizePixel(aPixelSize); PaintToDev( pVirtDev, *m_pDoc, 1.0, aReducedBlock ); -pVirtDev->SetMapMode( MapMode( MapUnit::MapPixel ) ); +pVirtDev->SetMapMode( MapMode( MapUnit::MapPixel, Point(), aScale, aScale ) ); BitmapEx aBmp = pVirtDev->GetBitmapEx( Point(), pVirtDev->GetOutputSize() ); bOK = SetBitmapEx( aBmp, rFlavor ); }
core.git: sc/source
sc/source/ui/app/inputhdl.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 864d0f0d8da33f6f5c0a99ae54a52c0172449901 Author: Caolán McNamara AuthorDate: Sat May 4 21:20:04 2024 +0100 Commit: Caolán McNamara CommitDate: Sun May 5 12:38:48 2024 +0200 always check return of SfxViewShell::Current() Change-Id: If8f50536295a44a4a8cf692d758ca03e726902e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167143 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 d04d7fdab547..6dd8315e7b4e 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -1277,7 +1277,7 @@ void ScInputHandler::ShowArgumentsTip( OUString& rSelText ) } const SfxViewShell* pViewShell = SfxViewShell::Current(); -if (comphelper::LibreOfficeKit::isActive() && pViewShell->isLOKDesktop()) +if (comphelper::LibreOfficeKit::isActive() && pViewShell && pViewShell->isLOKDesktop()) { tools::JsonWriter writer; writer.put("type", "formulausage");
core.git: sc/source
sc/source/core/data/patattr.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 8a348300094dcf9d59f94caa75d32453c45c8ee0 Author: Caolán McNamara AuthorDate: Fri May 3 20:19:15 2024 +0100 Commit: Caolán McNamara CommitDate: Sat May 4 12:01:08 2024 +0200 cid#1596522 Inequality comparison against NULL Change-Id: Ib489137e8fa2a5745a41703a6d25f9c950223ab8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167102 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx index 42bb54937a45..c9cad8641bce 100644 --- a/sc/source/core/data/patattr.cxx +++ b/sc/source/core/data/patattr.cxx @@ -274,7 +274,7 @@ bool CellAttributeHelper::RegisteredAttrSetLess::operator()(const ScPatternAttr* return true; if (cmp > 0) return false; -return lhs < static_cast(nullptr); +return false; } bool CellAttributeHelper::RegisteredAttrSetLess::operator()(const OUString* lhs, const ScPatternAttr* rhs) const { @@ -283,7 +283,7 @@ bool CellAttributeHelper::RegisteredAttrSetLess::operator()(const OUString* lhs, return true; if (cmp > 0) return false; -return static_cast(nullptr) < rhs; +return true; }
core.git: sc/source
sc/source/ui/inc/gridwin.hxx |2 + sc/source/ui/view/gridwin4.cxx | 74 + sc/source/ui/view/tabview.cxx | 21 +++ 3 files changed, 62 insertions(+), 35 deletions(-) New commits: commit 09e135ab80fffc10950a16716111d66d9ed99f5f Author: Printf Debugging AuthorDate: Wed May 1 02:06:48 2024 +0530 Commit: Heiko Tietze CommitDate: Thu May 2 09:32:39 2024 +0200 tdf#160780 Overlays should not cover EditView. ScGridWindow::DrawContent(...) draws the spreadsheet elements. ScTabView::SetNewVisArea() is called after DrawContent(...) which calls UpdateAllOverlays(), and the overlays hide the EditView. Redrawing EditView in SetNewVisArea() fixes the issue. Change-Id: I768c8b7a1c9306fb94e82bca74ce0dcb2ced2782 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166784 Tested-by: Jenkins Reviewed-by: Heiko Tietze diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index 5c548e5af824..ac5c81700f20 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -206,6 +206,7 @@ class SAL_DLLPUBLIC_RTTI ScGridWindow : public vcl::DocWindow, public DropTarget sal_uInt16 nPaintCount; tools::Rectangle aRepaintPixel; +tools::Rectangle aEditRectangle; ScAddress aAutoMarkPos; ScAddress aListValPos; @@ -441,6 +442,7 @@ public: /// Draw content of the gridwindow; shared between the desktop and the tiled rendering. void DrawContent(OutputDevice , const ScTableInfo& rTableInfo, ScOutputData& aOutputData, bool bLogicText); +void DrawEditView(OutputDevice , EditView *pEditView); voidCreateAnchorHandle(SdrHdlList& rHdl, const ScAddress& rAddress); diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 896d44f5898b..4b03921e1287 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -659,6 +659,43 @@ Fraction GetZoom(const ScViewData& rViewData, int i) } } + +void ScGridWindow::DrawEditView(OutputDevice , EditView *pEditView) +{ +SCCOL nCol1 = mrViewData.GetEditStartCol(); +SCROW nRow1 = mrViewData.GetEditStartRow(); +SCCOL nCol2 = mrViewData.GetEditEndCol(); +SCROW nRow2 = mrViewData.GetEditEndRow(); + +rDevice.SetLineColor(); +rDevice.SetFillColor(pEditView->GetBackgroundColor()); +Point aStart = mrViewData.GetScrPos( nCol1, nRow1, eWhich ); +Point aEnd = mrViewData.GetScrPos( nCol2+1, nRow2+1, eWhich ); + +// don't overwrite grid +bool bLayoutRTL = mrViewData.GetDocument().IsLayoutRTL(mrViewData.GetTabNo()); +tools::Long nLayoutSign = bLayoutRTL ? -1 : 1; +aEnd.AdjustX( -(2 * nLayoutSign) ); +aEnd.AdjustY( -2 ); + +// set the correct mapmode +tools::Rectangle aBackground(aStart, aEnd); + +// paint the background +rDevice.SetMapMode(mrViewData.GetLogicMode()); + +tools::Rectangle aLogicRect(rDevice.PixelToLogic(aBackground)); +//tdf#100925, rhbz#1283420, Draw some text here, to get +//X11CairoTextRender::getCairoContext called, so that the forced read +//from the underlying X Drawable gets it to sync. +rDevice.DrawText(aLogicRect.BottomLeft(), " "); +rDevice.DrawRect(aLogicRect); + +// paint the editeng text +pEditView->Paint(rDevice.PixelToLogic(aEditRectangle), ); +rDevice.SetMapMode(MapMode(MapUnit::MapPixel)); +} + void ScGridWindow::DrawContent(OutputDevice , const ScTableInfo& rTableInfo, ScOutputData& aOutputData, bool bLogicText) { @@ -1290,42 +1327,9 @@ void ScGridWindow::DrawContent(OutputDevice , const ScTableInfo& rTableI // buffer and on top of everything. if (bInPlaceEditing && !bIsTiledRendering) { -// get the coordinates of the area we need to clear (overpaint by -// the background) -SCCOL nCol1 = mrViewData.GetEditStartCol(); -SCROW nRow1 = mrViewData.GetEditStartRow(); -SCCOL nCol2 = mrViewData.GetEditEndCol(); -SCROW nRow2 = mrViewData.GetEditEndRow(); -rDevice.SetLineColor(); -rDevice.SetFillColor(pEditView->GetBackgroundColor()); -Point aStart = mrViewData.GetScrPos( nCol1, nRow1, eWhich ); -Point aEnd = mrViewData.GetScrPos( nCol2+1, nRow2+1, eWhich ); - -// don't overwrite grid -tools::Long nLayoutSign = bLayoutRTL ? -1 : 1; -aEnd.AdjustX( -(2 * nLayoutSign) ); -aEnd.AdjustY( -2 ); - -// set the correct mapmode -tools::Rectangle aBackground(aStart, aEnd); - -// paint the background -rDevice.SetMapMode(mrViewData.GetLogicMode()); - -tools::Rectangle aLogicRect(rDevice.PixelToLogic(aBackground)); -//tdf#100925, rhbz#1283420, Draw some text here, to get -//X11CairoTextRender::getCairoContext called, so that the forced read -//from the underlying X Drawable gets it
core.git: sc/source
sc/source/ui/dbgui/scuiasciiopt.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 312740f1ef96ef6fe7e83d5fb1f5d2d4b2d2471c Author: Pranam Lashkari AuthorDate: Fri Apr 26 23:51:14 2024 +0100 Commit: Caolán McNamara CommitDate: Wed May 1 11:03:48 2024 +0200 LOK: hide cancel button in csv import dialog it did not make any sense to have cancel button in this dialog because it would not load file at all. user can still use close button in title bar to close dialog Change-Id: Id3ba3e4030553db18bdbd068d92b3395f4fb8c3d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166764 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos (cherry picked from commit 290d70a476bab7d100baa3568ec547633109033e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166835 (cherry picked from commit 7171c9e8f6fecedac29e89deaeb2afa4d67a2a17) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166844 Reviewed-by: Caolán McNamara Tested-by: Jenkins diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx index 6cb73c803c39..22f2867c3545 100644 --- a/sc/source/ui/dbgui/scuiasciiopt.cxx +++ b/sc/source/ui/dbgui/scuiasciiopt.cxx @@ -628,6 +628,9 @@ ScImportAsciiDlg::ScImportAsciiDlg(weld::Window* pParent, std::u16string_view aD mxCkbSkipEmptyCells->set_active(false); mxCkbSkipEmptyCells->hide(); } + +if (comphelper::LibreOfficeKit::isActive()) +m_xBuilder->weld_button("cancel")->hide(); m_xDialog->SetInstallLOKNotifierHdl(LINK(this, ScImportAsciiDlg, InstallLOKNotifierHdl)); }
core.git: sc/source
sc/source/ui/miscdlgs/inscldlg.cxx |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) New commits: commit 54404c2c20399a7349ad1abb9f37df3048c7aad1 Author: Caolán McNamara AuthorDate: Tue Apr 30 08:35:48 2024 +0100 Commit: Caolán McNamara CommitDate: Tue Apr 30 12:16:38 2024 +0200 cid#1596697 Dereference after null check Change-Id: I93c9401144fbe5a83ee461ff3fe4334326f6f05b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166886 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/sc/source/ui/miscdlgs/inscldlg.cxx b/sc/source/ui/miscdlgs/inscldlg.cxx index bfbfc0462936..cc9d60472e5c 100644 --- a/sc/source/ui/miscdlgs/inscldlg.cxx +++ b/sc/source/ui/miscdlgs/inscldlg.cxx @@ -95,8 +95,9 @@ ScInsertCellDlg::ScInsertCellDlg(weld::Window* pParent, bool bDisallowCellMove) } // if some cells are selected, then disable the SpinButtons -m_xNumberOfCols->set_sensitive(bColCount && !pViewData->GetMarkData().IsMarked()); -m_xNumberOfRows->set_sensitive(bRowsCount && !pViewData->GetMarkData().IsMarked()); +const bool bMarked = pViewData && pViewData->GetMarkData().IsMarked(); +m_xNumberOfCols->set_sensitive(bColCount && !bMarked); +m_xNumberOfRows->set_sensitive(bRowsCount && !bMarked); } ScInsertCellDlg::~ScInsertCellDlg() {}
core.git: sc/source
sc/source/ui/view/gridwin.cxx |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) New commits: commit 9e7d70230212ab95cda957a0fe51e37f7ca95021 Author: Heiko Tietze AuthorDate: Mon Apr 29 16:29:57 2024 +0200 Commit: Adolfo Jayme Barrientos CommitDate: Tue Apr 30 09:21:45 2024 +0200 Related tdf#143733 - Cell focus must not cover content This patch moves the cell focus rectangle outside the active cell, relative to the zoom factor Change-Id: I9df98125d5c0e571af841442d4db8f02d3c05487 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166870 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 1b7c16f1884b..2762929ccb9b 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -6589,11 +6589,15 @@ void ScGridWindow::UpdateCursorOverlay() tools::Long nSizeYPix; mrViewData.GetMergeSizePixel( nX, nY, nSizeXPix, nSizeYPix ); +const double nAdjustBorder(mrViewData.GetZoomX() * 3); +aScrPos.AdjustX(-nAdjustBorder); +aScrPos.AdjustY(-nAdjustBorder); + if (bLayoutRTL) aScrPos.AdjustX( -(nSizeXPix - 2) ); // move instead of mirroring // show the cursor as 4 (thin) rectangles -tools::Rectangle aRect(aScrPos, Size(nSizeXPix - 1, nSizeYPix - 1)); +tools::Rectangle aRect(aScrPos, Size(nSizeXPix + 2*nAdjustBorder, nSizeYPix + 2*nAdjustBorder)); float fScaleFactor = GetDPIScaleFactor();
core.git: sc/source
sc/source/filter/inc/addressconverter.hxx | 37 --- sc/source/filter/oox/addressconverter.cxx | 156 +- sc/source/filter/oox/scenariobuffer.cxx |3 sc/source/filter/oox/sheetdatacontext.cxx |3 4 files changed, 14 insertions(+), 185 deletions(-) New commits: commit a50b2d11ed6066a655278305f1fc880d3a5fe911 Author: Justin Luth AuthorDate: Wed Apr 24 14:23:22 2024 -0400 Commit: Miklos Vajna CommitDate: Tue Apr 30 08:48:11 2024 +0200 xlsx import: parse short-hand version of address Since I did this for the range, I might as well try to entirely remove parseOoxAddress2d. This allows me to remove parseOoxAddress2d. No point in having duplicate functions to turn a string into an ScAddress. [I assume this was a left-over from when this code was in /oox and didn't have access to sc methods.] Earlier patchsets checked that the new method and the old method returned the same values for all existing unit tests. Change-Id: Ic45eaf53417b0d8afad7b49959014162549653ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166606 Reviewed-by: Justin Luth Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sc/source/filter/inc/addressconverter.hxx b/sc/source/filter/inc/addressconverter.hxx index 034bcbacaf39..41fe38cd0efd 100644 --- a/sc/source/filter/inc/addressconverter.hxx +++ b/sc/source/filter/inc/addressconverter.hxx @@ -97,34 +97,6 @@ class AddressConverter final : public WorkbookHelper public: explicitAddressConverter( const WorkbookHelper& rHelper ); -/** Tries to parse the passed string for a 2d cell address in A1 notation. - -This function accepts all strings that match the regular expression -"[a-zA-Z]{1,6}0*[1-9][0-9]{0,8}" (without quotes), i.e. 1 to 6 letters -for the column index (translated to 0-based column indexes from 0 to -321,272,405), and 1 to 9 digits for the 1-based row index (translated -to 0-based row indexes from 0 to 999,999,998). The row number part may -contain leading zeros, they will be ignored. It is up to the caller to -handle cell addresses outside of a specific valid range (e.g. the -entire spreadsheet). - -@param ornColumn (out-parameter) Returns the converted column index. -@param ornRow (out-parameter) returns the converted row index. -@param rString The string containing the cell address. -@param nStart Start index of string part in rString to be parsed. -@param nLength Length of string part in rString to be parsed. - -@return true = Parsed string was valid, returned values can be used. - */ -static bool parseOoxAddress2d( -sal_Int32& ornColumn, sal_Int32& ornRow, -std::u16string_view aString, -sal_Int32 nStart = 0, -sal_Int32 nLength = SAL_MAX_INT32 ); - -static bool parseOoxAddress2d( -sal_Int32& ornColumn, sal_Int32& ornRow, std::string_view pStr ); - /** Returns the biggest valid cell address in the own Calc document. */ const ScAddress& getMaxApiAddress() const { return maMaxApiPos; } @@ -188,10 +160,7 @@ public: static boolconvertToCellAddressUnchecked( ScAddress& orAddress, const OUString& rString, -sal_Int16 nSheet ); - -static bool convertToCellAddressUnchecked( -ScAddress& orAddress, std::string_view pStr, sal_Int16 nSheet ); +sal_Int16 nSheet, const ScDocument& rDoc); /** Tries to convert the passed string to a single cell address. @@ -208,10 +177,6 @@ public: sal_Int16 nSheet, bool bTrackOverflow ); -bool convertToCellAddress( -ScAddress& rAddress, -std::string_view pStr, sal_Int16 nSheet, bool bTrackOverflow ); - /** Returns a valid cell address by moving it into allowed dimensions. @param rString Cell address string in A1 notation. diff --git a/sc/source/filter/oox/addressconverter.cxx b/sc/source/filter/oox/addressconverter.cxx index 4109ef3c8833..98a8dae3b625 100644 --- a/sc/source/filter/oox/addressconverter.cxx +++ b/sc/source/filter/oox/addressconverter.cxx @@ -80,123 +80,6 @@ AddressConverter::AddressConverter( const WorkbookHelper& rHelper ) : initializeMaxPos( OOX_MAXTAB, OOX_MAXCOL, OOX_MAXROW ); } -bool AddressConverter::parseOoxAddress2d( -sal_Int32& ornColumn, sal_Int32& ornRow, -std::u16string_view aString, sal_Int32 nStart, sal_Int32 nLength ) -{ -ornColumn = ornRow = 0; -if( (nStart < 0) || (nStart >= sal_Int32(aString.size())) || (nLength < 2) ) -return false; - -const sal_Unicode* pcChar = aString.data() +
core.git: sc/source
sc/source/core/data/column3.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit e3ce4aad47c052dcd67107f7c91336f4ecc949be Author: Miklos Vajna AuthorDate: Wed Apr 24 09:37:35 2024 +0200 Commit: Miklos Vajna CommitDate: Thu Apr 25 12:19:32 2024 +0200 sc: fix crash in ScColumn::SetEditText() Crashreport: > SIG Fatal signal received: SIGSEGV code: 128 for address: 0x0 > program/libsclo.so > ScColumn::SetEditText(int, std::unique_ptr >) > sc/source/core/data/column3.cxx:2362 > program/libsclo.so > ScTable::SetEditText(short, int, std::unique_ptr >) > /opt/rh/devtoolset-12/root/usr/include/c++/12/bits/unique_ptr.h:395 > program/libsclo.so > ScDocument::SetEditText(ScAddress const&, std::unique_ptr >) > /opt/rh/devtoolset-12/root/usr/include/c++/12/bits/unique_ptr.h:395 > program/libsclo.so > ScDocFunc::SetEditCell(ScAddress const&, EditTextObject const&, bool) > /opt/rh/devtoolset-12/root/usr/include/c++/12/bits/unique_ptr.h:395 > program/libsclo.so > (anonymous namespace)::finalizeFormulaProcessing(std::shared_ptr<(anonymous namespace)::FormulaProcessingContext>) > sc/source/ui/view/viewfunc.cxx:565 Change-Id: I331ca8784702fdcb0ebad6a0a73390dbe2615ece Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166612 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index e7a971e8c613..26fcd36de0ba 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -2356,6 +2356,11 @@ bool ScColumn::SetString( SCROW nRow, SCTAB nTabP, const OUString& rString, void ScColumn::SetEditText( SCROW nRow, std::unique_ptr pEditText ) { +if (!pEditText) +{ +return; +} + pEditText->NormalizeString(GetDoc().GetSharedStringPool()); std::vector aNewSharedRows; sc::CellStoreType::iterator it = GetPositionToInsert(nRow, aNewSharedRows, false);
core.git: sc/source
sc/source/filter/html/htmlpars.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit d5823f417248663d78072e2a0be162175def2235 Author: Caolán McNamara AuthorDate: Wed Apr 24 20:10:38 2024 +0100 Commit: Caolán McNamara CommitDate: Thu Apr 25 09:28:05 2024 +0200 ofz#68269 more fixes to sc html parser Change-Id: I2fd889c438d4707a4e174a5a4300e742cd895d3b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166607 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index cba641f5136f..6e87e67fe2af 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -689,7 +689,7 @@ void ScHTMLLayoutParser::Adjust() if ( pE->nCol != nColBeforeSkip ) { size_t nCount = maColOffset.size(); -if ( nCount <= o3tl::make_unsigned(pE->nCol) ) +if (pE->nCol < 0 || nCount <= o3tl::make_unsigned(pE->nCol)) { pE->nOffset = static_cast(maColOffset[nCount-1]); MakeCol( , pE->nOffset, pE->nWidth, nOffsetTolerance, nOffsetTolerance );
core.git: sc/source
sc/source/core/tool/token.cxx | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) New commits: commit 4ed26399e2c9a0d35a1f7e6f19f68a5bb0303109 Author: Justin Luth AuthorDate: Tue Apr 23 13:38:08 2024 -0400 Commit: Justin Luth CommitDate: Tue Apr 23 23:00:56 2024 +0200 NFC ScRawToken::CreateToken: ocPush uses the same function Ever since commit 87307aba9e8dbca16672e6df701d9f905b9e1786 Author: Jens-Heiner Rechtien on Thu Jan 8 10:47:13 2009 + CWS-TOOLING: integrate CWS frmdlg case svSingleRef : if (eOp == ocPush) return new ScSingleRefToken( aRef.Ref1 ); else -return new ScSingleRefOpToken( eOp, aRef.Ref1 ); +return new ScSingleRefToken( aRef.Ref1, eOp ); case svDoubleRef : if (eOp == ocPush) return new ScDoubleRefToken( aRef ); else -return new ScDoubleRefOpToken( eOp, aRef ); +return new ScDoubleRefToken( aRef, eOp ); Instead of using different functions, they now use the same function where optional eOp = ocPush [sc/inc/token.hxx]. Change-Id: I3ee0f308bd983c3edd54fdd064b957b63ca4c0d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166564 Tested-by: Jenkins Reviewed-by: Justin Luth diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 33e520723213..364913e4fa99 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -370,15 +370,9 @@ FormulaToken* ScRawToken::CreateToken(ScSheetLimits& rLimits) const return new FormulaStringOpToken(eOp, std::move(aSS)); } case svSingleRef : -if (eOp == ocPush) -return new ScSingleRefToken(rLimits, aRef.Ref1 ); -else -return new ScSingleRefToken(rLimits, aRef.Ref1, eOp ); +return new ScSingleRefToken(rLimits, aRef.Ref1, eOp); case svDoubleRef : -if (eOp == ocPush) -return new ScDoubleRefToken(rLimits, aRef ); -else -return new ScDoubleRefToken(rLimits, aRef, eOp ); +return new ScDoubleRefToken(rLimits, aRef, eOp); case svMatrix : IF_NOT_OPCODE_ERROR( ocPush, ScMatrixToken); return new ScMatrixToken( pMat );
core.git: sc/source
sc/source/ui/view/cellsh1.cxx | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) New commits: commit 695e8742da850bbb15c2e6d2b5d4c99a0daf4925 Author: Sahil Gautam AuthorDate: Sun Apr 21 23:24:50 2024 +0530 Commit: Stephan Bergmann CommitDate: Sun Apr 21 23:15:17 2024 +0200 tdf#80390 Use local copy in anonymous function. The nCount object might go out of scope, as it's used by an async function. https://gerrit.libreoffice.org/c/core/+/164316/comments/507b830b_001a71eb Change-Id: I4218f6e35b61704115047481cb97a193c593a072 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154750 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 69fbd1ead083..ae55a3312d25 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -352,7 +352,6 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) case FID_INS_CELL: { InsCellCmd eCmd=INS_NONE; -size_t nCount = 0; if ( pReqArgs ) { @@ -386,20 +385,21 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); VclPtr pDlg(pFact->CreateScInsertCellDlg(pTabViewShell->GetFrameWeld(), bTheFlag)); -pDlg->StartExecuteAsync([pDlg, pTabViewShell, ](sal_Int32 nResult){ +pDlg->StartExecuteAsync([pDlg, pTabViewShell](sal_Int32 nResult){ if (nResult == RET_OK) { SfxRequest aRequest(pTabViewShell->GetViewFrame(), FID_INS_CELL); InsCellCmd eTmpCmd = pDlg->GetInsCellCmd(); -nCount = pDlg->GetCount(); -InsertCells(pTabViewShell, aRequest, eTmpCmd, nCount); +size_t nInsCount = pDlg->GetCount(); +InsertCells(pTabViewShell, aRequest, eTmpCmd, nInsCount); } pDlg->disposeOnce(); }); +break; } } -InsertCells(pTabViewShell, rReq, eCmd, nCount); +InsertCells(pTabViewShell, rReq, eCmd); } break;
core.git: sc/source
sc/source/core/data/PivotTableFormatOutput.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit c81fe7f7e4b416f818d7dfd8e141bccebce37a16 Author: Caolán McNamara AuthorDate: Sat Apr 20 21:25:27 2024 +0100 Commit: Caolán McNamara CommitDate: Sun Apr 21 14:51:28 2024 +0200 crashtesting: crash seen on import of forum-mso-en4-602306.xlsx Change-Id: Ib8bd453483c72382330b4c960cdbe735bdb97eac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166374 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sc/source/core/data/PivotTableFormatOutput.cxx b/sc/source/core/data/PivotTableFormatOutput.cxx index 575fd5e77508..83bf865573a4 100644 --- a/sc/source/core/data/PivotTableFormatOutput.cxx +++ b/sc/source/core/data/PivotTableFormatOutput.cxx @@ -98,7 +98,7 @@ void initFormatOutputField(size_t nSelectionIndex, std::vector 1) +if (rSelection.nIndices.size() > nSelectionIndex) rOutputField.nIndex = rSelection.nIndices[nSelectionIndex]; else rOutputField.nIndex = rSelection.nIndices[0];
core.git: sc/source
sc/source/filter/html/htmlpars.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit 57f4581e326453ebed8fe688ade924804aae46dd Author: Caolán McNamara AuthorDate: Fri Apr 19 17:20:25 2024 +0100 Commit: Caolán McNamara CommitDate: Sat Apr 20 17:09:51 2024 +0200 ofz#68081 Use-of-uninitialized-value Change-Id: If632bd8d503f5e8c9acdab912ac0bc8a00dfd534 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166308 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index a09adb8c46eb..cba641f5136f 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -437,7 +437,9 @@ bool ScHTMLLayoutParser::SeekOffset( const ScHTMLColOffset* pOffset, sal_uInt16 OSL_ENSURE( pOffset, "ScHTMLLayoutParser::SeekOffset - illegal call" ); ScHTMLColOffset::const_iterator it = pOffset->find( nOffset ); bool bFound = it != pOffset->end(); -sal_uInt16 nPos = it - pOffset->begin(); +size_t nPos = it - pOffset->begin(); +if (nPos > o3tl::make_unsigned(std::numeric_limits::max())) +return false; *pCol = static_cast(nPos); if ( bFound ) return true;
core.git: sc/source
sc/source/filter/excel/excrecds.cxx |5 - 1 file changed, 4 insertions(+), 1 deletion(-) New commits: commit 78bd5e2523d077a67468b752d4788a2c3b43fb5f Author: Justin Luth AuthorDate: Thu Apr 18 14:46:30 2024 -0400 Commit: Miklos Vajna CommitDate: Fri Apr 19 14:21:13 2024 +0200 xlsx export: fix corrupt file for Excel: protectedRange must have sqref Excel refuses to open a file if there is no sqref specified In this case, import failed to import sqref="10:131". A follow-up commit avoids exporting these shorthand ranges. I don't see much point in trying to create a unit test for this. (I assume protectedRange is simply round-tripped because I doubt LO has working support for protectedRanges.) commit 9cee6a45632623d3d7e5a574128940f96d8c926b Author: Eike Rathke on Thu Mar 20 10:16:50 2014 +0100 added ScEnhancedProtection to ScTableProtection Change-Id: I97ef1ee801898bdcace067d62890c4ce0e7cf1d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166265 Reviewed-by: Justin Luth Reviewed-by: Miklos Vajna Tested-by: Justin Luth diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx index 86afa5a6c163..f18e9f829bbe 100644 --- a/sc/source/filter/excel/excrecds.cxx +++ b/sc/source/filter/excel/excrecds.cxx @@ -478,6 +478,9 @@ void XclExpSheetProtection::SaveXml( XclExpXmlStream& rStrm ) rWorksheet->startElement(XML_protectedRanges); for (const auto& rProt : rProts) { +if (!rProt.maRangeList.is()) +continue; // Excel refuses to open if sqref is missing from a protectedRange + SAL_WARN_IF( rProt.maSecurityDescriptorXML.isEmpty() && !rProt.maSecurityDescriptor.empty(), "sc.filter", "XclExpSheetProtection::SaveXml: losing BIFF security descriptor"); rWorksheet->singleElement( XML_protectedRange, @@ -492,7 +495,7 @@ void XclExpSheetProtection::SaveXml( XclExpXmlStream& rStrm ) XML_hashValue, sax_fastparser::UseIf(rProt.maPasswordHash.maHashValue, !rProt.maPasswordHash.maHashValue.isEmpty()), XML_saltValue, sax_fastparser::UseIf(rProt.maPasswordHash.maSaltValue, !rProt.maPasswordHash.maSaltValue.isEmpty()), XML_spinCount, sax_fastparser::UseIf(OString::number(rProt.maPasswordHash.mnSpinCount), rProt.maPasswordHash.mnSpinCount != 0), -XML_sqref, rProt.maRangeList.is() ? XclXmlUtils::ToOString( rStrm.GetRoot().GetDoc(), *rProt.maRangeList).getStr() : nullptr); +XML_sqref, XclXmlUtils::ToOString(rStrm.GetRoot().GetDoc(), *rProt.maRangeList).getStr()); } rWorksheet->endElement( XML_protectedRanges); }
core.git: sc/source
sc/source/filter/inc/extlstcontext.hxx|2 +- sc/source/filter/oox/condformatbuffer.cxx |2 +- sc/source/filter/oox/extlstcontext.cxx|8 3 files changed, 6 insertions(+), 6 deletions(-) New commits: commit 2f3b47ec80235318c4d9f843b2ef52e01611fa5c Author: Noel Grandin AuthorDate: Thu Apr 18 10:52:21 2024 +0200 Commit: Noel Grandin CommitDate: Fri Apr 19 10:16:19 2024 +0200 rename rStyleIdx -> gnStyleIdx to make it obvious we are dealing with nasty global state here Change-Id: I7f2193600a6459c3a5cd51fece8151ac46aebe7e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166242 Tested-by: Noel Grandin Reviewed-by: Noel Grandin diff --git a/sc/source/filter/inc/extlstcontext.hxx b/sc/source/filter/inc/extlstcontext.hxx index 077ebdbebf8e..c8c3f5ddb355 100644 --- a/sc/source/filter/inc/extlstcontext.hxx +++ b/sc/source/filter/inc/extlstcontext.hxx @@ -16,7 +16,7 @@ #include #include -extern sal_Int32 rStyleIdx; // Holds index of the style (Will be reset by finalize import) +extern sal_Int32 gnStyleIdx; // Holds index of the style (Will be reset by finalize import) struct ScDataBarFormatData; namespace oox { class AttributeList; } diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx index d1ee97ca70ac..2b212352eaa7 100644 --- a/sc/source/filter/oox/condformatbuffer.cxx +++ b/sc/source/filter/oox/condformatbuffer.cxx @@ -1354,7 +1354,7 @@ void CondFormatBuffer::finalizeImport() ++nExtCFIndex; } -rStyleIdx = 0; // Resets style index. +gnStyleIdx = 0; // Resets style index. } CondFormatRef CondFormatBuffer::importCondFormatting( SequenceInputStream& rStrm ) diff --git a/sc/source/filter/oox/extlstcontext.cxx b/sc/source/filter/oox/extlstcontext.cxx index d6af04240572..9e542b744b7f 100644 --- a/sc/source/filter/oox/extlstcontext.cxx +++ b/sc/source/filter/oox/extlstcontext.cxx @@ -30,7 +30,7 @@ using ::oox::core::ContextHandlerRef; using ::oox::xls::CondFormatBuffer; -sal_Int32 rStyleIdx = 0; +sal_Int32 gnStyleIdx = 0; // Holds index of the style (Will be reset by finalize import) namespace oox::xls { @@ -292,10 +292,10 @@ void ExtConditionalFormattingContext::onEndElement() maModel.eOperator = ScConditionMode::Direct; } -if (Dxf* pDxf = getStyles().getExtDxfs().get(rStyleIdx).get()) +if (Dxf* pDxf = getStyles().getExtDxfs().get(gnStyleIdx).get()) pDxf->finalizeImport(); -maModel.aStyle = getStyles().createExtDxfStyle(rStyleIdx); -rStyleIdx++; +maModel.aStyle = getStyles().createExtDxfStyle(gnStyleIdx); +gnStyleIdx++; nFormulaCount = 0; maModels.push_back(maModel); }
core.git: sc/source
sc/source/core/data/PivotTableFormatOutput.cxx | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) New commits: commit fba7ac09846099932c14fe78fb01a1b762b7 Author: Caolán McNamara AuthorDate: Thu Apr 18 09:38:07 2024 +0100 Commit: Caolán McNamara CommitDate: Thu Apr 18 20:24:51 2024 +0200 crashtesting: crash on export of forum-mso-en4-470772.xlsx to xlsx similar fix as: commit 1d5630c5deeec5dca724c29ec8c886bfa71a2099 Date: Tue Apr 16 15:21:49 2024 +0900 pivot: add checks that prevent reading out of vector bounds Change-Id: I190da7586cff9c7e8dd4011ad61e68abba6ecd53 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166240 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sc/source/core/data/PivotTableFormatOutput.cxx b/sc/source/core/data/PivotTableFormatOutput.cxx index cdd2ac90914f..575fd5e77508 100644 --- a/sc/source/core/data/PivotTableFormatOutput.cxx +++ b/sc/source/core/data/PivotTableFormatOutput.cxx @@ -58,16 +58,13 @@ public: { std::vector aNames; fillNamesForDimension(aNames, nDimension); -maNameCache.emplace(nDimension, aNames); -return aNames[nIndex]; -} -else -{ -std::vector& rNames = iterator->second; -if (nIndex >= rNames.size()) -return OUString(); -return rNames[nIndex]; +iterator = maNameCache.emplace(nDimension, aNames).first; } + +const std::vector& rNames = iterator->second; +if (nIndex >= rNames.size()) +return OUString(); +return rNames[nIndex]; } };
core.git: sc/source
sc/source/filter/excel/xicontent.cxx |2 +- sc/source/filter/ftools/ftools.cxx|9 +++-- sc/source/filter/inc/ftools.hxx |7 +++ sc/source/filter/oox/stylesbuffer.cxx |4 ++-- 4 files changed, 13 insertions(+), 9 deletions(-) New commits: commit e1268721d4266ed1254da99581a7c2c3dfb72ba6 Author: Noel Grandin AuthorDate: Thu Apr 18 10:50:38 2024 +0200 Commit: Noel Grandin CommitDate: Thu Apr 18 15:42:01 2024 +0200 tdf#160706 speed up loading conditional formatting rule in XLS (3) the comment when calling MakeCellStyleSheet does not match the implementation, so make the implementation match the comment. i.e. if there is an existing stylesheet with that name, just return it. Reduces load time for me from 47s to 33s Change-Id: If1bd08baf8515933b87c075d9eef04bc0a125357 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166241 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx index a2862f7b6988..8701b3c69204 100644 --- a/sc/source/filter/excel/xicontent.cxx +++ b/sc/source/filter/excel/xicontent.cxx @@ -576,7 +576,7 @@ void XclImpCondFormat::ReadCF( XclImpStream& rStrm ) // *** create style sheet *** OUString aStyleName( XclTools::GetCondFormatStyleName( GetCurrScTab(), mnFormatIndex, mnCondIndex ) ); -SfxItemSet& rStyleItemSet = ScfTools::MakeCellStyleSheet( GetStyleSheetPool(), aStyleName, true ).GetItemSet(); +SfxItemSet& rStyleItemSet = ScfTools::MakeCellStyleSheet( GetStyleSheetPool(), aStyleName ).GetItemSet(); const XclImpPalette& rPalette = GetPalette(); diff --git a/sc/source/filter/ftools/ftools.cxx b/sc/source/filter/ftools/ftools.cxx index bf2b784a994b..1ce82e5dd1d8 100644 --- a/sc/source/filter/ftools/ftools.cxx +++ b/sc/source/filter/ftools/ftools.cxx @@ -254,9 +254,14 @@ ScStyleSheet& lclMakeStyleSheet( ScStyleSheetPool& rPool, const OUString& rStyle } // namespace -ScStyleSheet& ScfTools::MakeCellStyleSheet( ScStyleSheetPool& rPool, const OUString& rStyleName, bool bForceName ) +ScStyleSheet& ScfTools::MakeCellStyleSheet( ScStyleSheetPool& rPool, const OUString& rStyleName ) { -return lclMakeStyleSheet( rPool, rStyleName, SfxStyleFamily::Para, bForceName ); +SfxStyleSheetBase* pOldStyleSheet = rPool.Find( rStyleName, SfxStyleFamily::Para ); +if( pOldStyleSheet ) +return static_cast< ScStyleSheet& >(*pOldStyleSheet); + +// create new style sheet +return static_cast< ScStyleSheet& >( rPool.Make( rStyleName, SfxStyleFamily::Para, SfxStyleSearchBits::UserDefined ) ); } ScStyleSheet& ScfTools::MakePageStyleSheet( ScStyleSheetPool& rPool, const OUString& rStyleName, bool bForceName ) diff --git a/sc/source/filter/inc/ftools.hxx b/sc/source/filter/inc/ftools.hxx index 7e8a07bce8c8..0fdb90cc26ae 100644 --- a/sc/source/filter/inc/ftools.hxx +++ b/sc/source/filter/inc/ftools.hxx @@ -193,12 +193,11 @@ public: // *** style sheet handling *** --- /** Creates and returns a cell style sheet and inserts it into the pool. -@descr If the style sheet is already in the pool, another unused style name is used. -@param bForceName Controls behaviour, if the style already exists: -true = Old existing style will be renamed; false = New style gets another name. */ +@descr If the style sheet is already in the pool, return the existing style. +*/ static ScStyleSheet& MakeCellStyleSheet( ScStyleSheetPool& rPool, -const OUString& rStyleName, bool bForceName ); +const OUString& rStyleName ); /** Creates and returns a page style sheet and inserts it into the pool. @descr If the style sheet is already in the pool, another unused style name is used. @param bForceName Controls behaviour, if the style already exists: diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx index 234d0365bdec..76245a6980a3 100644 --- a/sc/source/filter/oox/stylesbuffer.cxx +++ b/sc/source/filter/oox/stylesbuffer.cxx @@ -3005,7 +3005,7 @@ OUString StylesBuffer::createDxfStyle( sal_Int32 nDxfId ) const // Create a cell style. This may overwrite an existing style if // one with the same name exists. ScStyleSheet& rStyleSheet = ScfTools::MakeCellStyleSheet( -*getScDocument().GetStyleSheetPool(), rStyleName, true); +*getScDocument().GetStyleSheetPool(), rStyleName); rStyleSheet.ResetParent(); SfxItemSet& rStyleItemSet = @@ -3033,7 +3033,7 @@ OUString StylesBuffer::createExtDxfStyle( sal_Int32 nDxfId ) const // Create a cell style. This may overwrite an existing style if // one with the same name exists. ScStyleSheet& rStyleSheet =
core.git: sc/source
sc/source/core/tool/formularesult.cxx |7 +++ sc/source/core/tool/interpr4.cxx |1 + 2 files changed, 8 insertions(+) New commits: commit 42c235fe8a616afea4c838901f73c52a262b1337 Author: Caolán McNamara AuthorDate: Thu Apr 18 09:23:39 2024 +0100 Commit: Caolán McNamara CommitDate: Thu Apr 18 14:40:21 2024 +0200 Related: tdf#160056 use simple ref count for temp double tokens Change-Id: I268a20fb4f87c62f2344f1b518a3a79ac3e8b55e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166232 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sc/source/core/tool/formularesult.cxx b/sc/source/core/tool/formularesult.cxx index 08ef363ff68f..234c17780b4e 100644 --- a/sc/source/core/tool/formularesult.cxx +++ b/sc/source/core/tool/formularesult.cxx @@ -661,6 +661,13 @@ void ScFormulaResult::HandleStuffAfterParallelCalculation() mpToken->IncRef(); mbNoneRefCnt = false; } +// If ScInterpreter::CreateFormulaDoubleToken tokens make it into a result +if (mbToken && mpToken) +{ +// temp check to look for this +assert(mpToken->GetRefCntPolicy() == formula::RefCntPolicy::ThreadSafe); + const_cast(mpToken)->SetRefCntPolicy(formula::RefCntPolicy::ThreadSafe); +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index 27f2211b9f30..782d1a952b8c 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -1783,6 +1783,7 @@ formula::FormulaToken* ScInterpreter::CreateFormulaDoubleToken( double fVal, SvN // Allocate a new token auto p = new FormulaTypedDoubleToken( fVal, static_cast(nFmt) ); +p->SetRefCntPolicy(RefCntPolicy::UnsafeRef); if ( mrContext.maTokens[mrContext.mnTokenCachePos] ) mrContext.maTokens[mrContext.mnTokenCachePos]->DecRef(); mrContext.maTokens[mrContext.mnTokenCachePos] = p;
core.git: sc/source
sc/source/filter/oox/extlstcontext.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit dac30c44c606232ce23d52a423d0bf8010f25d4f Author: Noel Grandin AuthorDate: Wed Apr 17 14:06:57 2024 +0200 Commit: Noel Grandin CommitDate: Wed Apr 17 19:40:22 2024 +0200 tdf#160706 speed up loading conditional formatting rule in XLS we only need to finalizeImport on the last ExtDxf we loaded, otherwise we end up with an O(n^2) performance problem Change-Id: I566ef43189a1bb7ac7c55e1bccf9445c9cea19b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166179 Tested-by: Noel Grandin Reviewed-by: Noel Grandin diff --git a/sc/source/filter/oox/extlstcontext.cxx b/sc/source/filter/oox/extlstcontext.cxx index 58e4c7931729..d6af04240572 100644 --- a/sc/source/filter/oox/extlstcontext.cxx +++ b/sc/source/filter/oox/extlstcontext.cxx @@ -292,7 +292,8 @@ void ExtConditionalFormattingContext::onEndElement() maModel.eOperator = ScConditionMode::Direct; } -getStyles().getExtDxfs().forEachMem( ::finalizeImport ); +if (Dxf* pDxf = getStyles().getExtDxfs().get(rStyleIdx).get()) +pDxf->finalizeImport(); maModel.aStyle = getStyles().createExtDxfStyle(rStyleIdx); rStyleIdx++; nFormulaCount = 0;
core.git: sc/source
sc/source/ui/docshell/impex.cxx |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit 47187acee758680cda8086b6e295ef7beea3491b Author: Laurent Balland AuthorDate: Mon Apr 15 18:43:35 2024 +0200 Commit: Eike Rathke CommitDate: Wed Apr 17 13:05:52 2024 +0200 tdf#129701 Follow-up of previous change According to comments in https://gerrit.libreoffice.org/c/core/+/163536 Follow-up of previous change Change-Id: Icd7b6798d6ef35ca9574125cd3d4c4d89044569c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166133 Tested-by: Jenkins Reviewed-by: Eike Rathke diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index 248c837b6dd1..80b4a2b96701 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -1592,7 +1592,7 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm ) ScDocumentImport aDocImport(rDoc); do { -SCCOL nLastCol = nEndCol; // tdf#129701 preserve value of nEndCol +const SCCOL nLastCol = nEndCol; // tdf#129701 preserve value of nEndCol for( ;; ) { aLine = ReadCsvLine(rStrm, !bFixed, aSeps, cStr, cDetectSep); @@ -1714,15 +1714,15 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm ) aTransliteration, aCalendar, pEnglishTransliteration.get(), pEnglishCalendar.get()); } +++nCol; if (bIsLastColEmpty) { bIsLastColEmpty = false; // toggle to stop } else { -++nCol; // tdf#129701 detect if there is a last empty column when we need it -bIsLastColEmpty = !(*p) && !bSkipEmptyCells && !bDetermineRange && nCol == nLastCol; +bIsLastColEmpty = (nCol == nLastCol) && !(*p) && !bSkipEmptyCells && !bDetermineRange; } }
core.git: sc/source
sc/source/ui/view/output3.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 0340a52ef0b9da9861f912c56550e685621a59f1 Author: Andrea Gelmini AuthorDate: Tue Apr 16 23:08:33 2024 +0200 Commit: Taichi Haradaguchi <20001...@ymail.ne.jp> CommitDate: Wed Apr 17 06:11:36 2024 +0200 Fix typo Change-Id: Idee34a2b522f69a0fcea9595c62b68f74628c299 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166164 Tested-by: Jenkins Reviewed-by: Taichi Haradaguchi <20001...@ymail.ne.jp> diff --git a/sc/source/ui/view/output3.cxx b/sc/source/ui/view/output3.cxx index 760a62a12d1d..a54718076857 100644 --- a/sc/source/ui/view/output3.cxx +++ b/sc/source/ui/view/output3.cxx @@ -207,7 +207,7 @@ void ScOutputData::DrawSelectiveObjects(SdrLayerID nLayer) if(pPageView) { // tdf#160589 need to check for registered PaintWindow using the -// 'original' TragetDevice, mpDev might have been changed by a +// 'original' TargetDevice, mpDev might have been changed by a // call to ::SetContentDevice. That again might patch in a // pre-render device fetched from SdrPaintWindow::GetTargetOutputDevice // and thus the test if target is aregistered PageWindow would fail
core.git: sc/source
sc/source/ui/inc/output.hxx |1 + sc/source/ui/view/output.cxx |1 + sc/source/ui/view/output3.cxx |8 +++- 3 files changed, 9 insertions(+), 1 deletion(-) New commits: commit 1e1a3825d76ed8071424e8e21bbda23464c10fff Author: Armin Le Grand (allotropia) AuthorDate: Tue Apr 16 16:26:07 2024 +0200 Commit: Armin Le Grand CommitDate: Tue Apr 16 18:12:25 2024 +0200 tdf#160589: compare the correct OutDev with PageWindows Change-Id: I29d9c60cac04536bb2d5ad2ed1c086c8e67a9f20 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166151 Tested-by: Jenkins Reviewed-by: Armin Le Grand diff --git a/sc/source/ui/inc/output.hxx b/sc/source/ui/inc/output.hxx index b94fbb1ec7ac..e19bc6f58100 100644 --- a/sc/source/ui/inc/output.hxx +++ b/sc/source/ui/inc/output.hxx @@ -187,6 +187,7 @@ private: void adjustForHyperlinkInPDF(Point aURLStart, const OutputDevice* pDev); }; +VclPtr mpOriginalTargetDevice; // 'unpatched' TargetDevice VclPtr mpDev;// Device VclPtr mpRefDevice; // printer if used for preview VclPtr pFmtDevice; // reference for text formatting diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index bf02db1fd32f..797f58ba4712 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -142,6 +142,7 @@ ScOutputData::ScOutputData( OutputDevice* pNewDev, ScOutputType eNewType, SCCOL nNewX1, SCROW nNewY1, SCCOL nNewX2, SCROW nNewY2, double nPixelPerTwipsX, double nPixelPerTwipsY, const Fraction* pZoomX, const Fraction* pZoomY ) : +mpOriginalTargetDevice( pNewDev ), mpDev( pNewDev ), mpRefDevice( pNewDev ), // default is output device pFmtDevice( pNewDev ), // default is output device diff --git a/sc/source/ui/view/output3.cxx b/sc/source/ui/view/output3.cxx index bc6efec65400..760a62a12d1d 100644 --- a/sc/source/ui/view/output3.cxx +++ b/sc/source/ui/view/output3.cxx @@ -206,7 +206,13 @@ void ScOutputData::DrawSelectiveObjects(SdrLayerID nLayer) if(pPageView) { -if (nullptr != pPageView->FindPageWindow(*mpDev)) +// tdf#160589 need to check for registered PaintWindow using the +// 'original' TragetDevice, mpDev might have been changed by a +// call to ::SetContentDevice. That again might patch in a +// pre-render device fetched from SdrPaintWindow::GetTargetOutputDevice +// and thus the test if target is aregistered PageWindow would fail +assert(nullptr != mpOriginalTargetDevice && "mpOriginalTargetDevice *must* be set when constructing ScOutputData (!)"); +if (nullptr != pPageView->FindPageWindow(*mpOriginalTargetDevice)) { // Target OutputDevice is registered for this view // (as it should be), we can just render
core.git: sc/source
sc/source/core/data/PivotTableFormatOutput.cxx |8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) New commits: commit 1d5630c5deeec5dca724c29ec8c886bfa71a2099 Author: Tomaž Vajngerl AuthorDate: Tue Apr 16 15:21:49 2024 +0900 Commit: Tomaž Vajngerl CommitDate: Tue Apr 16 14:37:43 2024 +0200 pivot: add checks that prevent reading out of vector bounds MSO likes to keep formats in the document even when the pivot table has been changed, so there might be references that contain indices values that are pointing out of bounds for the current pivot table result data. To prevent crashing the checks are added to prevent using an index that is out of vector bounds. Change-Id: I3824c787659d4e3817a5eb64fe2c8761ef00b610 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166138 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/sc/source/core/data/PivotTableFormatOutput.cxx b/sc/source/core/data/PivotTableFormatOutput.cxx index fbef219b513b..cdd2ac90914f 100644 --- a/sc/source/core/data/PivotTableFormatOutput.cxx +++ b/sc/source/core/data/PivotTableFormatOutput.cxx @@ -64,6 +64,8 @@ public: else { std::vector& rNames = iterator->second; +if (nIndex >= rNames.size()) +return OUString(); return rNames[nIndex]; } } @@ -97,7 +99,7 @@ void initFormatOutputField(size_t nSelectionIndex, std::vector 1) rOutputField.nIndex = rSelection.nIndices[nSelectionIndex]; @@ -107,8 +109,8 @@ void initFormatOutputField(size_t nSelectionIndex, std::vector
core.git: sc/source
sc/source/ui/unoobj/cellvaluebinding.cxx | 96 --- sc/source/ui/unoobj/cellvaluebinding.hxx | 28 - 2 files changed, 66 insertions(+), 58 deletions(-) New commits: commit a4d6700423aeb3f7cbcb3f23352dd05033353fe3 Author: Noel Grandin AuthorDate: Fri Apr 5 11:35:48 2024 +0200 Commit: Noel Grandin CommitDate: Mon Apr 15 10:35:28 2024 +0200 convert OCellValueBinding to comphelper::WeakComponentImplHelper (II) second attempt at landing this Change-Id: I1dd3597b0047131c99b3ec81a3cb5eabf9bf8a12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165865 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sc/source/ui/unoobj/cellvaluebinding.cxx b/sc/source/ui/unoobj/cellvaluebinding.cxx index fd8b43f9578e..d1fa61175557 100644 --- a/sc/source/ui/unoobj/cellvaluebinding.cxx +++ b/sc/source/ui/unoobj/cellvaluebinding.cxx @@ -54,10 +54,7 @@ namespace calc using namespace ::com::sun::star::form::binding; OCellValueBinding::OCellValueBinding( const Reference< XSpreadsheetDocument >& _rxDocument, bool _bListPos ) -:OCellValueBinding_Base( m_aMutex ) -,OCellValueBinding_PBase( OCellValueBinding_Base::rBHelper ) -,m_xDocument( _rxDocument ) -,m_aModifyListeners( m_aMutex ) +:m_xDocument( _rxDocument ) ,m_bInitialized( false ) ,m_bListPos( _bListPos ) { @@ -76,7 +73,7 @@ namespace calc OCellValueBinding::~OCellValueBinding( ) { -if ( !OCellValueBinding_Base::rBHelper.bDisposed ) +if ( !m_bDisposed ) { acquire(); // prevent duplicate dtor dispose(); @@ -87,7 +84,7 @@ namespace calc IMPLEMENT_FORWARD_XTYPEPROVIDER2( OCellValueBinding, OCellValueBinding_Base, OCellValueBinding_PBase ) -void SAL_CALL OCellValueBinding::disposing() +void OCellValueBinding::disposing( std::unique_lock& rGuard ) { Reference xBroadcaster( m_xCell, UNO_QUERY ); if ( xBroadcaster.is() ) @@ -95,7 +92,7 @@ namespace calc xBroadcaster->removeModifyListener( this ); } -WeakComponentImplHelperBase::disposing(); +WeakComponentImplHelperBase::disposing(rGuard); // TODO: clean up here whatever you need to clean up (e.g. deregister as XEventListener // for the cell) @@ -106,7 +103,7 @@ namespace calc return createPropertySetInfo( getInfoHelper() ) ; } -::cppu::IPropertyArrayHelper& SAL_CALL OCellValueBinding::getInfoHelper() +::cppu::IPropertyArrayHelper& OCellValueBinding::getInfoHelper() { return *OCellValueBinding_PABase::getArrayHelper(); } @@ -118,7 +115,7 @@ namespace calc return new ::cppu::OPropertyArrayHelper(aProps); } -void SAL_CALL OCellValueBinding::getFastPropertyValue( Any& _rValue, sal_Int32 _nHandle ) const +void OCellValueBinding::getFastPropertyValue( std::unique_lock& /*rGuard*/, Any& _rValue, sal_Int32 _nHandle ) const { OSL_ENSURE( _nHandle == PROP_HANDLE_BOUND_CELL, "OCellValueBinding::getFastPropertyValue: invalid handle!" ); // we only have this one property... @@ -131,9 +128,14 @@ namespace calc Sequence< Type > SAL_CALL OCellValueBinding::getSupportedValueTypes( ) { -checkDisposed( ); +std::unique_lock aGuard(m_aMutex); +throwIfDisposed(aGuard); checkInitialized( ); +return getSupportedValueTypes(aGuard); +} +Sequence< Type > OCellValueBinding::getSupportedValueTypes( std::unique_lock& /*rGuard*/ ) const +{ sal_Int32 nCount = m_xCellText.is() ? 3 : m_xCell.is() ? 1 : 0; if ( m_bListPos ) ++nCount; @@ -163,11 +165,16 @@ namespace calc sal_Bool SAL_CALL OCellValueBinding::supportsType( const Type& aType ) { -checkDisposed( ); +std::unique_lock aGuard(m_aMutex); +throwIfDisposed(aGuard); checkInitialized( ); +return supportsType(aGuard, aType); +} +bool OCellValueBinding::supportsType( std::unique_lock& rGuard, const Type& aType ) const +{ // look up in our sequence -const Sequence< Type > aSupportedTypes( getSupportedValueTypes() ); +const Sequence< Type > aSupportedTypes( getSupportedValueTypes(rGuard) ); for ( auto const & i : aSupportedTypes ) if ( aType == i ) return true; @@ -177,9 +184,10 @@ namespace calc Any SAL_CALL OCellValueBinding::getValue( const Type& aType ) { -checkDisposed( ); +std::unique_lock aGuard(m_aMutex); +throwIfDisposed(aGuard); checkInitialized( ); -checkValueType( aType ); +checkValueType( aGuard, aType ); Any aReturn; switch ( aType.getTypeClass() ) @@ -263,10 +271,11 @@ namespace calc void SAL_CALL OCellValueBinding::setValue( const Any& aValue ) { -
core.git: sc/source
sc/source/filter/oox/PivotTableFormat.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 1dc92b9e9951ef118d2d823d54f9a022c2e41a27 Author: Caolán McNamara AuthorDate: Sun Apr 14 17:38:05 2024 +0100 Commit: Caolán McNamara CommitDate: Sun Apr 14 20:29:50 2024 +0200 ofz#68019 Null-dereference READ Change-Id: Ie0c9c5a74e6ae87a0bd4c35320a687458d1d9902 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166074 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/sc/source/filter/oox/PivotTableFormat.cxx b/sc/source/filter/oox/PivotTableFormat.cxx index 2fc0cfa78371..870a6c99fad9 100644 --- a/sc/source/filter/oox/PivotTableFormat.cxx +++ b/sc/source/filter/oox/PivotTableFormat.cxx @@ -105,7 +105,7 @@ void PivotTableFormat::finalizeImport() aFormat.pPattern = pPattern; for (auto& rReference : maReferences) { -if (rReference->mnField) +if (rReference->mnField && !rReference->maFieldItemsIndices.empty()) { aFormat.aSelections.push_back( sc::Selection{ .bSelected = rReference->mbSelected,
core.git: sc/source
sc/source/filter/orcus/interface.cxx |9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) New commits: commit 0a687d1eeffcb21b947b181ceb2424680d1cce46 Author: Mike Kaganski AuthorDate: Sat Apr 13 23:39:24 2024 +0500 Commit: Mike Kaganski CommitDate: Sun Apr 14 06:52:28 2024 +0200 Use more o3tl::convert Change-Id: I5a6a1c05083fbaef71e94799a61c6f918a5134f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166064 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx index af425079708d..1f5ac13f358a 100644 --- a/sc/source/filter/orcus/interface.cxx +++ b/sc/source/filter/orcus/interface.cxx @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -750,13 +751,15 @@ double translateToInternal(double nVal, orcus::length_unit_t unit) switch(unit) { case orcus::length_unit_t::inch: -return nVal * 72.0 * 20.0; +return o3tl::convert(nVal, o3tl::Length::in, o3tl::Length::twip); case orcus::length_unit_t::twip: return nVal; case orcus::length_unit_t::point: -return nVal * 20.0; +return o3tl::convert(nVal, o3tl::Length::pt, o3tl::Length::twip); case orcus::length_unit_t::centimeter: -return nVal * 20.0 * 72.0 / 2.54; +return o3tl::convert(nVal, o3tl::Length::cm, o3tl::Length::twip); +case orcus::length_unit_t::millimeter: +return o3tl::convert(nVal, o3tl::Length::mm, o3tl::Length::twip); case orcus::length_unit_t::unknown: if (nVal != 0) SAL_WARN("sc.orcus", "unknown unit");
core.git: sc/source
sc/source/core/tool/interpr4.cxx | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) New commits: commit 63b237e1e8147f54e6d4db4671f612a656200e2f Author: Caolán McNamara AuthorDate: Sat Apr 13 16:35:28 2024 +0100 Commit: Caolán McNamara CommitDate: Sat Apr 13 21:28:44 2024 +0200 Related: tdf#160056 don't set nVal twice Change-Id: I0da3e0c7f18271f6104d52b50d65e96564650b8b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166054 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index 77dbd7d52014..27f2211b9f30 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -2099,7 +2099,7 @@ double ScInterpreter::GetDoubleFromMatrix(const ScMatrixRef& pMat) double ScInterpreter::GetDouble() { -double nVal(0.0); +double nVal; switch( GetRawStackType() ) { case svDouble: @@ -2134,13 +2134,16 @@ double ScInterpreter::GetDouble() { ScExternalRefCache::TokenRef pToken; PopExternalSingleRef(pToken); -if (nGlobalError == FormulaError::NONE) +if (nGlobalError != FormulaError::NONE) { -if (pToken->GetType() == svDouble || pToken->GetType() == svEmptyCell) -nVal = pToken->GetDouble(); -else -nVal = ConvertStringToValue( pToken->GetString().getString()); +nVal = 0.0; +break; } + +if (pToken->GetType() == svDouble || pToken->GetType() == svEmptyCell) +nVal = pToken->GetDouble(); +else +nVal = ConvertStringToValue( pToken->GetString().getString()); } break; case svExternalDoubleRef: @@ -2148,7 +2151,10 @@ double ScInterpreter::GetDouble() ScMatrixRef pMat; PopExternalDoubleRef(pMat); if (nGlobalError != FormulaError::NONE) +{ +nVal = 0.0; break; +} nVal = GetDoubleFromMatrix(pMat); }
core.git: sc/source
sc/source/filter/oox/PivotTableFormat.cxx |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) New commits: commit 91ad46fc2a50b1084bf8c28093ad8286674cbd28 Author: Caolán McNamara AuthorDate: Sat Apr 13 16:00:25 2024 +0100 Commit: Caolán McNamara CommitDate: Sat Apr 13 21:27:12 2024 +0200 ofz#68019 Null-dereference READ Change-Id: I9ad5d907c4739877d51b74ef0f2e275d94119f09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166052 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sc/source/filter/oox/PivotTableFormat.cxx b/sc/source/filter/oox/PivotTableFormat.cxx index 156fe9983a6e..2fc0cfa78371 100644 --- a/sc/source/filter/oox/PivotTableFormat.cxx +++ b/sc/source/filter/oox/PivotTableFormat.cxx @@ -76,9 +76,10 @@ void PivotTableFormat::importPivotArea(const oox::AttributeList& rAttribs) void PivotTableFormat::finalizeImport() { -DxfRef pDxf = getStyles().getDxf(mnDxfId); auto pPattern = std::make_shared(getScDocument().getCellAttributeHelper()); -pDxf->fillToItemSet(pPattern->GetItemSet()); + +if (DxfRef pDxf = getStyles().getDxf(mnDxfId)) +pDxf->fillToItemSet(pPattern->GetItemSet()); ScDPObject* pDPObj = mrPivotTable.getDPObject(); ScDPSaveData* pSaveData = pDPObj->GetSaveData();
core.git: sc/source
sc/source/core/tool/interpr4.cxx | 1036 +++ 1 file changed, 520 insertions(+), 516 deletions(-) New commits: commit d490efe410a54f1860578728027d1ec0439f0ba9 Author: Caolán McNamara AuthorDate: Fri Apr 12 17:37:30 2024 +0100 Commit: Caolán McNamara CommitDate: Sat Apr 13 00:52:40 2024 +0200 Related: tdf#160056 call FormulaCompiler::IsOpCodeJumpCommand just once rearrange to reuse previous calculation Change-Id: Ibda0388e020dac995e5667af09767b0314720935 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166039 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index dc0bd397707f..4408b04aa695 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -4030,540 +4030,544 @@ StackVar ScInterpreter::Interpret() PushWithoutError( *pCur ); nCurFmtType = SvNumFormatType::UNDEFINED; } -else if (!FormulaCompiler::IsOpCodeJumpCommand( eOp ) && -((aTokenMatrixMapIter = maTokenMatrixMap.find( pCur)) != - maTokenMatrixMap.end()) && -(*aTokenMatrixMapIter).second->GetType() != svJumpMatrix) -{ -// Path already calculated, reuse result. -const sal_uInt8 nParamCount = pCur->GetParamCount(); -if (sp >= nParamCount) -nStackBase = sp - nParamCount; -else -{ -SAL_WARN("sc.core", "Stack anomaly with calculated path at " -<< aPos.Tab() << "," << aPos.Col() << "," << aPos.Row() -<< " " << aPos.Format( -ScRefFlags::VALID | ScRefFlags::FORCE_DOC | ScRefFlags::TAB_3D, ) -<< " eOp: " << static_cast(eOp) -<< " params: " << static_cast(nParamCount) -<< " nStackBase: " << nStackBase << " sp: " << sp); -nStackBase = sp; -assert(!"underflow"); -} -sp = nStackBase; -PushTokenRef( (*aTokenMatrixMapIter).second); -} else { -// previous expression determines the current number format -nCurFmtType = nRetTypeExpr; -nCurFmtIndex = nRetIndexExpr; -// default function's format, others are set if needed -nFuncFmtType = SvNumFormatType::NUMBER; -nFuncFmtIndex = 0; - -if (FormulaCompiler::IsOpCodeJumpCommand( eOp )) -nStackBase = sp;// don't mess around with the jumps -else +const bool bIsOpCodeJumpCommand = FormulaCompiler::IsOpCodeJumpCommand(eOp); +if (!bIsOpCodeJumpCommand && + ((aTokenMatrixMapIter = maTokenMatrixMap.find( pCur)) != +maTokenMatrixMap.end()) && + (*aTokenMatrixMapIter).second->GetType() != svJumpMatrix) { -// Convert parameters to matrix if in array/matrix formula and -// parameters of function indicate doing so. Create JumpMatrix -// if necessary. -if ( MatrixParameterConversion() ) +// Path already calculated, reuse result. +const sal_uInt8 nParamCount = pCur->GetParamCount(); +if (sp >= nParamCount) +nStackBase = sp - nParamCount; +else { -eOp = ocNone; // JumpMatrix created +SAL_WARN("sc.core", "Stack anomaly with calculated path at " +<< aPos.Tab() << "," << aPos.Col() << "," << aPos.Row() +<< " " << aPos.Format( +ScRefFlags::VALID | ScRefFlags::FORCE_DOC | ScRefFlags::TAB_3D, ) +<< " eOp: " << static_cast(eOp) +<< " params: " << static_cast(nParamCount) +<< " nStackBase: " << nStackBase << " sp: " << sp); nStackBase = sp; +assert(!"underflow"); } +sp = nStackBase; +PushTokenRef( (*aTokenMatrixMapIter).second); +} +else +{ +// previous expression determines the current number format +nCurFmtType = nRetTypeExpr; +nCurFmtIndex = nRetIndexExpr; +// default function's format, others are set if needed +nFuncFmtType = SvNumFormatType::NUMBER; +nFuncFmtIndex = 0; + +if (bIsOpCodeJumpCommand) +nStackBase = sp;// don't mess around with the jumps else { -const sal_uInt8 nParamCount = pCur->GetParamCount(); -
core.git: sc/source
sc/source/core/tool/interpr4.cxx | 31 ++- 1 file changed, 18 insertions(+), 13 deletions(-) New commits: commit 030b655963c182693c7b657dc6aa4d2fe85c17c6 Author: Caolán McNamara AuthorDate: Fri Apr 12 12:24:06 2024 +0100 Commit: Caolán McNamara CommitDate: Sat Apr 13 00:51:29 2024 +0200 Related: tdf#160056 don't call GetParamCount twice GetParamCount: 290ms -> 175ms Change-Id: Ic3a26b1e8035744dcab2da69a8ebd3b29dd2160a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166031 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index 5e5d513289d0..dc0bd397707f 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -4036,8 +4036,9 @@ StackVar ScInterpreter::Interpret() (*aTokenMatrixMapIter).second->GetType() != svJumpMatrix) { // Path already calculated, reuse result. -if (sp >= pCur->GetParamCount()) -nStackBase = sp - pCur->GetParamCount(); +const sal_uInt8 nParamCount = pCur->GetParamCount(); +if (sp >= nParamCount) +nStackBase = sp - nParamCount; else { SAL_WARN("sc.core", "Stack anomaly with calculated path at " @@ -4045,7 +4046,7 @@ StackVar ScInterpreter::Interpret() << " " << aPos.Format( ScRefFlags::VALID | ScRefFlags::FORCE_DOC | ScRefFlags::TAB_3D, ) << " eOp: " << static_cast(eOp) -<< " params: " << static_cast(pCur->GetParamCount()) +<< " params: " << static_cast(nParamCount) << " nStackBase: " << nStackBase << " sp: " << sp); nStackBase = sp; assert(!"underflow"); @@ -4074,18 +4075,22 @@ StackVar ScInterpreter::Interpret() eOp = ocNone; // JumpMatrix created nStackBase = sp; } -else if (sp >= pCur->GetParamCount()) -nStackBase = sp - pCur->GetParamCount(); else { -SAL_WARN("sc.core", "Stack anomaly at " << aPos.Tab() << "," << aPos.Col() << "," << aPos.Row() -<< " " << aPos.Format( -ScRefFlags::VALID | ScRefFlags::FORCE_DOC | ScRefFlags::TAB_3D, ) -<< " eOp: " << static_cast(eOp) -<< " params: " << static_cast(pCur->GetParamCount()) -<< " nStackBase: " << nStackBase << " sp: " << sp); -nStackBase = sp; -assert(!"underflow"); +const sal_uInt8 nParamCount = pCur->GetParamCount(); +if (sp >= nParamCount) +nStackBase = sp - nParamCount; +else +{ +SAL_WARN("sc.core", "Stack anomaly at " << aPos.Tab() << "," << aPos.Col() << "," << aPos.Row() +<< " " << aPos.Format( +ScRefFlags::VALID | ScRefFlags::FORCE_DOC | ScRefFlags::TAB_3D, ) +<< " eOp: " << static_cast(eOp) +<< " params: " << static_cast(nParamCount) +<< " nStackBase: " << nStackBase << " sp: " << sp); +nStackBase = sp; +assert(!"underflow"); +} } }
core.git: sc/source
sc/source/filter/html/htmlpars.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 54d577ed22fd4bae093639be3056a722f5a40bb2 Author: Caolán McNamara AuthorDate: Fri Apr 12 15:24:53 2024 +0100 Commit: Caolán McNamara CommitDate: Fri Apr 12 21:40:09 2024 +0200 ofz#68004 Unknown Read Change-Id: Id3e50e3a8522523d2b665e394d8f4a65b7f4df5d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166034 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index 83d9c01fbf7e..5d27f751ab6c 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -778,7 +778,7 @@ void ScHTMLLayoutParser::SetWidths() if ( pE->nTab == nTable && pE->nWidth ) { SCCOL nCol = pE->nCol - nColCntStart; -if ( nCol < nColsPerRow ) +if (nCol >= 0 && nCol < nColsPerRow) { if ( pE->nColOverlap == 1 ) {
core.git: sc/source
sc/source/core/data/PivotTableFormatOutput.cxx |2 -- 1 file changed, 2 deletions(-) New commits: commit f017fe99f7e7a1beb2c7809b04e069831e706afb Author: Miklos Vajna AuthorDate: Fri Apr 12 09:13:53 2024 +0200 Commit: Caolán McNamara CommitDate: Fri Apr 12 18:05:48 2024 +0200 sc: fix -Werror,-Wunused-but-set-variable Pointed out by clang-15: sc/source/core/data/PivotTableFormatOutput.cxx:256:12: error: variable 'nEntryIndex' set but not used [-Werror,-Wunused-but-set-variable] size_t nEntryIndex = 0; ^ Change-Id: I3abf7fe6d4ed330cd713472ce4102eeef6aea4dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166022 Reviewed-by: Miklos Vajna Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/sc/source/core/data/PivotTableFormatOutput.cxx b/sc/source/core/data/PivotTableFormatOutput.cxx index 350aef597ebd..c3732a888ae7 100644 --- a/sc/source/core/data/PivotTableFormatOutput.cxx +++ b/sc/source/core/data/PivotTableFormatOutput.cxx @@ -253,7 +253,6 @@ void FormatOutput::apply(ScDocument& rDocument) if (!mpFormats) return; -size_t nEntryIndex = 0; for (auto const& rOutputEntry : maFormatOutputEntries) { if (!rOutputEntry.onTab || !rOutputEntry.pPattern) @@ -339,7 +338,6 @@ void FormatOutput::apply(ScDocument& rDocument) { rDocument.ApplyPattern(*oColumn, *oRow, *rOutputEntry.onTab, *rOutputEntry.pPattern); } -nEntryIndex++; } }
core.git: sc/source
sc/source/core/tool/interpr1.cxx |9 + 1 file changed, 1 insertion(+), 8 deletions(-) New commits: commit 51abf44808c6793a184e986b62c0786753e11ded Author: Balazs Varga AuthorDate: Thu Apr 11 21:49:21 2024 +0200 Commit: Balazs Varga CommitDate: Fri Apr 12 10:22:59 2024 +0200 Related: tdf#127293 Fix regex search mode in XLOOKUP wildcards mode If relevant Option in Calc was set for regex, xlookup still used the wildcard search mode. Change-Id: I318c3f368b6f59644c43ec518542910be72a5e0c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166015 Tested-by: Jenkins Reviewed-by: Balazs Varga diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 8ea81b336641..6f3c3304e627 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -11455,14 +11455,7 @@ bool ScInterpreter::SearchVectorForValue( VectorSearchArguments& vsa ) if ( mrDoc.IsInVBAMode() ) rParam.eSearchType = utl::SearchParam::SearchType::Wildcard; else -{ -// set searchtype hard to wildcard or regexp if applicable, the XLOOKUP -// argument prevails over the configuration setting -if ( MayBeWildcard( vsa.sSearchStr.getString() ) ) -rParam.eSearchType = utl::SearchParam::SearchType::Wildcard; -else if ( MayBeRegExp( vsa.sSearchStr.getString() ) ) -rParam.eSearchType = utl::SearchParam::SearchType::Regexp; -} +rParam.eSearchType = DetectSearchType(vsa.sSearchStr.getString(), mrDoc); } } else
core.git: sc/source
sc/source/core/tool/compiler.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 83d04e5a59b762d7edce0fcfaabbba1e26129a27 Author: Andrea Gelmini AuthorDate: Thu Apr 11 22:54:21 2024 +0200 Commit: Julien Nabet CommitDate: Fri Apr 12 09:23:07 2024 +0200 Fix typo Change-Id: I6e5c31a0d3577c40acd62b4c9dd6d4c084865c0b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166016 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index a0529fbe0f4e..6c847cfac501 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -6616,7 +6616,7 @@ void ScCompiler::AnnotateTrimOnDoubleRefs() case ocRange: { // tdf#160616: Double refs with these operators only -// trimmable in case of one paramater +// trimmable in case of one parameter if (!pTok->IsInForceArray() || nRootParam > 1) break; FormulaToken* pLHS = *(ppTok - 1);
core.git: sc/source
sc/source/ui/view/viewdata.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit e20cbd4bd7b1def2926ad48ecb3564597225d3b9 Author: Marco Cecchetti AuthorDate: Mon Mar 11 22:21:13 2024 +0100 Commit: Tomaž Vajngerl CommitDate: Fri Apr 12 05:25:55 2024 +0200 lok: calc: not possible to select the cell adjacent to the edited one In the LOK case using the paper size for the printer case (wysiwyg) can make the cell background and visible area larger than needed which makes selecting the adjacent right cell impossible in some cases. Change-Id: I20edd62645692f30e432b1064bb9c85b3396dc32 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164702 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tomaž Vajngerl (cherry picked from commit a6bc0272607590d1692db385be7f6fbfeb1a8fb4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164999 Tested-by: Jenkins diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 07a16aaa590a..f6684f0d201a 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -1753,7 +1753,9 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich, Size aPaperSize = pView->GetActiveWin()->PixelToLogic( Size( nSizeXPix, nSizeYPix ), GetLogicMode() ); Size aPaperSizePTwips(nSizeXPTwips, nSizeYPTwips); -if ( bBreak && !bAsianVertical && SC_MOD()->GetInputOptions().GetTextWysiwyg() ) +// In the LOK case the following code can make the cell background and visible area larger +// than needed which makes selecting the adjacent right cell impossible in some cases. +if ( bBreak && !bAsianVertical && SC_MOD()->GetInputOptions().GetTextWysiwyg() && !bLOKActive ) { // if text is formatted for printer, use the exact same paper width // (and same line breaks) as for output.
core.git: sc/source
sc/source/core/data/dpsave.cxx | 16 1 file changed, 8 insertions(+), 8 deletions(-) New commits: commit a9504d55782fb6ce1e64d154b4a3197062277425 Author: Tomaž Vajngerl AuthorDate: Thu Apr 11 16:27:21 2024 +0900 Commit: Tomaž Vajngerl CommitDate: Fri Apr 12 02:28:12 2024 +0200 pivot: remove duplication in ScDPSaveDimension::GetMemberByName Change-Id: I036e83307615a8c1f875ffc66a54027e1ec31a92 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165991 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx index ed888eebd737..6e1d5c56f085 100644 --- a/sc/source/core/data/dpsave.cxx +++ b/sc/source/core/data/dpsave.cxx @@ -458,14 +458,14 @@ ScDPSaveMember* ScDPSaveDimension::GetExistingMemberByName(const OUString& rName ScDPSaveMember* ScDPSaveDimension::GetMemberByName(const OUString& rName) { -auto res = maMemberHash.find (rName); -if (res != maMemberHash.end()) -return res->second.get(); - -ScDPSaveMember* pNew = new ScDPSaveMember( rName ); -maMemberHash[rName] = std::unique_ptr(pNew); -maMemberList.push_back( pNew ); -return pNew; +ScDPSaveMember* pResult = GetExistingMemberByName(rName); +if (pResult) +return pResult; + +pResult = new ScDPSaveMember(rName); +maMemberHash[rName] = std::unique_ptr(pResult); +maMemberList.push_back(pResult); +return pResult; } void ScDPSaveDimension::SetMemberPosition( const OUString& rName, sal_Int32 nNewPos )
core.git: sc/source
sc/source/core/data/dpoutput.cxx | 76 ++- 1 file changed, 44 insertions(+), 32 deletions(-) New commits: commit 3146d6759869fca4753edefddc503a5a89a42b91 Author: Tomaž Vajngerl AuthorDate: Mon Apr 1 22:08:50 2024 +0900 Commit: Tomaž Vajngerl CommitDate: Thu Apr 11 17:13:29 2024 +0200 pivot: un-abbreviate vars. in ScDPOutput::Output Change-Id: If480afbdcb2a350907a1cac734ebf76424825371 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165683 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx index d88a320aeac0..dd5d9d1577bc 100644 --- a/sc/source/core/data/dpoutput.cxx +++ b/sc/source/core/data/dpoutput.cxx @@ -1020,11 +1020,11 @@ void ScDPOutput::Output() for (size_t nField = 0; nField < mpPageFields.size(); ++nField) { -SCCOL nHdrCol = maStartPos.Col(); -SCROW nHdrRow = maStartPos.Row() + nField + (mbDoFilter ? 1 : 0); +SCCOL nHeaderCol = maStartPos.Col(); +SCROW nHeaderRow = maStartPos.Row() + nField + (mbDoFilter ? 1 : 0); // draw without frame for consistency with filter button: -FieldCell(nHdrCol, nHdrRow, nTab, mpPageFields[nField], false); -SCCOL nFldCol = nHdrCol + 1; +FieldCell(nHeaderCol, nHeaderRow, nTab, mpPageFields[nField], false); +SCCOL nFieldCol = nHeaderCol + 1; OUString aPageValue = ScResId(SCSTR_ALL); const uno::Sequence& rRes = mpPageFields[nField].maResult; @@ -1037,13 +1037,15 @@ void ScDPOutput::Output() aPageValue = rRes[0].Caption; } else if (n > 1) +{ aPageValue = ScResId(SCSTR_MULTIPLE); +} ScSetStringParam aParam; aParam.setTextInput(); -mpDocument->SetString(nFldCol, nHdrRow, nTab, aPageValue, ); +mpDocument->SetString(nFieldCol, nHeaderRow, nTab, aPageValue, ); -lcl_SetFrame(mpDocument, nTab, nFldCol,nHdrRow, nFldCol,nHdrRow, 20); +lcl_SetFrame(mpDocument, nTab, nFieldCol, nHeaderRow, nFieldCol, nHeaderRow, 20); } // data description @@ -1066,52 +1068,62 @@ void ScDPOutput::Output() mnTabStartCol, mnTabStartRow, mnDataStartCol, mnDataStartRow, mnTabEndCol, mnTabEndRow); size_t nNumColFields = mpColFields.size(); -for (size_t nField=0; nField(nField); //TODO: check for overflow +SCCOL nHeaderCol = mnDataStartCol + SCCOL(nField); //TODO: check for overflow + if (!mbHasCompactRowField || nNumColFields == 1) -FieldCell(nHdrCol, mnTabStartRow, nTab, mpColFields[nField], true); +FieldCell(nHeaderCol, mnTabStartRow, nTab, mpColFields[nField], true); else if (!nField) -MultiFieldCell(nHdrCol, mnTabStartRow, nTab, false /* bRowField */); +MultiFieldCell(nHeaderCol, mnTabStartRow, nTab, false /* bRowField */); -SCROW nRowPos = mnMemberStartRow + static_cast(nField); //TODO: check for overflow +SCROW nRowPos = mnMemberStartRow + SCROW(nField); //TODO: check for overflow tools::Long nDimension = mpColFields[nField].mnDim; const uno::Sequence rSequence = mpColFields[nField].maResult; -const sheet::MemberResult* pArray = rSequence.getConstArray(); +const sheet::MemberResult* pMemberArray = rSequence.getConstArray(); tools::Long nThisColCount = rSequence.getLength(); -OSL_ENSURE(nThisColCount == mnColCount, "count mismatch"); //TODO: ??? +OSL_ENSURE(nThisColCount == mnColCount, "count mismatch"); //TODO: ??? + tools::Long nColumnIndex = -1; -for (tools::Long nCol=0; nCol(nCol); //TODO: check for overflow -HeaderCell( nColPos, nRowPos, nTab, pArray[nCol], true, nField ); -if ( ( pArray[nCol].Flags & sheet::MemberResultFlags::HASMEMBER ) && -!( pArray[nCol].Flags & sheet::MemberResultFlags::SUBTOTAL ) ) + +SCCOL nColPos = mnDataStartCol + SCCOL(nColumn); //TODO: check for overflow +HeaderCell(nColPos, nRowPos, nTab, pMemberArray[nColumn], true, nField); +if ((pMemberArray[nColumn].Flags & sheet::MemberResultFlags::HASMEMBER) && + !(pMemberArray[nColumn].Flags & sheet::MemberResultFlags::SUBTOTAL)) { -tools::Long nEnd = nCol; -while ( nEnd+1 < nThisColCount && ( pArray[nEnd+1].Flags & sheet::MemberResultFlags::CONTINUE ) ) +// Check the number of columns this spreads +tools::Long nEnd = nColumn; +while (nEnd + 1 < nThisColCount && (pMemberArray[nEnd + 1].Flags & sheet::MemberResultFlags::CONTINUE)) ++nEnd; -SCCOL nEndColPos = mnDataStartCol + static_cast(nEnd); //TODO: check for overflow -if ( nField+1 <
core.git: sc/source
sc/source/core/inc/interpre.hxx | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) New commits: commit 7f9a35e6efc4118ecc46fa6f76fc5a812259eea1 Author: Noel Grandin AuthorDate: Wed Apr 10 12:14:32 2024 +0100 Commit: Noel Grandin CommitDate: Wed Apr 10 14:50:57 2024 +0200 use unordered_map for ScTokenMatrixMap which is considerably faster Change-Id: Ic44d88d8ef222edd91de8ae0e79d77a99c5c2e95 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165924 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx index 31ff2ecb7a9c..81240095fd98 100644 --- a/sc/source/core/inc/interpre.hxx +++ b/sc/source/core/inc/interpre.hxx @@ -34,7 +34,7 @@ #include #include "parclass.hxx" -#include +#include #include #include #include @@ -179,18 +179,16 @@ enum ScETSType etsStatMult }; -struct FormulaTokenRef_less +struct FormulaTokenRef_hash { -bool operator () ( const formula::FormulaConstTokenRef& r1, const formula::FormulaConstTokenRef& r2 ) const -{ return r1.get() < r2.get(); } +bool operator () ( const formula::FormulaConstTokenRef& r1 ) const +{ return std::hash()(static_cast(r1.get())); } // So we don't have to create a FormulaConstTokenRef to search by formula::FormulaToken* using is_transparent = void; -bool operator () ( const formula::FormulaToken* p1, const formula::FormulaConstTokenRef& r2 ) const -{ return p1 < r2.get(); } -bool operator () ( const formula::FormulaConstTokenRef& r1, const formula::FormulaToken* p2 ) const -{ return r1.get() < p2; } +bool operator () ( const formula::FormulaToken* p1 ) const +{ return std::hash()(static_cast(p1)); } }; -typedef ::std::map< const formula::FormulaConstTokenRef, formula::FormulaConstTokenRef, FormulaTokenRef_less> ScTokenMatrixMap; +typedef ::std::unordered_map< const formula::FormulaConstTokenRef, formula::FormulaConstTokenRef, FormulaTokenRef_hash> ScTokenMatrixMap; class ScInterpreter {
core.git: sc/source
sc/source/ui/app/transobj.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 164bde27bab3c4a4166230d60d591b54efe703c0 Author: Caolán McNamara AuthorDate: Mon Apr 8 22:18:32 2024 +0100 Commit: Caolán McNamara CommitDate: Wed Apr 10 09:47:34 2024 +0200 cid#1596245 Explicit null dereferenced Change-Id: I3912517648f76cd7a0fd651cf592bce427dc69f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165900 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx index 1a97a01d049b..b42154945e89 100644 --- a/sc/source/ui/app/transobj.cxx +++ b/sc/source/ui/app/transobj.cxx @@ -499,7 +499,8 @@ bool ScTransferObj::WriteObject( SvStream& rOStm, void* pUserObject, sal_uInt32 std::unique_ptr xStrm = aEditHelper.GetSotStorageStream( rFlavor ); bRet = bool(xStrm); -rOStm.WriteStream(*xStrm); +if (bRet) +rOStm.WriteStream(*xStrm); } } break;
core.git: sc/source
sc/source/ui/view/select.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 3d83f91b9ba249fcfa93fc24a1b427840b7b2c61 Author: Gökay Şatır AuthorDate: Fri Mar 15 17:24:53 2024 +0300 Commit: Caolán McNamara CommitDate: Sat Apr 6 22:10:47 2024 +0200 Disable dragging in readonly view mode. Signed-off-by: Gökay Şatır Change-Id: I962d68b85897c156bba6d1898cf78b5fcd85540a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164866 Tested-by: Jenkins CollaboraOffice Reviewed-by: Michael Meeks (cherry picked from commit 0cdafeb746196f9f1e9ad271a77f5911694ff07d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165726 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sc/source/ui/view/select.cxx b/sc/source/ui/view/select.cxx index d972c9b4eb8d..7d744f32246c 100644 --- a/sc/source/ui/view/select.cxx +++ b/sc/source/ui/view/select.cxx @@ -145,6 +145,9 @@ void ScViewFunctionSet::SetSelectionEngine( ScViewSelectionEngine* pSelEngine ) // Drag & Drop void ScViewFunctionSet::BeginDrag() { +if (m_pViewData->GetViewShell()->IsLokReadOnlyView()) +return; + SCTAB nTab = m_pViewData->GetTabNo(); SCCOL nPosX;
core.git: sc/source
sc/source/filter/rtf/eeimpars.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 8379aaee531e469687aaceba27f5afd697a0d86d Author: Caolán McNamara AuthorDate: Fri Apr 5 10:46:40 2024 +0100 Commit: Caolán McNamara CommitDate: Fri Apr 5 15:39:23 2024 +0200 ofz#67765 Integer-overflow Change-Id: I49b1a5024352575a3867500c15f542863c273e93 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165814 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx index 38f3f73e89aa..e6f1072f3fbe 100644 --- a/sc/source/filter/rtf/eeimpars.cxx +++ b/sc/source/filter/rtf/eeimpars.cxx @@ -309,7 +309,7 @@ void ScEEImport::WriteToDocument( bool bSizeColsRows, double nOutputFactor, SvNu ScMF::Hor ); if ( pE->nRowOverlap > 1 ) { -nRO = nRow + (pE->nRowOverlap - 1); +nRO = o3tl::saturating_add(nRow, pE->nRowOverlap - 1); mpDoc->ApplyFlagsTab( nCol, nRow+1, nCol, nRO , nTab, ScMF::Ver );
core.git: sc/source
sc/source/ui/unoobj/cellvaluebinding.cxx | 98 +-- sc/source/ui/unoobj/cellvaluebinding.hxx | 28 2 files changed, 58 insertions(+), 68 deletions(-) New commits: commit daa6df4633d67af025ea1000aaac20763da1a683 Author: Noel Grandin AuthorDate: Fri Apr 5 08:01:54 2024 +0200 Commit: Noel Grandin CommitDate: Fri Apr 5 11:07:30 2024 +0200 Revert "convert OCellValueBinding to comphelper::WeakComponentImplHelper" This reverts commit 7510cca63690ea97eb02a43f698fc183c3d0434a. Reason for revert: deadlocking Change-Id: Id50926e401871be259fa955b68b1767fd7f6b9de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165723 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sc/source/ui/unoobj/cellvaluebinding.cxx b/sc/source/ui/unoobj/cellvaluebinding.cxx index 7c4865726bef..fd8b43f9578e 100644 --- a/sc/source/ui/unoobj/cellvaluebinding.cxx +++ b/sc/source/ui/unoobj/cellvaluebinding.cxx @@ -54,7 +54,10 @@ namespace calc using namespace ::com::sun::star::form::binding; OCellValueBinding::OCellValueBinding( const Reference< XSpreadsheetDocument >& _rxDocument, bool _bListPos ) -:m_xDocument( _rxDocument ) +:OCellValueBinding_Base( m_aMutex ) +,OCellValueBinding_PBase( OCellValueBinding_Base::rBHelper ) +,m_xDocument( _rxDocument ) +,m_aModifyListeners( m_aMutex ) ,m_bInitialized( false ) ,m_bListPos( _bListPos ) { @@ -73,7 +76,7 @@ namespace calc OCellValueBinding::~OCellValueBinding( ) { -if ( !m_bDisposed ) +if ( !OCellValueBinding_Base::rBHelper.bDisposed ) { acquire(); // prevent duplicate dtor dispose(); @@ -84,7 +87,7 @@ namespace calc IMPLEMENT_FORWARD_XTYPEPROVIDER2( OCellValueBinding, OCellValueBinding_Base, OCellValueBinding_PBase ) -void OCellValueBinding::disposing( std::unique_lock& rGuard ) +void SAL_CALL OCellValueBinding::disposing() { Reference xBroadcaster( m_xCell, UNO_QUERY ); if ( xBroadcaster.is() ) @@ -92,7 +95,7 @@ namespace calc xBroadcaster->removeModifyListener( this ); } -WeakComponentImplHelperBase::disposing(rGuard); +WeakComponentImplHelperBase::disposing(); // TODO: clean up here whatever you need to clean up (e.g. deregister as XEventListener // for the cell) @@ -103,7 +106,7 @@ namespace calc return createPropertySetInfo( getInfoHelper() ) ; } -::cppu::IPropertyArrayHelper& OCellValueBinding::getInfoHelper() +::cppu::IPropertyArrayHelper& SAL_CALL OCellValueBinding::getInfoHelper() { return *OCellValueBinding_PABase::getArrayHelper(); } @@ -115,7 +118,7 @@ namespace calc return new ::cppu::OPropertyArrayHelper(aProps); } -void OCellValueBinding::getFastPropertyValue( std::unique_lock& /*rGuard*/, Any& _rValue, sal_Int32 _nHandle ) const +void SAL_CALL OCellValueBinding::getFastPropertyValue( Any& _rValue, sal_Int32 _nHandle ) const { OSL_ENSURE( _nHandle == PROP_HANDLE_BOUND_CELL, "OCellValueBinding::getFastPropertyValue: invalid handle!" ); // we only have this one property... @@ -128,14 +131,9 @@ namespace calc Sequence< Type > SAL_CALL OCellValueBinding::getSupportedValueTypes( ) { -std::unique_lock aGuard(m_aMutex); -throwIfDisposed(aGuard); +checkDisposed( ); checkInitialized( ); -return getSupportedValueTypes(aGuard); -} -Sequence< Type > OCellValueBinding::getSupportedValueTypes( std::unique_lock& /*rGuard*/ ) const -{ sal_Int32 nCount = m_xCellText.is() ? 3 : m_xCell.is() ? 1 : 0; if ( m_bListPos ) ++nCount; @@ -165,16 +163,11 @@ namespace calc sal_Bool SAL_CALL OCellValueBinding::supportsType( const Type& aType ) { -std::unique_lock aGuard(m_aMutex); -throwIfDisposed(aGuard); +checkDisposed( ); checkInitialized( ); -return supportsType(aGuard, aType); -} -bool OCellValueBinding::supportsType( std::unique_lock& rGuard, const Type& aType ) const -{ // look up in our sequence -const Sequence< Type > aSupportedTypes( getSupportedValueTypes(rGuard) ); +const Sequence< Type > aSupportedTypes( getSupportedValueTypes() ); for ( auto const & i : aSupportedTypes ) if ( aType == i ) return true; @@ -184,10 +177,9 @@ namespace calc Any SAL_CALL OCellValueBinding::getValue( const Type& aType ) { -std::unique_lock aGuard(m_aMutex); -throwIfDisposed(aGuard); +checkDisposed( ); checkInitialized( ); -checkValueType( aGuard, aType ); +checkValueType( aType ); Any aReturn; switch ( aType.getTypeClass() ) @@ -271,11 +263,10 @@ namespace calc
core.git: sc/source
sc/source/ui/view/preview.cxx |1 - sc/source/ui/view/printfun.cxx |2 -- 2 files changed, 3 deletions(-) New commits: commit 4be23d7701d43af34f218545a863f5c96b4298eb Author: Noel Grandin AuthorDate: Thu Apr 4 09:06:05 2024 +0200 Commit: Noel Grandin CommitDate: Thu Apr 4 10:33:30 2024 +0200 remove leftovers from commit e1e48bba55ff68397d514ab3771850678312f348 Author: Noel Grandin Date: Mon Apr 1 18:40:26 2024 +0200 tdf#160399 speed up print preview Change-Id: I399752d473a4f6f782cdfcc53b4625dcdf7cb460 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165778 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx index c438425cfc4b..c8b3ed2a7ae0 100644 --- a/sc/source/ui/view/preview.cxx +++ b/sc/source/ui/view/preview.cxx @@ -729,7 +729,6 @@ void ScPreview::SetZoom(sal_uInt16 nNewZoom) pViewShell->UpdateNeededScrollBars(true); bInSetZoom = false; -//bStateValid = false; InvalidateLocationData( SfxHintId::ScAccVisAreaChanged ); DoInvalidate(); Invalidate(); diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index 2653b3d0766b..465827174b76 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -253,8 +253,6 @@ ScPrintFunc::ScPrintFunc(ScDocShell* pShell, SfxPrinter* pNewPrinter, const ScPr nEndRow = rState.nEndRow; bPrintAreaValid = rState.bPrintAreaValid; nZoom = rState.nZoom; -//m_aRanges.m_nPagesX = rState.nPagesX; -//m_aRanges.m_nPagesY = rState.nPagesY; m_aRanges = rState.m_aRanges; nTabPages = rState.nTabPages; nTotalPages = rState.nTotalPages;
core.git: sc/source
sc/source/filter/html/htmlpars.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit c4f2a85bc5fa319a84474191275a2434dda1830b Author: Caolán McNamara AuthorDate: Wed Apr 3 14:09:53 2024 +0100 Commit: Caolán McNamara CommitDate: Wed Apr 3 16:49:33 2024 +0200 ofz#67815 overflowed short Change-Id: Iee9a5caee53b522ed16d234c2bc06987264e23db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165751 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index 8786b55fcce2..45d21cea1720 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -832,12 +832,12 @@ void ScHTMLLayoutParser::SetWidths() pWidths[nCol] = nW; } } -for (SCCOL nCol = 1; nCol <= nColsPerRow; nCol++) +for (int nCol = 1; nCol <= nColsPerRow; nCol++) { pOffsets[nCol] = pOffsets[nCol-1] + pWidths[nCol-1]; } xLocalColOffset->clear(); -for (SCCOL nCol = 0; nCol <= nColsPerRow; nCol++) +for (int nCol = 0; nCol <= nColsPerRow; nCol++) { MakeColNoRef( xLocalColOffset.get(), pOffsets[nCol], 0, 0, 0 ); }
core.git: sc/source
sc/source/ui/view/cellsh1.cxx |3 --- sc/source/ui/view/tabvwshc.cxx |2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) New commits: commit 387a9c445793e8377f85e508d935dc070fd8ab74 Author: Armin Le Grand (allotropia) AuthorDate: Fri Mar 29 16:28:04 2024 +0100 Commit: Armin Le Grand CommitDate: Wed Apr 3 15:49:06 2024 +0200 tdf#160252 ITEM remove unnecessary cleanups of shared_ptr Change-Id: I5654d65097bf88b70cb85937de3ce111fa7e4345 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165552 Tested-by: Jenkins Reviewed-by: Armin Le Grand diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index ac70ef49ae14..a8297303ee8f 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -2919,9 +2919,6 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) else pCondFormatList.reset(); -if (rDlgItem) -pTabViewShell->setScCondFormatDlgItem(nullptr); - pDlg->disposeOnce(); }); } diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx index caa21c084c3f..7904290b6d5b 100644 --- a/sc/source/ui/view/tabvwshc.cxx +++ b/sc/source/ui/view/tabvwshc.cxx @@ -436,6 +436,8 @@ std::shared_ptr ScTabViewShell::CreateRefDialogCont xResult = std::make_shared(pB, pCW, pParent, , rDlgItem); // Remove the pool item stored by Conditional Format Manager Dialog. +// tdf#160252 still needed *after* change to ScCondFormatDlgData due to +// UnitTest UITest_conditional_format setScCondFormatDlgItem(nullptr); }
core.git: sc/source
sc/source/ui/unoobj/celllistsource.cxx |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) New commits: commit 3976c94feecb00ee80a48009086d0850e32891f1 Author: Noel Grandin AuthorDate: Tue Apr 2 11:30:31 2024 +0200 Commit: Noel Grandin CommitDate: Tue Apr 2 14:37:44 2024 +0200 fix assert in loading forum-de3-11775.ods regression from commit a95bff116e1da140b9abe9742ceeb9a3caed43d5 Author: Noel Grandin Date: Tue Mar 26 15:42:52 2024 +0200 convert OCellListSource to comphelper::WeakComponentImplHelper Change-Id: Ib8af6627c641c73d9e4e6aaa43d694084a2854ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165671 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sc/source/ui/unoobj/celllistsource.cxx b/sc/source/ui/unoobj/celllistsource.cxx index 21c98d72f894..446330dd832d 100644 --- a/sc/source/ui/unoobj/celllistsource.cxx +++ b/sc/source/ui/unoobj/celllistsource.cxx @@ -309,9 +309,8 @@ namespace calc aEvent.Source.set(*this); m_aListEntryListeners.forEach(aGuard, -[, ] (const css::uno::Reference& l) +[] (const css::uno::Reference& l) { -aGuard.unlock(); try { l->allEntriesChanged( aEvent ); @@ -324,7 +323,6 @@ namespace calc { TOOLS_WARN_EXCEPTION( "sc", "OCellListSource::notifyModified: caught a (non-runtime) exception!" ); } -aGuard.lock(); }); }