sc/inc/validat.hxx | 3 ++- sc/source/core/data/validat.cxx | 27 ++++++++++++++------------- sc/source/ui/app/inputhdl.cxx | 25 +++++++++++++++---------- sc/source/ui/inc/inputhdl.hxx | 2 ++ sw/source/uibase/docvw/PostItMgr.cxx | 6 ++++++ 5 files changed, 39 insertions(+), 24 deletions(-)
New commits: commit 1ee33246ae88f484e074a6ac15060cc41374ab5a Author: Pranam Lashkari <[email protected]> AuthorDate: Tue Dec 24 11:59:39 2024 +0530 Commit: Pranam Lashkari <[email protected]> CommitDate: Fri Jan 17 14:41:51 2025 +0100 lok: send username of the person who removed comments This can be userful to know when a user is editing comment and another user deletes it. It will help to identify and inform about the conflict to relevent users only Change-Id: I81f5edc8f6cbb85ad00e03b5bf668b68eeae1ad8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179298 Reviewed-by: Szymon Kłos <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> (cherry picked from commit 0b3e73526496875735eeb657929d94897a840b02) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180289 Tested-by: Jenkins Reviewed-by: Pranam Lashkari <[email protected]> diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx index 3c20f0b3a675..97098f197283 100644 --- a/sw/source/uibase/docvw/PostItMgr.cxx +++ b/sw/source/uibase/docvw/PostItMgr.cxx @@ -183,6 +183,12 @@ namespace { aAnnotation.put("textRange", sRects.getStr()); aAnnotation.put("layoutStatus", pItem->mLayoutStatus); } + if (nType == CommentNotificationType::Remove && comphelper::LibreOfficeKit::isActive()) + { + // Redline author is basically the author which has made the modification rather than author of the comments + // This is important to know who removed the comment + aAnnotation.put("author", SwModule::get()->GetRedlineAuthor(SwModule::get()->GetRedlineAuthor())); + } boost::property_tree::ptree aTree; aTree.add_child("comment", aAnnotation); commit 72bbb0dd4a368dab2b1bd99917cd07d23a92a3f0 Author: Pranam Lashkari <[email protected]> AuthorDate: Mon Dec 30 02:20:22 2024 +0530 Commit: Pranam Lashkari <[email protected]> CommitDate: Fri Jan 17 14:41:36 2025 +0100 sc: make data validy error dialog async (invalid value error) Change-Id: Icd077776b26e21b226b4dee5beb1a5ff6dcf301a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179509 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Caolán McNamara <[email protected]> (cherry picked from commit 495be2dcb34d22af59a2028d3a686a0d48774166) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180286 Tested-by: Jenkins Reviewed-by: Pranam Lashkari <[email protected]> diff --git a/sc/inc/validat.hxx b/sc/inc/validat.hxx index 4afd9e2ba8f2..863397f3ca57 100644 --- a/sc/inc/validat.hxx +++ b/sc/inc/validat.hxx @@ -159,7 +159,8 @@ public: OUString& rStrResult, double& nVal, sal_uInt32& nFormat, bool& bIsVal) const; // TRUE -> break - bool DoError(weld::Window* pParent, const OUString& rInput, const ScAddress& rPos) const; + void DoError(weld::Window* pParent, const OUString& rInput, const ScAddress& rPos, + std::function<void(bool forget)> callback) const; void DoCalcError( ScFormulaCell* pCell ) const; bool IsEmpty() const; diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx index a830da8cef34..744cee56adeb 100644 --- a/sc/source/core/data/validat.cxx +++ b/sc/source/core/data/validat.cxx @@ -245,10 +245,10 @@ bool ScValidationData::DoScript( const ScAddress& rPos, const OUString& rInput, // Macro not found (only with input) { //TODO: different error message, if found, but not bAllowed ?? - std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(pParent, + std::shared_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(pParent, VclMessageType::Warning, VclButtonsType::Ok, ScResId(STR_VALID_MACRONOTFOUND))); - xBox->run(); + xBox->runAsync(xBox, [] (sal_uInt32){ }); } return bScriptReturnedFalse; @@ -351,10 +351,10 @@ bool ScValidationData::DoMacro( const ScAddress& rPos, const OUString& rInput, if ( !bDone && !pCell ) // Macro not found (only with input) { //TODO: different error message, if found, but not bAllowed ?? - std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(pParent, + std::shared_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(pParent, VclMessageType::Warning, VclButtonsType::Ok, ScResId(STR_VALID_MACRONOTFOUND))); - xBox->run(); + xBox->runAsync(xBox, [](sal_uInt32) {}); } return bRet; @@ -373,14 +373,16 @@ IMPL_STATIC_LINK_NOARG(ScValidationData, InstallLOKNotifierHdl, void*, vcl::ILib // true -> abort -bool ScValidationData::DoError(weld::Window* pParent, const OUString& rInput, - const ScAddress& rPos) const +void ScValidationData::DoError(weld::Window* pParent, const OUString& rInput, const ScAddress& rPos, + std::function<void(bool forget)> callback) const { - if ( eErrorStyle == SC_VALERR_MACRO ) - return DoMacro(rPos, rInput, nullptr, pParent); + if ( eErrorStyle == SC_VALERR_MACRO ) { + DoMacro(rPos, rInput, nullptr, pParent); + return; + } if (!bShowError) - return true; + return; // Output error message @@ -407,7 +409,7 @@ bool ScValidationData::DoError(weld::Window* pParent, const OUString& rInput, break; } - std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(pParent, eType, + std::shared_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(pParent, eType, eStyle, aMessage, SfxViewShell::Current())); xBox->set_title(aTitle); xBox->SetInstallLOKNotifierHdl(LINK(nullptr, ScValidationData, InstallLOKNotifierHdl)); @@ -424,9 +426,8 @@ bool ScValidationData::DoError(weld::Window* pParent, const OUString& rInput, break; } - short nRet = xBox->run(); - - return ( eErrorStyle == SC_VALERR_STOP || nRet == RET_CANCEL ); + xBox->runAsync(xBox, [&, callback](sal_uInt32 result) + { callback(eErrorStyle == SC_VALERR_STOP || result == RET_CANCEL); }); } bool ScValidationData::IsDataValidCustom( diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index d62f61f0ef70..dece0aa45cec 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -3118,13 +3118,6 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode, bool bBeforeSavingInL ImplCreateEditEngine(); - bool bMatrix = ( nBlockMode == ScEnterMode::MATRIX ); - - SfxApplication* pSfxApp = SfxGetpApp(); - std::unique_ptr<EditTextObject> pObject; - std::unique_ptr<ScPatternAttr> pCellAttrs; - bool bForget = false; // Remove due to validity? - OUString aString = GetEditText(mpEditEngine.get()); OUString aPreAutoCorrectString(aString); EditView* pActiveView = pTopView ? pTopView : pTableView; @@ -3193,12 +3186,24 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode, bool bBeforeSavingInL return; } - if (pData->DoError(pActiveViewSh->GetFrameWeld(), aString, aCursorPos)) - bForget = true; // Do not take over input - + pData->DoError( + pActiveViewSh->GetFrameWeld(), aString, aCursorPos, + [this, nBlockMode, &aString, &aPreAutoCorrectString](bool bForget) + { EnterHandler2(nBlockMode, bForget, aString, aPreAutoCorrectString); }); + return; } } } + EnterHandler2(nBlockMode, false, aString, aPreAutoCorrectString); +} + +void ScInputHandler::EnterHandler2(ScEnterMode nBlockMode, bool bForget, OUString& aString, + OUString& aPreAutoCorrectString) +{ + std::unique_ptr<EditTextObject> pObject; + std::unique_ptr<ScPatternAttr> pCellAttrs; + bool bMatrix = (nBlockMode == ScEnterMode::MATRIX); + SfxApplication* pSfxApp = SfxGetpApp(); // Check for input into DataPilot table if ( bModified && !bForget ) diff --git a/sc/source/ui/inc/inputhdl.hxx b/sc/source/ui/inc/inputhdl.hxx index 3067dd819397..08fff9269dbd 100644 --- a/sc/source/ui/inc/inputhdl.hxx +++ b/sc/source/ui/inc/inputhdl.hxx @@ -198,6 +198,8 @@ public: bool KeyInput( const KeyEvent& rKEvt, bool bStartEdit ); void EnterHandler( ScEnterMode nBlockMode = ScEnterMode::NORMAL, bool bBeforeSavingInLOK = false ); + void EnterHandler2(ScEnterMode nBlockMode, bool bForget, OUString& aString, + OUString& aPreAutoCorrectString); void CancelHandler(); void SetReference( const ScRange& rRef, const ScDocument& rDoc ); void AddRefEntry();
