include/docmodel/color/ComplexColor.hxx | 2 - oox/source/drawingml/color.cxx | 2 - sc/qa/unit/ucalc_sparkline.cxx | 8 ++-- sc/source/filter/xml/SparklineGroupsImportContext.cxx | 2 - sc/source/ui/sparklines/SparklineAttributes.cxx | 16 ++++----- sw/inc/crsrsh.hxx | 12 +++++++ sw/inc/viewsh.hxx | 7 ++++ sw/qa/extras/uiwriter/uiwriter6.cxx | 9 ----- sw/qa/extras/uiwriter/uiwriter9.cxx | 29 ++++++++++++++++++ sw/source/core/crsr/crsrsh.cxx | 23 ++++++++++++++ sw/source/core/crsr/viscrs.cxx | 27 ---------------- sw/source/core/inc/txtfrm.hxx | 2 - sw/source/core/txtnode/txtedt.cxx | 8 ++++ sw/source/core/undo/unins.cxx | 12 ++++--- 14 files changed, 104 insertions(+), 55 deletions(-)
New commits: commit ebe8532fd0d881bd2dfc338fc6c8b17071133396 Author: Mike Kaganski <[email protected]> AuthorDate: Wed Jun 5 10:43:07 2024 +0500 Commit: Mike Kaganski <[email protected]> CommitDate: Wed Jun 5 15:47:43 2024 +0500 tdf#144752: UNDO/REDO: make sure to select the replaced content In the specific case of the bug, the non-empty selection means that the spell check won't skip the word with the cursor. But this also establishes consistency with other Undo/Redo cases, which generally select the text. Change-Id: Ib7c1c911908dc59947e610d735907be7a363ca87 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168423 Reviewed-by: Mike Kaganski <[email protected]> Tested-by: Jenkins (cherry picked from commit 31f46cec1406bb39453f5d909da1321980b0e405) diff --git a/sw/qa/extras/uiwriter/uiwriter9.cxx b/sw/qa/extras/uiwriter/uiwriter9.cxx index bd69d2616a6d..6b2255cf6d34 100644 --- a/sw/qa/extras/uiwriter/uiwriter9.cxx +++ b/sw/qa/extras/uiwriter/uiwriter9.cxx @@ -123,6 +123,35 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest9, testTdf160898) pWrtShell->SelAll(); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest9, testTdf144752) +{ + // Undoing/redoing a replacement must select the new text + createSwDoc(); + SwXTextDocument* pDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); + CPPUNIT_ASSERT(pDoc); + SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); + CPPUNIT_ASSERT(pWrtShell); + + emulateTyping(*pDoc, u"Some Text"); + CPPUNIT_ASSERT(!pWrtShell->HasSelection()); + // Select "Text", and replace with "Word" + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect*/ true, 4, /*bBasicCall*/ false); + pWrtShell->Replace("Word", false); + pWrtShell->EndOfSection(); + CPPUNIT_ASSERT(!pWrtShell->HasSelection()); + + // Undo and check, that the "Text" is selected + dispatchCommand(mxComponent, ".uno:Undo", {}); + // Without the fix, this would fail + CPPUNIT_ASSERT(pWrtShell->HasSelection()); + CPPUNIT_ASSERT_EQUAL(OUString("Text"), pWrtShell->GetSelText()); + + // Redo and check, that the "Word" is selected + dispatchCommand(mxComponent, ".uno:Redo", {}); + CPPUNIT_ASSERT(pWrtShell->HasSelection()); + CPPUNIT_ASSERT_EQUAL(OUString("Word"), pWrtShell->GetSelText()); +} + } // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx index 0ac95d0c192f..f50c8a3acf8a 100644 --- a/sw/source/core/undo/unins.cxx +++ b/sw/source/core/undo/unins.cxx @@ -672,7 +672,10 @@ void SwUndoReplace::Impl::UndoImpl(::sw::UndoRedoContext & rContext) rPam.GetPoint()->Assign( m_nEndNd - m_nOffset, m_nEndCnt ); pDoc->getIDocumentContentOperations().DeleteAndJoin(rPam); } - rPam.DeleteMark(); + if (*rPam.GetMark() == *rPam.GetPoint()) + rPam.DeleteMark(); + else + rPam.Normalize(false); pNd = pDoc->GetNodes()[ m_nSttNd - m_nOffset ]->GetTextNode(); OSL_ENSURE( pNd, "Dude, where's my TextNode?" ); } @@ -712,8 +715,6 @@ void SwUndoReplace::Impl::UndoImpl(::sw::UndoRedoContext & rContext) } } } - - rPam.GetPoint()->Assign( m_nSttNd, m_nSttCnt ); } void SwUndoReplace::Impl::RedoImpl(::sw::UndoRedoContext & rContext) @@ -751,7 +752,10 @@ void SwUndoReplace::Impl::RedoImpl(::sw::UndoRedoContext & rContext) } rDoc.getIDocumentContentOperations().ReplaceRange( rPam, m_sIns, m_bRegExp ); - rPam.DeleteMark(); + if (*rPam.GetMark() == *rPam.GetPoint()) + rPam.DeleteMark(); + else + rPam.Normalize(false); } void SwUndoReplace::Impl::SetEnd(SwPaM const& rPam) commit 8c5606cdc2c6136a33f5b0ff1afbef85cde79dae Author: Mike Kaganski <[email protected]> AuthorDate: Wed Jun 5 00:41:03 2024 +0500 Commit: Mike Kaganski <[email protected]> CommitDate: Wed Jun 5 15:19:58 2024 +0500 tdf#136294: trigger pending spellcheck in SwCursorShell::UpdateCursor This allows to drop the partial fix created for tdf#124603 (except for unit test). The problem solved in commit 4c91e94e892943ef5e031d65f6f42864233cb4cd (tdf#92036: sw: fix idle spelling loop, 2015-09-09) is kept solved; when a word is marked pending, this is signalled to the viewshell. SwCursorShell stores that as a flag, which will then start an idle on cursor update, and finally call SwViewShell::LayoutIdle, which does the spell checking. If the cursor is still in the word that is pending the check, the cycle will repeat, trying spell checks only at cursor update, not as a busy loop. Change-Id: I5dc77baabffa723e261d553e40d40e5ace4266bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168413 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index 233edb71c240..f4fc329a526a 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -23,6 +23,7 @@ #include <rtl/ustring.hxx> #include <tools/link.hxx> +#include <vcl/idle.hxx> #include <vcl/keycod.hxx> #include <o3tl/typed_flags_set.hxx> @@ -243,8 +244,14 @@ private: bool m_bMacroExecAllowed : 1; + // SwViewShell::LayoutIdle needs to be called on cursor update to repeat a spell check, + // because previous attempt marked a word as pending, because the word had cursor + bool m_bNeedLayoutOnCursorUpdate : 1; + SwFrame* m_oldColFrame; + Idle m_aLayoutIdle; // An idle to schedule another SwViewShell::LayoutIdle call + SAL_DLLPRIVATE void MoveCursorToNum(); SAL_DLLPRIVATE void ParkPams( SwPaM* pDelRg, SwShellCursor** ppDelRing ); @@ -285,6 +292,9 @@ private: SAL_DLLPRIVATE const SwRangeRedline* GotoRedline_( SwRedlineTable::size_type nArrPos, bool bSelect ); SAL_DLLPRIVATE void sendLOKCursorUpdates(); + + DECL_LINK(DoLayoutIdle, Timer*, void); // calls SwViewShell::LayoutIdle + protected: inline SwMoveFnCollection const & MakeFindRange( SwDocPositions, SwDocPositions, SwPaM* ) const; @@ -308,6 +318,8 @@ protected: protected: virtual void SwClientNotify(const SwModify&, const SfxHint&) override; + virtual void OnSpellWrongStatePending() override { m_bNeedLayoutOnCursorUpdate = true; } + public: SwCursorShell( SwDoc& rDoc, vcl::Window *pWin, const SwViewOption *pOpt ); // disguised copy constructor diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index 583b795a1b22..73c5718550ee 100644 --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -599,6 +599,13 @@ public: void GetFirstLastVisPageNumbers(SwVisiblePageNumbers& rVisiblePageNumbers); virtual void dumpAsXml(xmlTextWriterPtr pWriter) const; + + // SwTextFrame::AutoSpell_ calls this, to notify the shell, that a word has a spelling error, + // but that couldn't be drawn, because the cursor was in that word (so that the user is not + // annoyed while typing). The shell's task is to re-run the spell check (i.e., call LayoutIdle, + // which internally does the spell check), when the cursor leaves that word (implemented in + // SwCursorShell). + virtual void OnSpellWrongStatePending() {} }; // manages global ShellPointer diff --git a/sw/qa/extras/uiwriter/uiwriter6.cxx b/sw/qa/extras/uiwriter/uiwriter6.cxx index 316181c37cff..f91aa3603525 100644 --- a/sw/qa/extras/uiwriter/uiwriter6.cxx +++ b/sw/qa/extras/uiwriter/uiwriter6.cxx @@ -1769,16 +1769,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf124603) bool bPending = !pNode->GetWrong() || !pNode->GetWrong()->Count(); CPPUNIT_ASSERT(bPending); - // Move right, leave the bad word + // Move right, leave the bad word - since the fix for tdf#136294, this triggers the check pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); - // tdf#92036 still pending spell checking - bPending = !pNode->GetWrong() || !pNode->GetWrong()->Count(); - CPPUNIT_ASSERT(bPending); - - // Move down to trigger spell checking - - pWrtShell->Down(/*bSelect=*/false, 1); Scheduler::ProcessEventsToIdle(); CPPUNIT_ASSERT(pNode->GetWrong()); // This was 0 (pending spell checking) diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index b7b7a8997f8c..b2a00ac33a49 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -1908,6 +1908,15 @@ void SwCursorShell::UpdateCursor( sal_uInt16 eFlags, bool bIdleEnd ) return; // if not then no update } + if (m_bNeedLayoutOnCursorUpdate) + { + // A previous spell check skipped a word that had a spelling error, because that word + // had cursor. Now schedule the idle to call SwViewShell::LayoutIdle, to repeat the + // spell check, in the hope that the cursor has left the word. + m_aLayoutIdle.Start(); + m_bNeedLayoutOnCursorUpdate = false; + } + #if !ENABLE_WASM_STRIP_ACCESSIBILITY SwNotifyAccAboutInvalidTextSelections aInvalidateTextSelections( *this ); #endif @@ -3291,6 +3300,7 @@ SwCursorShell::SwCursorShell( SwCursorShell& rShell, vcl::Window *pInitWin ) , m_eEnhancedTableSel(SwTable::SEARCH_NONE) , m_nMarkedListLevel( 0 ) , m_oldColFrame(nullptr) + , m_aLayoutIdle("SwCursorShell m_aLayoutIdle") { CurrShell aCurr( this ); // only keep the position of the current cursor of the copy shell @@ -3306,6 +3316,10 @@ SwCursorShell::SwCursorShell( SwCursorShell& rShell, vcl::Window *pInitWin ) m_bSetCursorInReadOnly = true; m_pVisibleCursor = new SwVisibleCursor( this ); m_bMacroExecAllowed = rShell.IsMacroExecAllowed(); + m_bNeedLayoutOnCursorUpdate = false; + + m_aLayoutIdle.SetPriority(TaskPriority::LOWEST); + m_aLayoutIdle.SetInvokeHandler(LINK(this, SwCursorShell, DoLayoutIdle)); } /// default constructor @@ -3328,6 +3342,7 @@ SwCursorShell::SwCursorShell( SwDoc& rDoc, vcl::Window *pInitWin, , m_eEnhancedTableSel(SwTable::SEARCH_NONE) , m_nMarkedListLevel( 0 ) , m_oldColFrame(nullptr) + , m_aLayoutIdle("SwCursorShell m_aLayoutIdle") { CurrShell aCurr( this ); // create initial cursor and set it to first content position @@ -3352,10 +3367,16 @@ SwCursorShell::SwCursorShell( SwDoc& rDoc, vcl::Window *pInitWin, m_pVisibleCursor = new SwVisibleCursor( this ); m_bMacroExecAllowed = true; + m_bNeedLayoutOnCursorUpdate = false; + + m_aLayoutIdle.SetPriority(TaskPriority::LOWEST); + m_aLayoutIdle.SetInvokeHandler(LINK(this, SwCursorShell, DoLayoutIdle)); } SwCursorShell::~SwCursorShell() { + m_aLayoutIdle.Stop(); + // if it is not the last view then at least the field should be updated if( !unique() ) CheckTableBoxContent( m_pCurrentCursor->GetPoint() ); @@ -3384,6 +3405,8 @@ SwCursorShell::~SwCursorShell() EndListeningAll(); } +IMPL_LINK_NOARG(SwCursorShell, DoLayoutIdle, Timer*, void) { LayoutIdle(); } + SwShellCursor* SwCursorShell::getShellCursor( bool bBlock ) { if( m_pTableCursor ) diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index f681f3a32815..9a4bb996966b 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@ -1069,33 +1069,6 @@ void SwShellCursor::SaveTableBoxContent( const SwPosition* pPos ) bool SwShellCursor::UpDown( bool bUp, sal_uInt16 nCnt ) { - // tdf#124603 trigger pending spell checking of the node - if ( nCnt == 1 ) - { - SwTextNode* pNode = GetPoint()->GetNode().GetTextNode(); - if( pNode && sw::WrongState::PENDING == pNode->GetWrongDirty() ) - { - SwWrtShell* pShell = pNode->GetDoc().GetDocShell()->GetWrtShell(); - if ( pShell && !pShell->IsSelection() && !pShell->IsSelFrameMode() ) - { - const SwViewOption* pVOpt = pShell->GetViewOptions(); - if ( pVOpt && pVOpt->IsOnlineSpell() ) - { - const bool bOldViewLock = pShell->IsViewLocked(); - pShell->LockView( true ); - - SwTextFrame* pFrame( - static_cast<SwTextFrame*>(pNode->getLayoutFrame(GetShell()->GetLayout()))); - SwRect aRepaint(pFrame->AutoSpell_(*pNode, 0)); - if (aRepaint.HasArea()) - pShell->InvalidateWindows(aRepaint); - - pShell->LockView( bOldViewLock ); - } - } - } - } - return SwCursor::UpDown( bUp, nCnt, &GetPtPos(), GetShell()->GetUpDownX(), *GetShell()->GetLayout()); diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx index 6deba9f6104f..e63c67597836 100644 --- a/sw/source/core/inc/txtfrm.hxx +++ b/sw/source/core/inc/txtfrm.hxx @@ -353,7 +353,7 @@ public: */ void Init(); - /// Is called by DoIdleJob_(), ExecSpellPopup() and UpDown() + /// Is called by DoIdleJob_() and ExecSpellPopup() SwRect AutoSpell_(SwTextNode &, sal_Int32); /// Is called by DoIdleJob_() diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index 2f3e7aa6db86..a1bfb0c0f3c1 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -1490,6 +1490,14 @@ SwRect SwTextFrame::AutoSpell_(SwTextNode & rNode, sal_Int32 nActPos) : sw::WrongState::DONE); if( !pNode->GetWrong()->Count() && ! pNode->IsWrongDirty() ) pNode->ClearWrong(); + + if (bPending && getRootFrame()) + { + if (SwViewShell* pViewSh = getRootFrame()->GetCurrShell()) + { + pViewSh->OnSpellWrongStatePending(); + } + } } else pNode->SetWrongDirty(sw::WrongState::DONE); commit e9a18c1f10a8309ab340bf45be9da5644d8db3f8 Author: Mike Kaganski <[email protected]> AuthorDate: Fri Aug 4 16:34:49 2023 +0300 Commit: Mike Kaganski <[email protected]> CommitDate: Wed Jun 5 15:18:36 2024 +0500 Rename setRGB to createRGB to make it less misleading Somehow I overlooked completely, that there already is a non-static setRGB. Thanks Miklos and Tomaž for the heads up! Change-Id: If20018a317d90e0a6297950dff201671316aacad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155353 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161284 Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/include/docmodel/color/ComplexColor.hxx b/include/docmodel/color/ComplexColor.hxx index 1b93e34f7442..d239f51b7c34 100644 --- a/include/docmodel/color/ComplexColor.hxx +++ b/include/docmodel/color/ComplexColor.hxx @@ -247,7 +247,7 @@ public: return seed; } - static model::ComplexColor setRGB(Color const& rColor) + static model::ComplexColor createRGB(Color const& rColor) { model::ComplexColor aComplexColor; aComplexColor.setColor(rColor); diff --git a/oox/source/drawingml/color.cxx b/oox/source/drawingml/color.cxx index 79d27d8b21cb..0bd570185a4c 100644 --- a/oox/source/drawingml/color.cxx +++ b/oox/source/drawingml/color.cxx @@ -828,7 +828,7 @@ model::ComplexColor Color::createComplexColor(const GraphicHelper& /*rGraphicHel else if (meMode == COLOR_RGB) { ::Color aColor(ColorTransparency, lclRgbComponentsToRgb(mnC1, mnC2, mnC3)); - aNewComplexColor = model::ComplexColor::setRGB(aColor); + aNewComplexColor = model::ComplexColor::createRGB(aColor); } else { diff --git a/sc/qa/unit/ucalc_sparkline.cxx b/sc/qa/unit/ucalc_sparkline.cxx index e140a39d20b1..1a5e203692dc 100644 --- a/sc/qa/unit/ucalc_sparkline.cxx +++ b/sc/qa/unit/ucalc_sparkline.cxx @@ -484,16 +484,16 @@ CPPUNIT_TEST_FIXTURE(SparklineTest, testUndoRedoEditSparklineGroup) { sc::SparklineAttributes& rAttibutes = pSparklineGroup->getAttributes(); rAttibutes.setType(sc::SparklineType::Column); - rAttibutes.setColorSeries(model::ComplexColor::setRGB(COL_YELLOW)); - rAttibutes.setColorAxis(model::ComplexColor::setRGB(COL_GREEN)); + rAttibutes.setColorSeries(model::ComplexColor::createRGB(COL_YELLOW)); + rAttibutes.setColorAxis(model::ComplexColor::createRGB(COL_GREEN)); } m_pDoc->CreateSparkline(ScAddress(0, 6, 0), pSparklineGroup); sc::SparklineAttributes aNewAttributes; aNewAttributes.setType(sc::SparklineType::Stacked); - aNewAttributes.setColorSeries(model::ComplexColor::setRGB(COL_BLACK)); - aNewAttributes.setColorAxis(model::ComplexColor::setRGB(COL_BLUE)); + aNewAttributes.setColorSeries(model::ComplexColor::createRGB(COL_BLACK)); + aNewAttributes.setColorAxis(model::ComplexColor::createRGB(COL_BLUE)); sc::SparklineAttributes aInitialAttibutes(pSparklineGroup->getAttributes()); diff --git a/sc/source/filter/xml/SparklineGroupsImportContext.cxx b/sc/source/filter/xml/SparklineGroupsImportContext.cxx index 9292798a6f14..4f85ae1108c1 100644 --- a/sc/source/filter/xml/SparklineGroupsImportContext.cxx +++ b/sc/source/filter/xml/SparklineGroupsImportContext.cxx @@ -363,7 +363,7 @@ model::ComplexColor combineComplexColorAndColor(model::ComplexColor& rComplexCol if (rComplexColor.getType() != model::ColorType::Unused) rComplexColor.setFinalColor(aColor); else if (aColor != COL_TRANSPARENT) - rComplexColor = model::ComplexColor::setRGB(aColor); + rComplexColor = model::ComplexColor::createRGB(aColor); return rComplexColor; } } // end anonymous namespace diff --git a/sc/source/ui/sparklines/SparklineAttributes.cxx b/sc/source/ui/sparklines/SparklineAttributes.cxx index 31fd2daf3fdc..8a615c1f7b00 100644 --- a/sc/source/ui/sparklines/SparklineAttributes.cxx +++ b/sc/source/ui/sparklines/SparklineAttributes.cxx @@ -52,14 +52,14 @@ public: static constexpr Color COL_STANDARD_BLUE = 0x2a6099; Implementation() - : m_aColorSeries(model::ComplexColor::setRGB(COL_STANDARD_BLUE)) - , m_aColorNegative(model::ComplexColor::setRGB(COL_STANDARD_RED)) - , m_aColorAxis(model::ComplexColor::setRGB(COL_STANDARD_RED)) - , m_aColorMarkers(model::ComplexColor::setRGB(COL_STANDARD_RED)) - , m_aColorFirst(model::ComplexColor::setRGB(COL_STANDARD_RED)) - , m_aColorLast(model::ComplexColor::setRGB(COL_STANDARD_RED)) - , m_aColorHigh(model::ComplexColor::setRGB(COL_STANDARD_RED)) - , m_aColorLow(model::ComplexColor::setRGB(COL_STANDARD_RED)) + : m_aColorSeries(model::ComplexColor::createRGB(COL_STANDARD_BLUE)) + , m_aColorNegative(model::ComplexColor::createRGB(COL_STANDARD_RED)) + , m_aColorAxis(model::ComplexColor::createRGB(COL_STANDARD_RED)) + , m_aColorMarkers(model::ComplexColor::createRGB(COL_STANDARD_RED)) + , m_aColorFirst(model::ComplexColor::createRGB(COL_STANDARD_RED)) + , m_aColorLast(model::ComplexColor::createRGB(COL_STANDARD_RED)) + , m_aColorHigh(model::ComplexColor::createRGB(COL_STANDARD_RED)) + , m_aColorLow(model::ComplexColor::createRGB(COL_STANDARD_RED)) , m_eMinAxisType(AxisType::Individual) , m_eMaxAxisType(AxisType::Individual) , m_fLineWeight(0.75) commit 379ef16d3c1f205cb69d97a296589a2006c56ff5 Author: Mike Kaganski <[email protected]> AuthorDate: Fri Aug 4 12:02:13 2023 +0300 Commit: Mike Kaganski <[email protected]> CommitDate: Wed Jun 5 15:18:36 2024 +0500 Rename ComplexColor::RGB to setRGB, to avoid conflict with Windows define Affects Windows' no-pch builds. Change-Id: Ifff401df40854f59760bd398c156a8837b528efe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155340 Tested-by: Mike Kaganski <[email protected]> Reviewed-by: Mike Kaganski <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161283 Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/include/docmodel/color/ComplexColor.hxx b/include/docmodel/color/ComplexColor.hxx index 88ff7a42a478..1b93e34f7442 100644 --- a/include/docmodel/color/ComplexColor.hxx +++ b/include/docmodel/color/ComplexColor.hxx @@ -247,7 +247,7 @@ public: return seed; } - static model::ComplexColor RGB(Color const& rColor) + static model::ComplexColor setRGB(Color const& rColor) { model::ComplexColor aComplexColor; aComplexColor.setColor(rColor); diff --git a/oox/source/drawingml/color.cxx b/oox/source/drawingml/color.cxx index e582d4e53c77..79d27d8b21cb 100644 --- a/oox/source/drawingml/color.cxx +++ b/oox/source/drawingml/color.cxx @@ -828,7 +828,7 @@ model::ComplexColor Color::createComplexColor(const GraphicHelper& /*rGraphicHel else if (meMode == COLOR_RGB) { ::Color aColor(ColorTransparency, lclRgbComponentsToRgb(mnC1, mnC2, mnC3)); - aNewComplexColor = model::ComplexColor::RGB(aColor); + aNewComplexColor = model::ComplexColor::setRGB(aColor); } else { diff --git a/sc/qa/unit/ucalc_sparkline.cxx b/sc/qa/unit/ucalc_sparkline.cxx index cb9047267b81..e140a39d20b1 100644 --- a/sc/qa/unit/ucalc_sparkline.cxx +++ b/sc/qa/unit/ucalc_sparkline.cxx @@ -484,16 +484,16 @@ CPPUNIT_TEST_FIXTURE(SparklineTest, testUndoRedoEditSparklineGroup) { sc::SparklineAttributes& rAttibutes = pSparklineGroup->getAttributes(); rAttibutes.setType(sc::SparklineType::Column); - rAttibutes.setColorSeries(model::ComplexColor::RGB(COL_YELLOW)); - rAttibutes.setColorAxis(model::ComplexColor::RGB(COL_GREEN)); + rAttibutes.setColorSeries(model::ComplexColor::setRGB(COL_YELLOW)); + rAttibutes.setColorAxis(model::ComplexColor::setRGB(COL_GREEN)); } m_pDoc->CreateSparkline(ScAddress(0, 6, 0), pSparklineGroup); sc::SparklineAttributes aNewAttributes; aNewAttributes.setType(sc::SparklineType::Stacked); - aNewAttributes.setColorSeries(model::ComplexColor::RGB(COL_BLACK)); - aNewAttributes.setColorAxis(model::ComplexColor::RGB(COL_BLUE)); + aNewAttributes.setColorSeries(model::ComplexColor::setRGB(COL_BLACK)); + aNewAttributes.setColorAxis(model::ComplexColor::setRGB(COL_BLUE)); sc::SparklineAttributes aInitialAttibutes(pSparklineGroup->getAttributes()); diff --git a/sc/source/filter/xml/SparklineGroupsImportContext.cxx b/sc/source/filter/xml/SparklineGroupsImportContext.cxx index 59c24cdd45a4..9292798a6f14 100644 --- a/sc/source/filter/xml/SparklineGroupsImportContext.cxx +++ b/sc/source/filter/xml/SparklineGroupsImportContext.cxx @@ -363,7 +363,7 @@ model::ComplexColor combineComplexColorAndColor(model::ComplexColor& rComplexCol if (rComplexColor.getType() != model::ColorType::Unused) rComplexColor.setFinalColor(aColor); else if (aColor != COL_TRANSPARENT) - rComplexColor = model::ComplexColor::RGB(aColor); + rComplexColor = model::ComplexColor::setRGB(aColor); return rComplexColor; } } // end anonymous namespace diff --git a/sc/source/ui/sparklines/SparklineAttributes.cxx b/sc/source/ui/sparklines/SparklineAttributes.cxx index 080c38f5ee64..31fd2daf3fdc 100644 --- a/sc/source/ui/sparklines/SparklineAttributes.cxx +++ b/sc/source/ui/sparklines/SparklineAttributes.cxx @@ -52,14 +52,14 @@ public: static constexpr Color COL_STANDARD_BLUE = 0x2a6099; Implementation() - : m_aColorSeries(model::ComplexColor::RGB(COL_STANDARD_BLUE)) - , m_aColorNegative(model::ComplexColor::RGB(COL_STANDARD_RED)) - , m_aColorAxis(model::ComplexColor::RGB(COL_STANDARD_RED)) - , m_aColorMarkers(model::ComplexColor::RGB(COL_STANDARD_RED)) - , m_aColorFirst(model::ComplexColor::RGB(COL_STANDARD_RED)) - , m_aColorLast(model::ComplexColor::RGB(COL_STANDARD_RED)) - , m_aColorHigh(model::ComplexColor::RGB(COL_STANDARD_RED)) - , m_aColorLow(model::ComplexColor::RGB(COL_STANDARD_RED)) + : m_aColorSeries(model::ComplexColor::setRGB(COL_STANDARD_BLUE)) + , m_aColorNegative(model::ComplexColor::setRGB(COL_STANDARD_RED)) + , m_aColorAxis(model::ComplexColor::setRGB(COL_STANDARD_RED)) + , m_aColorMarkers(model::ComplexColor::setRGB(COL_STANDARD_RED)) + , m_aColorFirst(model::ComplexColor::setRGB(COL_STANDARD_RED)) + , m_aColorLast(model::ComplexColor::setRGB(COL_STANDARD_RED)) + , m_aColorHigh(model::ComplexColor::setRGB(COL_STANDARD_RED)) + , m_aColorLow(model::ComplexColor::setRGB(COL_STANDARD_RED)) , m_eMinAxisType(AxisType::Individual) , m_eMaxAxisType(AxisType::Individual) , m_fLineWeight(0.75)
