sc/inc/document.hxx | 3 ++- sc/source/core/data/document.cxx | 5 +++++ sc/source/ui/view/spelleng.cxx | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-)
New commits: commit ce911276b87b86b58c45ac4b7e9f5226a7ef95c5 Author: Kohei Yoshida <ko...@libreoffice.org> AuthorDate: Fri May 6 23:11:17 2022 -0400 Commit: Kohei Yoshida <ko...@libreoffice.org> CommitDate: Sat May 7 16:48:12 2022 +0200 tdf#107765: Use the correct sheet index. This is a follow-up to f15e6293cf78d67963a6e512f60a11ae58da72c5. Change-Id: I3f1e6bbb1fe83fab48a0c3889fb53c6919f6351d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133967 Tested-by: Jenkins Reviewed-by: Kohei Yoshida <ko...@libreoffice.org> diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index f83b021393f2..8e79d31e5ff3 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -1919,7 +1919,8 @@ public: SCTAB nTab, ScMF nFlags ); SC_DLLPUBLIC void SetPattern( const ScAddress&, const ScPatternAttr& rAttr ); - SC_DLLPUBLIC const ScPatternAttr* SetPattern( SCCOL nCol, SCROW nRow, SCTAB nTab, std::unique_ptr<ScPatternAttr> ); + SC_DLLPUBLIC const ScPatternAttr* SetPattern( SCCOL nCol, SCROW nRow, SCTAB nTab, std::unique_ptr<ScPatternAttr> pAttr ); + SC_DLLPUBLIC const ScPatternAttr* SetPattern( const ScAddress& rPos, std::unique_ptr<ScPatternAttr> pAttr ); SC_DLLPUBLIC void SetPattern( SCCOL nCol, SCROW nRow, SCTAB nTab, const ScPatternAttr& rAttr ); void AutoFormat( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 5acd603f006e..1675f21a6afa 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -5097,6 +5097,11 @@ const ScPatternAttr* ScDocument::SetPattern( SCCOL nCol, SCROW nRow, SCTAB nTab, return nullptr; } +const ScPatternAttr* ScDocument::SetPattern( const ScAddress& rPos, std::unique_ptr<ScPatternAttr> pAttr ) +{ + return SetPattern(rPos.Col(), rPos.Row(), rPos.Tab(), std::move(pAttr)); +} + void ScDocument::SetPattern( SCCOL nCol, SCROW nRow, SCTAB nTab, const ScPatternAttr& rAttr ) { if (ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size())) diff --git a/sc/source/ui/view/spelleng.cxx b/sc/source/ui/view/spelleng.cxx index 615960ff0703..cb3c4f4ad974 100644 --- a/sc/source/ui/view/spelleng.cxx +++ b/sc/source/ui/view/spelleng.cxx @@ -134,7 +134,7 @@ bool ScConversionEngineBase::FindNextConversionCell() // Set the new string and update the language with the cell. mrDoc.SetString(aPos, aNewStr); - const ScPatternAttr* pAttr = mrDoc.GetPattern(mnCurrCol, mnCurrRow, mnStartTab); + const ScPatternAttr* pAttr = mrDoc.GetPattern(aPos); std::unique_ptr<ScPatternAttr> pNewAttr; if (pAttr) @@ -143,7 +143,7 @@ bool ScConversionEngineBase::FindNextConversionCell() pNewAttr = std::make_unique<ScPatternAttr>(mrDoc.GetPool()); pNewAttr->GetItemSet().Put(SvxLanguageItem(aLang.nLang, EE_CHAR_LANGUAGE), ATTR_FONT_LANGUAGE); - mrDoc.SetPattern(mnCurrCol, mnCurrRow, mnStartTab, std::move(pNewAttr)); + mrDoc.SetPattern(aPos, std::move(pNewAttr)); } if (mpRedoDoc && !bEmptyCell)