include/svx/ctredlin.hxx | 31 +++--- include/vcl/toolkit/treelist.hxx | 8 + sc/inc/chgviset.hxx | 8 - sc/source/core/tool/chgviset.cxx | 6 - sc/source/filter/xml/xmlimprt.cxx | 2 sc/source/ui/inc/acredlin.hxx | 8 - sc/source/ui/inc/conflictsdlg.hxx | 2 sc/source/ui/miscdlgs/acredlin.cxx | 52 +++++------ sc/source/ui/miscdlgs/conflictsdlg.cxx | 10 +- sc/source/ui/miscdlgs/highred.cxx | 2 sc/source/ui/view/viewutil.cxx | 14 +-- svx/source/dialog/ctredlin.cxx | 152 ++++++++++++++++----------------- sw/source/uibase/inc/redlndlg.hxx | 5 - sw/source/uibase/misc/redlndlg.cxx | 26 ++--- vcl/source/treelist/treelist.cxx | 5 - 15 files changed, 164 insertions(+), 167 deletions(-)
New commits: commit f6c75c2f1aa45ef3123f965e6e4ba75900b8ba35 Author: Michael Weghorn <[email protected]> AuthorDate: Sun Feb 1 00:26:56 2026 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Sun Feb 1 09:13:32 2026 +0100 svx: Rename RedlinTable -> RedlineTable etc. Rename some classes and members to spell out "Redline" instead of using "Redlin". Change-Id: I23d47a109e14ce8a7034e01d8e4f78fbee364d56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198474 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/include/svx/ctredlin.hxx b/include/svx/ctredlin.hxx index e4a383aecf12..471c2a126be8 100644 --- a/include/svx/ctredlin.hxx +++ b/include/svx/ctredlin.hxx @@ -44,7 +44,7 @@ namespace comphelper::string { class NaturalStringSorter; } class SvtCalendarBox; -enum class SvxRedlinDateMode +enum class SvxRedlineDateMode { BEFORE, SINCE, EQUAL, NOTEQUAL, BETWEEN, SAVE, NONE }; @@ -69,18 +69,18 @@ enum class RedlineType : sal_uInt16 SVX_DLLPUBLIC std::ostream& operator<<(std::ostream& rStream, const RedlineType& eType); /// Struct for sorting data. -class SAL_WARN_UNUSED SVX_DLLPUBLIC RedlinData +class SAL_WARN_UNUSED SVX_DLLPUBLIC RedlineData { public: - RedlinData(); - virtual ~RedlinData(); + RedlineData(); + virtual ~RedlineData(); DateTime aDateTime; void* pData; RedlineType eType; bool bDisabled; }; -class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxRedlinTable +class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxRedlineTable { private: std::unique_ptr<comphelper::string::NaturalStringSorter> m_xSorter; @@ -95,7 +95,7 @@ private: bool m_bDate; bool m_bComment; bool m_bSorted; - SvxRedlinDateMode m_nDaTiMode; + SvxRedlineDateMode m_nDaTiMode; DateTime m_aDaTiFirst; DateTime m_aDaTiLast; DateTime m_aDaTiFilterFirst; @@ -106,18 +106,17 @@ private: int ColCompare(const weld::TreeIter& rLeft, const weld::TreeIter& rRight); public: - SvxRedlinTable(std::unique_ptr<weld::TreeView> xWriterControl, - std::unique_ptr<weld::TreeView> xCalcControl, - weld::ComboBox* pSortByControl); + SvxRedlineTable(std::unique_ptr<weld::TreeView> xWriterControl, + std::unique_ptr<weld::TreeView> xCalcControl, weld::ComboBox* pSortByControl); weld::TreeView& GetWidget() { return *m_pTreeView; } bool IsSorted() const { return m_bSorted; } - ~SvxRedlinTable(); + ~SvxRedlineTable(); // For FilterPage only { void SetFilterDate(bool bFlag); - void SetDateTimeMode(SvxRedlinDateMode nMode); + void SetDateTimeMode(SvxRedlineDateMode nMode); void SetFirstDate(const Date&); void SetLastDate(const Date&); void SetFirstTime(const tools::Time&); @@ -165,7 +164,7 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxTPFilter final : public SvxTPage bool m_bModified; - SvxRedlinTable* m_pRedlinTable; + SvxRedlineTable* m_pRedlineTable; std::unique_ptr<weld::CheckButton> m_xCbDate; std::unique_ptr<weld::ComboBox> m_xLbDate; std::unique_ptr<SvtCalendarBox> m_xDfDate; @@ -204,7 +203,7 @@ public: virtual ~SvxTPFilter() override; void DeactivatePage(); - void SetRedlinTable(SvxRedlinTable*); + void SetRedlineTable(SvxRedlineTable*); Date GetFirstDate() const; void SetFirstDate(const Date &aDate); @@ -217,7 +216,7 @@ public: void SetLastTime(const tools::Time &aTime); void SetDateMode(sal_uInt16 nMode); - SvxRedlinDateMode GetDateMode() const; + SvxRedlineDateMode GetDateMode() const; void ClearAuthors(); void InsertAuthor( const OUString& rString ); @@ -287,7 +286,7 @@ private: std::unique_ptr<weld::Button> m_xRejectAll; std::unique_ptr<weld::Button> m_xUndo; std::unique_ptr<weld::ComboBox> m_xSortByComboBox; - std::unique_ptr<SvxRedlinTable> m_xViewData; + std::unique_ptr<SvxRedlineTable> m_xViewData; DECL_DLLPRIVATE_LINK( PbClickHdl, weld::Button&, void ); DECL_DLLPRIVATE_LINK(SortByComboBoxChangedHdl, weld::ComboBox&, void); @@ -296,7 +295,7 @@ public: SvxTPView(weld::Container* pParent); virtual ~SvxTPView() override; - SvxRedlinTable* GetTableControl() { return m_xViewData.get(); } + SvxRedlineTable* GetTableControl() { return m_xViewData.get(); } weld::ComboBox* GetSortByComboBoxControl() { return m_xSortByComboBox.get(); } diff --git a/sc/inc/chgviset.hxx b/sc/inc/chgviset.hxx index 88f817b970a5..f994b7035b3d 100644 --- a/sc/inc/chgviset.hxx +++ b/sc/inc/chgviset.hxx @@ -39,7 +39,7 @@ private: OUString aAuthorToShow; OUString aComment; ScRangeList aRangeList; - SvxRedlinDateMode eDateMode; + SvxRedlineDateMode eDateMode; bool bShowIt; bool bIsDate; bool bIsAuthor; @@ -56,7 +56,7 @@ public: ScChangeViewSettings() : aFirstDateTime(DateTime::EMPTY) , aLastDateTime(DateTime::EMPTY) - , eDateMode(SvxRedlinDateMode::BEFORE) + , eDateMode(SvxRedlineDateMode::BEFORE) , bShowIt(false) , bIsDate(false) , bIsAuthor(false) @@ -80,8 +80,8 @@ public: bool HasDate() const {return bIsDate;} void SetHasDate(bool bFlag) {bIsDate=bFlag;} - void SetTheDateMode(SvxRedlinDateMode eDatMod){ eDateMode=eDatMod; } - SvxRedlinDateMode GetTheDateMode() const { return eDateMode; } + void SetTheDateMode(SvxRedlineDateMode eDatMod) { eDateMode = eDatMod; } + SvxRedlineDateMode GetTheDateMode() const { return eDateMode; } void SetTheFirstDateTime(const DateTime& aDateTime) {aFirstDateTime=aDateTime;} const DateTime& GetTheFirstDateTime()const {return aFirstDateTime;} diff --git a/sc/source/core/tool/chgviset.cxx b/sc/source/core/tool/chgviset.cxx index 1e35922e90a8..0f2877954b36 100644 --- a/sc/source/core/tool/chgviset.cxx +++ b/sc/source/core/tool/chgviset.cxx @@ -106,13 +106,13 @@ void ScChangeViewSettings::AdjustDateMode( const ScDocument& rDoc ) { switch ( eDateMode ) { // corresponds with ScViewUtil::IsActionShown - case SvxRedlinDateMode::EQUAL : - case SvxRedlinDateMode::NOTEQUAL : + case SvxRedlineDateMode::EQUAL: + case SvxRedlineDateMode::NOTEQUAL: aFirstDateTime.SetTime( 0 ); aLastDateTime = aFirstDateTime; aLastDateTime.SetTime( 23595999 ); break; - case SvxRedlinDateMode::SAVE: + case SvxRedlineDateMode::SAVE: { const ScChangeAction* pLast = nullptr; ScChangeTrack* pTrack = rDoc.GetChangeTrack(); diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index 65123c53b1f4..c9bf323bf681 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -639,7 +639,7 @@ void ScXMLImport::SetChangeTrackingViewSettings(const css::uno::Sequence<css::be else if (sName == "ShowChangesByDatetimeMode") { if (rChangeProp.Value >>= nTemp16) - aViewSettings.SetTheDateMode(static_cast<SvxRedlinDateMode>(nTemp16)); + aViewSettings.SetTheDateMode(static_cast<SvxRedlineDateMode>(nTemp16)); } else if (sName == "ShowChangesByDatetimeFirstDatetime") { diff --git a/sc/source/ui/inc/acredlin.hxx b/sc/source/ui/inc/acredlin.hxx index 8cf104fecf80..ca6b4a20009a 100644 --- a/sc/source/ui/inc/acredlin.hxx +++ b/sc/source/ui/inc/acredlin.hxx @@ -31,11 +31,11 @@ class ScDocument; struct SfxChildWinInfo; -class ScRedlinData : public RedlinData +class ScRedlineData : public RedlineData { public: - ScRedlinData(); - virtual ~ScRedlinData() override; + ScRedlineData(); + virtual ~ScRedlineData() override; sal_uLong nActionNo; sal_uLong nInfo; SCTAB nTable; @@ -78,7 +78,7 @@ class ScAcceptChgDlg final : public SfxModelessDialogController bool bUseColor:1; SvxTPFilter* pTPFilter; - SvxRedlinTable* pTheView; + SvxRedlineTable* pTheView; std::unique_ptr<weld::Container> m_xContentArea; std::unique_ptr<weld::Menu> m_xPopup, m_xSortMenu; diff --git a/sc/source/ui/inc/conflictsdlg.hxx b/sc/source/ui/inc/conflictsdlg.hxx index 95879d4aebdb..8972bc43d3e3 100644 --- a/sc/source/ui/inc/conflictsdlg.hxx +++ b/sc/source/ui/inc/conflictsdlg.hxx @@ -120,7 +120,7 @@ private: std::unique_ptr<weld::Button> m_xBtnKeepOther; std::unique_ptr<weld::Button> m_xBtnKeepAllMine; std::unique_ptr<weld::Button> m_xBtnKeepAllOthers; - std::unique_ptr<SvxRedlinTable> m_xLbConflicts; + std::unique_ptr<SvxRedlineTable> m_xLbConflicts; OUString GetConflictString( const ScConflictsListEntry& rConflictEntry ); void SetActionString(ScChangeAction& rAction, ScDocument& rDoc, const weld::TreeIter& rEntry); diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx index 833289da2be7..7a90157239b1 100644 --- a/sc/source/ui/miscdlgs/acredlin.cxx +++ b/sc/source/ui/miscdlgs/acredlin.cxx @@ -43,7 +43,7 @@ #define RD_SPECIAL_VISCONTENT 2 -ScRedlinData::ScRedlinData() +ScRedlineData::ScRedlineData() { nInfo=RD_SPECIAL_NONE; nActionNo=0; @@ -56,7 +56,7 @@ ScRedlinData::ScRedlinData() nRow=SCROW_MAX; } -ScRedlinData::~ScRedlinData() +ScRedlineData::~ScRedlineData() { nInfo=RD_SPECIAL_NONE; nActionNo=0; @@ -272,7 +272,7 @@ void ScAcceptChgDlg::ClearView() rTreeView.all_foreach( [&rTreeView](weld::TreeIter& rEntry) { - ScRedlinData *pEntryData = weld::fromId<ScRedlinData*>(rTreeView.get_id(rEntry)); + ScRedlineData* pEntryData = weld::fromId<ScRedlineData*>(rTreeView.get_id(rEntry)); delete pEntryData; return false; }); @@ -370,7 +370,7 @@ std::unique_ptr<weld::TreeIter> ScAcceptChgDlg::AppendChangeAction( OUString aDate; OUString aDesc; - std::unique_ptr<ScRedlinData> pNewData(new ScRedlinData); + std::unique_ptr<ScRedlineData> pNewData(new ScRedlineData); pNewData->pData=const_cast<ScChangeAction *>(pScChangeAction); pNewData->nActionNo=pScChangeAction->GetActionNumber(); pNewData->bIsAcceptable=pScChangeAction->IsClickable(); @@ -534,7 +534,7 @@ std::unique_ptr<weld::TreeIter> ScAcceptChgDlg::AppendFilteredAction( OUString aActionString; OUString aDesc; - std::unique_ptr<ScRedlinData> pNewData(new ScRedlinData); + std::unique_ptr<ScRedlineData> pNewData(new ScRedlineData); pNewData->pData=const_cast<ScChangeAction *>(pScChangeAction); pNewData->nActionNo=pScChangeAction->GetActionNumber(); pNewData->bIsAcceptable=pScChangeAction->IsClickable(); @@ -678,7 +678,7 @@ std::unique_ptr<weld::TreeIter> ScAcceptChgDlg::InsertChangeActionContent(const aComment += " (" + aDesc + ")"; } - std::unique_ptr<ScRedlinData> pNewData(new ScRedlinData); + std::unique_ptr<ScRedlineData> pNewData(new ScRedlineData); pNewData->nInfo=nSpecial; pNewData->pData=const_cast<ScChangeActionContent *>(pScChangeAction); pNewData->nActionNo=pScChangeAction->GetActionNumber(); @@ -855,7 +855,7 @@ IMPL_LINK( ScAcceptChgDlg, RejectHandle, SvxTPView*, pRef, void ) { weld::TreeView& rTreeView = pTheView->GetWidget(); rTreeView.selected_foreach([this, pChanges, &rTreeView](weld::TreeIter& rEntry){ - ScRedlinData *pEntryData = weld::fromId<ScRedlinData*>(rTreeView.get_id(rEntry)); + ScRedlineData* pEntryData = weld::fromId<ScRedlineData*>(rTreeView.get_id(rEntry)); if (pEntryData) { ScChangeAction* pScChangeAction= static_cast<ScChangeAction*>(pEntryData->pData); @@ -888,7 +888,7 @@ IMPL_LINK( ScAcceptChgDlg, AcceptHandle, SvxTPView*, pRef, void ) { weld::TreeView& rTreeView = pTheView->GetWidget(); rTreeView.selected_foreach([pChanges, &rTreeView](weld::TreeIter& rEntry) { - ScRedlinData *pEntryData = weld::fromId<ScRedlinData*>(rTreeView.get_id(rEntry)); + ScRedlineData *pEntryData = weld::fromId<ScRedlineData*>(rTreeView.get_id(rEntry)); if (pEntryData) { ScChangeAction* pScChangeAction= @@ -1023,7 +1023,7 @@ void ScAcceptChgDlg::GetDependents(const ScChangeAction* pScChangeAction, std::unique_ptr<weld::TreeIter> xParent(rTreeView.make_iterator(&rEntry)); if (rTreeView.iter_parent(*xParent)) { - ScRedlinData *pParentData = weld::fromId<ScRedlinData*>(rTreeView.get_id(*xParent)); + ScRedlineData* pParentData = weld::fromId<ScRedlineData*>(rTreeView.get_id(*xParent)); ScChangeAction* pParentAction=static_cast<ScChangeAction*>(pParentData->pData); if(pParentAction!=pScChangeAction) @@ -1042,7 +1042,7 @@ bool ScAcceptChgDlg::InsertContentChildren(ScChangeActionMap* pActionMap, const { bool bTheTestFlag = true; weld::TreeView& rTreeView = pTheView->GetWidget(); - ScRedlinData *pEntryData = weld::fromId<ScRedlinData*>(rTreeView.get_id(rParent)); + ScRedlineData* pEntryData = weld::fromId<ScRedlineData*>(rTreeView.get_id(rParent)); const ScChangeAction* pScChangeAction = static_cast<ScChangeAction*>(pEntryData->pData); bool bParentInserted = false; // If the parent is a MatrixOrigin then place it in the right order before @@ -1071,7 +1071,7 @@ bool ScAcceptChgDlg::InsertContentChildren(ScChangeActionMap* pActionMap, const if (xOriginal) { bTheTestFlag=false; - ScRedlinData *pParentData = weld::fromId<ScRedlinData*>(rTreeView.get_id(*xOriginal)); + ScRedlineData* pParentData = weld::fromId<ScRedlineData*>(rTreeView.get_id(*xOriginal)); pParentData->pData=const_cast<ScChangeAction *>(pScChangeAction); pParentData->nActionNo=pScChangeAction->GetActionNumber(); pParentData->bIsAcceptable=pScChangeAction->IsRejectable(); // select old value @@ -1101,7 +1101,7 @@ bool ScAcceptChgDlg::InsertContentChildren(ScChangeActionMap* pActionMap, const if (xEntry) { bTheTestFlag=false; - ScRedlinData *pParentData = weld::fromId<ScRedlinData*>(rTreeView.get_id(*xEntry)); + ScRedlineData* pParentData = weld::fromId<ScRedlineData*>(rTreeView.get_id(*xEntry)); pParentData->pData=const_cast<ScChangeAction *>(pScChangeAction); pParentData->nActionNo=pScChangeAction->GetActionNumber(); pParentData->bIsAcceptable=pScChangeAction->IsClickable(); @@ -1156,7 +1156,7 @@ bool ScAcceptChgDlg::InsertChildren(ScChangeActionMap* pActionMap, const weld::T bTheTestFlag=false; weld::TreeView& rTreeView = pTheView->GetWidget(); - ScRedlinData *pEntryData = weld::fromId<ScRedlinData*>(rTreeView.get_id(*xEntry)); + ScRedlineData* pEntryData = weld::fromId<ScRedlineData*>(rTreeView.get_id(*xEntry)); pEntryData->bIsRejectable=false; pEntryData->bIsAcceptable=false; pEntryData->bDisabled=true; @@ -1186,7 +1186,7 @@ bool ScAcceptChgDlg::InsertDeletedChildren(const ScChangeAction* pScChangeAction if (xEntry) { weld::TreeView& rTreeView = pTheView->GetWidget(); - ScRedlinData *pEntryData = weld::fromId<ScRedlinData*>(rTreeView.get_id(*xEntry)); + ScRedlineData* pEntryData = weld::fromId<ScRedlineData*>(rTreeView.get_id(*xEntry)); pEntryData->bIsRejectable=false; pEntryData->bIsAcceptable=false; pEntryData->bDisabled=true; @@ -1247,7 +1247,7 @@ IMPL_LINK(ScAcceptChgDlg, ExpandingHandle, const weld::TreeIter&, rEntry, bool) m_xDialog->set_busy_cursor(true); ScChangeActionMap aActionMap; weld::TreeView& rTreeView = pTheView->GetWidget(); - ScRedlinData *pEntryData = weld::fromId<ScRedlinData*>(rTreeView.get_id(rEntry)); + ScRedlineData* pEntryData = weld::fromId<ScRedlineData*>(rTreeView.get_id(rEntry)); if (!rTreeView.iter_has_child(rEntry)) { bool bTheTestFlag = true; @@ -1374,9 +1374,9 @@ void ScAcceptChgDlg::RemoveEntries(sal_uLong nStartAction,sal_uLong nEndAction) { weld::TreeView& rTreeView = pTheView->GetWidget(); - ScRedlinData *pEntryData=nullptr; + ScRedlineData* pEntryData = nullptr; if (std::unique_ptr<weld::TreeIter> xEntry = rTreeView.get_cursor()) - pEntryData = weld::fromId<ScRedlinData*>(rTreeView.get_id(*xEntry)); + pEntryData = weld::fromId<ScRedlineData*>(rTreeView.get_id(*xEntry)); std::unique_ptr<weld::TreeIter> xEntry = rTreeView.make_iterator(); if (!rTreeView.get_iter_first(*xEntry)) @@ -1394,7 +1394,7 @@ void ScAcceptChgDlg::RemoveEntries(sal_uLong nStartAction,sal_uLong nEndAction) do { OUString sId(rTreeView.get_id(*xEntry)); - pEntryData = weld::fromId<ScRedlinData*>(sId); + pEntryData = weld::fromId<ScRedlineData*>(sId); if (pEntryData) { nAction = pEntryData->nActionNo; @@ -1431,7 +1431,7 @@ void ScAcceptChgDlg::UpdateEntries(const ScChangeTrack* pChgTrack, sal_uLong nSt while (bEntry) { bool bRemove = false; - ScRedlinData *pEntryData = weld::fromId<ScRedlinData*>(rTreeView.get_id(*xEntry)); + ScRedlineData* pEntryData = weld::fromId<ScRedlineData*>(rTreeView.get_id(*xEntry)); if (pEntryData) { ScChangeAction* pScChangeAction= @@ -1535,7 +1535,7 @@ IMPL_LINK_NOARG(ScAcceptChgDlg, UpdateSelectionHdl, Timer *, void) weld::TreeView& rTreeView = pTheView->GetWidget(); std::vector<const ScChangeAction*> aActions; rTreeView.selected_foreach([&rTreeView, &bAcceptFlag, &bRejectFlag, &aActions](weld::TreeIter& rEntry){ - ScRedlinData* pEntryData = weld::fromId<ScRedlinData*>(rTreeView.get_id(rEntry)); + ScRedlineData* pEntryData = weld::fromId<ScRedlineData*>(rTreeView.get_id(rEntry)); if (pEntryData) { bRejectFlag &= pEntryData->bIsRejectable; @@ -1592,7 +1592,7 @@ IMPL_LINK(ScAcceptChgDlg, CommandHdl, const CommandEvent&, rCEvt, bool) if (pDoc->IsDocEditable() && xEntry) { - ScRedlinData *pEntryData = weld::fromId<ScRedlinData*>(rTreeView.get_id(*xEntry)); + ScRedlineData* pEntryData = weld::fromId<ScRedlineData*>(rTreeView.get_id(*xEntry)); if (pEntryData) { ScChangeAction* pScChangeAction = static_cast<ScChangeAction*>(pEntryData->pData); @@ -1609,7 +1609,7 @@ IMPL_LINK(ScAcceptChgDlg, CommandHdl, const CommandEvent&, rCEvt, bool) { if (xEntry) { - ScRedlinData *pEntryData = weld::fromId<ScRedlinData*>(rTreeView.get_id(*xEntry)); + ScRedlineData* pEntryData = weld::fromId<ScRedlineData*>(rTreeView.get_id(*xEntry)); if (pEntryData) { ScChangeAction* pScChangeAction = static_cast<ScChangeAction*>(pEntryData->pData); @@ -1733,8 +1733,8 @@ int ScAcceptChgDlg::ColCompareHdl(const weld::TreeIter& rLeft, const weld::TreeI if (CALC_DATE == nSortCol) { - RedlinData *pLeftData = weld::fromId<RedlinData*>(rTreeView.get_id(rLeft)); - RedlinData *pRightData = weld::fromId<RedlinData*>(rTreeView.get_id(rRight)); + RedlineData* pLeftData = weld::fromId<RedlineData*>(rTreeView.get_id(rLeft)); + RedlineData* pRightData = weld::fromId<RedlineData*>(rTreeView.get_id(rRight)); if (pLeftData && pRightData) { if(pLeftData->aDateTime < pRightData->aDateTime) @@ -1746,8 +1746,8 @@ int ScAcceptChgDlg::ColCompareHdl(const weld::TreeIter& rLeft, const weld::TreeI } else if (CALC_POS == nSortCol) { - ScRedlinData *pLeftData = weld::fromId<ScRedlinData*>(rTreeView.get_id(rLeft)); - ScRedlinData *pRightData = weld::fromId<ScRedlinData*>(rTreeView.get_id(rRight)); + ScRedlineData* pLeftData = weld::fromId<ScRedlineData*>(rTreeView.get_id(rLeft)); + ScRedlineData* pRightData = weld::fromId<ScRedlineData*>(rTreeView.get_id(rRight)); if (pLeftData && pRightData) { nCompare = 1; diff --git a/sc/source/ui/miscdlgs/conflictsdlg.cxx b/sc/source/ui/miscdlgs/conflictsdlg.cxx index 4f9b8af4d024..8731f06aa293 100644 --- a/sc/source/ui/miscdlgs/conflictsdlg.cxx +++ b/sc/source/ui/miscdlgs/conflictsdlg.cxx @@ -332,7 +332,7 @@ ScConflictsDlg::ScConflictsDlg(weld::Window* pParent, ScViewData& rViewData, ScD , m_xBtnKeepOther(m_xBuilder->weld_button(u"keepother"_ustr)) , m_xBtnKeepAllMine(m_xBuilder->weld_button(u"keepallmine"_ustr)) , m_xBtnKeepAllOthers(m_xBuilder->weld_button(u"keepallothers"_ustr)) - , m_xLbConflicts(new SvxRedlinTable(m_xBuilder->weld_tree_view(u"container"_ustr), nullptr, + , m_xLbConflicts(new SvxRedlineTable(m_xBuilder->weld_tree_view(u"container"_ustr), nullptr, nullptr)) { @@ -454,7 +454,7 @@ IMPL_LINK_NOARG(ScConflictsDlg, UpdateSelectionHdl, Timer *, void) rTreeView.selected_foreach([&rTreeView, &aActions](weld::TreeIter& rEntry){ if (rTreeView.get_iter_depth(rEntry)) { - RedlinData* pUserData = weld::fromId<RedlinData*>(rTreeView.get_id(rEntry)); + RedlineData* pUserData = weld::fromId<RedlineData*>(rTreeView.get_id(rEntry)); if (pUserData) { ScChangeAction* pAction = static_cast< ScChangeAction* >( pUserData->pData ); @@ -484,7 +484,7 @@ IMPL_LINK_NOARG(ScConflictsDlg, UpdateSelectionHdl, Timer *, void) void ScConflictsDlg::SetConflictAction(const weld::TreeIter& rRootEntry, ScConflictAction eConflictAction) { weld::TreeView& rTreeView = m_xLbConflicts->GetWidget(); - RedlinData* pUserData = weld::fromId<RedlinData*>(rTreeView.get_id(rRootEntry)); + RedlineData* pUserData = weld::fromId<RedlineData*>(rTreeView.get_id(rRootEntry)); ScConflictsListEntry* pConflictEntry = static_cast< ScConflictsListEntry* >( pUserData ? pUserData->pData : nullptr ); if ( pConflictEntry ) { @@ -565,7 +565,7 @@ void ScConflictsDlg::UpdateView() { if (rConflictEntry.meConflictAction == SC_CONFLICT_ACTION_NONE) { - std::unique_ptr<RedlinData> pRootUserData(new RedlinData()); + std::unique_ptr<RedlineData> pRootUserData(new RedlineData()); pRootUserData->pData = static_cast<void*>(&rConflictEntry); OUString sString(GetConflictString(rConflictEntry)); OUString sId(weld::toId(pRootUserData.release())); @@ -611,7 +611,7 @@ void ScConflictsDlg::UpdateView() } } - std::unique_ptr<RedlinData> pUserData(new RedlinData()); + std::unique_ptr<RedlineData> pUserData(new RedlineData()); pUserData->pData = static_cast< void* >( pAction ); OUString aId(weld::toId(pUserData.release())); rTreeView.insert(xRootEntry.get(), -1, nullptr, &aId, nullptr, nullptr, false, xEntry.get()); diff --git a/sc/source/ui/miscdlgs/highred.cxx b/sc/source/ui/miscdlgs/highred.cxx index 742828c70cff..d0504583a958 100644 --- a/sc/source/ui/miscdlgs/highred.cxx +++ b/sc/source/ui/miscdlgs/highred.cxx @@ -194,7 +194,7 @@ IMPL_LINK_NOARG(ScHighlightChgDlg, OKBtnHdl, weld::Button&, void) { aChangeViewSet.SetShowChanges(m_xHighlightBox->get_active()); aChangeViewSet.SetHasDate(m_xFilterCtr->IsDate()); - SvxRedlinDateMode eMode = m_xFilterCtr->GetDateMode(); + SvxRedlineDateMode eMode = m_xFilterCtr->GetDateMode(); aChangeViewSet.SetTheDateMode( eMode ); Date aFirstDate( m_xFilterCtr->GetFirstDate() ); tools::Time aFirstTime( m_xFilterCtr->GetFirstTime() ); diff --git a/sc/source/ui/view/viewutil.cxx b/sc/source/ui/view/viewutil.cxx index 2eea9a2caad0..917f69dc9a47 100644 --- a/sc/source/ui/view/viewutil.cxx +++ b/sc/source/ui/view/viewutil.cxx @@ -161,35 +161,35 @@ bool ScViewUtil::IsActionShown( const ScChangeAction& rAction, if ( !rSettings.GetTheRangeList().Intersects( rAction.GetBigRange().MakeRange( rDocument ) ) ) return false; - if (rSettings.HasDate() && rSettings.GetTheDateMode() != SvxRedlinDateMode::NONE) + if (rSettings.HasDate() && rSettings.GetTheDateMode() != SvxRedlineDateMode::NONE) { DateTime aDateTime = rAction.GetDateTime(); const DateTime& rFirst = rSettings.GetTheFirstDateTime(); const DateTime& rLast = rSettings.GetTheLastDateTime(); switch ( rSettings.GetTheDateMode() ) { // corresponds with ScHighlightChgDlg::OKBtnHdl - case SvxRedlinDateMode::BEFORE: + case SvxRedlineDateMode::BEFORE: if ( aDateTime > rFirst ) return false; break; - case SvxRedlinDateMode::SINCE: + case SvxRedlineDateMode::SINCE: if ( aDateTime < rFirst ) return false; break; - case SvxRedlinDateMode::EQUAL: - case SvxRedlinDateMode::BETWEEN: + case SvxRedlineDateMode::EQUAL: + case SvxRedlineDateMode::BETWEEN: if ( aDateTime < rFirst || aDateTime > rLast ) return false; break; - case SvxRedlinDateMode::NOTEQUAL: + case SvxRedlineDateMode::NOTEQUAL: if ( aDateTime >= rFirst && aDateTime <= rLast ) return false; break; - case SvxRedlinDateMode::SAVE: + case SvxRedlineDateMode::SAVE: { ScChangeTrack* pTrack = rDocument.GetChangeTrack(); if ( !pTrack || pTrack->GetLastSavedActionNumber() >= diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx index 1e74164ffdb0..a54bb1d0f479 100644 --- a/svx/source/dialog/ctredlin.cxx +++ b/svx/source/dialog/ctredlin.cxx @@ -35,7 +35,7 @@ #define WRITER_DATE 2 #define CALC_DATE 3 -RedlinData::RedlinData() +RedlineData::RedlineData() : aDateTime(DateTime::EMPTY) , pData(nullptr) , eType(RedlineType::Any) @@ -43,11 +43,11 @@ RedlinData::RedlinData() { } -RedlinData::~RedlinData() +RedlineData::~RedlineData() { } -SvxRedlinTable::SvxRedlinTable(std::unique_ptr<weld::TreeView> xWriterControl, +SvxRedlineTable::SvxRedlineTable(std::unique_ptr<weld::TreeView> xWriterControl, std::unique_ptr<weld::TreeView> xCalcControl, weld::ComboBox* pSortByControl) : m_xSorter(new comphelper::string::NaturalStringSorter(::comphelper::getProcessComponentContext(), @@ -61,7 +61,7 @@ SvxRedlinTable::SvxRedlinTable(std::unique_ptr<weld::TreeView> xWriterControl, , m_bDate(false) , m_bComment(false) , m_bSorted(false) - , m_nDaTiMode(SvxRedlinDateMode::BEFORE) + , m_nDaTiMode(SvxRedlineDateMode::BEFORE) , m_aDaTiFirst( DateTime::EMPTY ) , m_aDaTiLast( DateTime::EMPTY ) , m_aDaTiFilterFirst( DateTime::EMPTY ) @@ -70,7 +70,7 @@ SvxRedlinTable::SvxRedlinTable(std::unique_ptr<weld::TreeView> xWriterControl, if (m_xWriterTreeView) { m_xWriterTreeView->set_size_request(-1, m_xWriterTreeView->get_height_rows(8)); - m_xWriterTreeView->connect_column_clicked(LINK(this, SvxRedlinTable, HeaderBarClick)); + m_xWriterTreeView->connect_column_clicked(LINK(this, SvxRedlineTable, HeaderBarClick)); m_xWriterTreeView->set_sort_func([this](const weld::TreeIter& rLeft, const weld::TreeIter& rRight){ return ColCompare(rLeft, rRight); }); @@ -79,7 +79,7 @@ SvxRedlinTable::SvxRedlinTable(std::unique_ptr<weld::TreeView> xWriterControl, if (m_xCalcTreeView) { m_xCalcTreeView->set_size_request(-1, m_xCalcTreeView->get_height_rows(8)); - m_xCalcTreeView->connect_column_clicked(LINK(this, SvxRedlinTable, HeaderBarClick)); + m_xCalcTreeView->connect_column_clicked(LINK(this, SvxRedlineTable, HeaderBarClick)); m_xCalcTreeView->set_sort_func([this](const weld::TreeIter& rLeft, const weld::TreeIter& rRight){ return ColCompare(rLeft, rRight); }); @@ -87,11 +87,11 @@ SvxRedlinTable::SvxRedlinTable(std::unique_ptr<weld::TreeView> xWriterControl, } } -SvxRedlinTable::~SvxRedlinTable() +SvxRedlineTable::~SvxRedlineTable() { } -IMPL_LINK(SvxRedlinTable, HeaderBarClick, int, nColumn, void) +IMPL_LINK(SvxRedlineTable, HeaderBarClick, int, nColumn, void) { if (nColumn == -1) { @@ -129,7 +129,7 @@ IMPL_LINK(SvxRedlinTable, HeaderBarClick, int, nColumn, void) } } -int SvxRedlinTable::ColCompare(const weld::TreeIter& rLeft, const weld::TreeIter& rRight) +int SvxRedlineTable::ColCompare(const weld::TreeIter& rLeft, const weld::TreeIter& rRight) { sal_Int32 nCompare = 0; @@ -137,8 +137,8 @@ int SvxRedlinTable::ColCompare(const weld::TreeIter& rLeft, const weld::TreeIter if (m_pTreeView == m_xWriterTreeView.get() && nSortCol == 0) { - RedlinData *pLeftData = weld::fromId<RedlinData*>(m_pTreeView->get_id(rLeft)); - RedlinData *pRightData = weld::fromId<RedlinData*>(m_pTreeView->get_id(rRight)); + RedlineData* pLeftData = weld::fromId<RedlineData*>(m_pTreeView->get_id(rLeft)); + RedlineData* pRightData = weld::fromId<RedlineData*>(m_pTreeView->get_id(rRight)); if (pLeftData && pRightData) { @@ -152,8 +152,8 @@ int SvxRedlinTable::ColCompare(const weld::TreeIter& rLeft, const weld::TreeIter if (nSortCol == m_nDatePos) { - RedlinData *pLeftData = weld::fromId<RedlinData*>(m_pTreeView->get_id(rLeft)); - RedlinData *pRightData = weld::fromId<RedlinData*>(m_pTreeView->get_id(rRight)); + RedlineData* pLeftData = weld::fromId<RedlineData*>(m_pTreeView->get_id(rLeft)); + RedlineData* pRightData = weld::fromId<RedlineData*>(m_pTreeView->get_id(rRight)); if (pLeftData && pRightData) { @@ -169,7 +169,7 @@ int SvxRedlinTable::ColCompare(const weld::TreeIter& rLeft, const weld::TreeIter m_pTreeView->get_text(rRight, nSortCol)); } -void SvxRedlinTable::UpdateFilterTest() +void SvxRedlineTable::UpdateFilterTest() { Date aDateMax( Date::SYSTEM ); aDateMax.AddYears(100); @@ -182,77 +182,77 @@ void SvxRedlinTable::UpdateFilterTest() switch(m_nDaTiMode) { - case SvxRedlinDateMode::BEFORE: + case SvxRedlineDateMode::BEFORE: m_aDaTiFilterFirst=aDTMin; m_aDaTiFilterLast=m_aDaTiFirst; break; - case SvxRedlinDateMode::SAVE: - case SvxRedlinDateMode::SINCE: + case SvxRedlineDateMode::SAVE: + case SvxRedlineDateMode::SINCE: m_aDaTiFilterFirst=m_aDaTiFirst; m_aDaTiFilterLast=aDTMax; break; - case SvxRedlinDateMode::EQUAL: - case SvxRedlinDateMode::NOTEQUAL: + case SvxRedlineDateMode::EQUAL: + case SvxRedlineDateMode::NOTEQUAL: m_aDaTiFilterFirst=m_aDaTiFirst; m_aDaTiFilterLast=m_aDaTiFirst; m_aDaTiFilterFirst.SetTime(aTMin.GetTime()); m_aDaTiFilterLast.SetTime(aTMax.GetTime()); break; - case SvxRedlinDateMode::BETWEEN: + case SvxRedlineDateMode::BETWEEN: m_aDaTiFilterFirst=m_aDaTiFirst; m_aDaTiFilterLast=m_aDaTiLast; break; - case SvxRedlinDateMode::NONE: + case SvxRedlineDateMode::NONE: break; } } -void SvxRedlinTable::SetFilterDate(bool bFlag) +void SvxRedlineTable::SetFilterDate(bool bFlag) { m_bDate=bFlag; } -void SvxRedlinTable::SetDateTimeMode(SvxRedlinDateMode nMode) +void SvxRedlineTable::SetDateTimeMode(SvxRedlineDateMode nMode) { m_nDaTiMode=nMode; } -void SvxRedlinTable::SetFirstDate(const Date& aDate) +void SvxRedlineTable::SetFirstDate(const Date& aDate) { m_aDaTiFirst.SetDate(aDate.GetDate()); } -void SvxRedlinTable::SetLastDate(const Date& aDate) +void SvxRedlineTable::SetLastDate(const Date& aDate) { m_aDaTiLast.SetDate(aDate.GetDate()); } -void SvxRedlinTable::SetFirstTime(const tools::Time& aTime) +void SvxRedlineTable::SetFirstTime(const tools::Time& aTime) { m_aDaTiFirst.SetTime(aTime.GetTime()); } -void SvxRedlinTable::SetLastTime(const tools::Time& aTime) +void SvxRedlineTable::SetLastTime(const tools::Time& aTime) { m_aDaTiLast.SetTime(aTime.GetTime()); } -void SvxRedlinTable::SetFilterAuthor(bool bFlag) +void SvxRedlineTable::SetFilterAuthor(bool bFlag) { m_bAuthor=bFlag; } -void SvxRedlinTable::SetAuthor(const OUString &aString) +void SvxRedlineTable::SetAuthor(const OUString &aString) { m_aAuthor=aString; } -void SvxRedlinTable::SetFilterComment(bool bFlag) +void SvxRedlineTable::SetFilterComment(bool bFlag) { m_bComment=bFlag; } -void SvxRedlinTable::SetCommentParams( const utl::SearchParam* pSearchPara ) +void SvxRedlineTable::SetCommentParams( const utl::SearchParam* pSearchPara ) { if(pSearchPara!=nullptr) { @@ -260,14 +260,13 @@ void SvxRedlinTable::SetCommentParams( const utl::SearchParam* pSearchPara ) } } -bool SvxRedlinTable::IsValidEntry(std::u16string_view rAuthorStr, - const DateTime &rDateTime, - const OUString &rCommentStr) +bool SvxRedlineTable::IsValidEntry(std::u16string_view rAuthorStr, const DateTime& rDateTime, + const OUString& rCommentStr) { return IsValidEntry(rAuthorStr, rDateTime) && IsValidComment(rCommentStr); } -bool SvxRedlinTable::IsValidEntry(std::u16string_view rAuthorStr, const DateTime &rDateTime) +bool SvxRedlineTable::IsValidEntry(std::u16string_view rAuthorStr, const DateTime& rDateTime) { if (m_bAuthor && m_aAuthor!=rAuthorStr) return false; @@ -276,10 +275,10 @@ bool SvxRedlinTable::IsValidEntry(std::u16string_view rAuthorStr, const DateTime return true; const bool bRes = rDateTime.IsBetween(m_aDaTiFilterFirst, m_aDaTiFilterLast); - return m_nDaTiMode!=SvxRedlinDateMode::NOTEQUAL ? bRes : !bRes; + return m_nDaTiMode != SvxRedlineDateMode::NOTEQUAL ? bRes : !bRes; } -bool SvxRedlinTable::IsValidComment(const OUString &rCommentStr) +bool SvxRedlineTable::IsValidComment(const OUString& rCommentStr) { if (!m_bComment) return true; @@ -312,9 +311,9 @@ SvxTPView::SvxTPView(weld::Container* pParent) , m_xRejectAll(m_xBuilder->weld_button(u"rejectall"_ustr)) , m_xUndo(m_xBuilder->weld_button(u"undo"_ustr)) , m_xSortByComboBox(m_xBuilder->weld_combo_box(u"sortbycombobox"_ustr)) - , m_xViewData(new SvxRedlinTable(m_xBuilder->weld_tree_view(u"writerchanges"_ustr), - m_xBuilder->weld_tree_view(u"calcchanges"_ustr), - m_xSortByComboBox.get())) + , m_xViewData(new SvxRedlineTable(m_xBuilder->weld_tree_view(u"writerchanges"_ustr), + m_xBuilder->weld_tree_view(u"calcchanges"_ustr), + m_xSortByComboBox.get())) { m_xSortByComboBox->connect_changed(LINK(this, SvxTPView, SortByComboBoxChangedHdl)); @@ -349,7 +348,7 @@ SvxTPView::~SvxTPView() { } -void SvxRedlinTable::SetWriterView() +void SvxRedlineTable::SetWriterView() { m_nDatePos = WRITER_DATE; if (m_xCalcTreeView) @@ -369,7 +368,7 @@ void SvxRedlinTable::SetWriterView() m_pTreeView->set_column_fixed_widths(aWidths); } -void SvxRedlinTable::SetCalcView() +void SvxRedlineTable::SetCalcView() { m_nDatePos = CALC_DATE; if (m_xWriterTreeView) @@ -478,7 +477,7 @@ SvxTPage::SvxTPage(weld::Container* pParent, const OUString& rUIXMLDescription, SvxTPFilter::SvxTPFilter(weld::Container* pParent) : SvxTPage(pParent, u"svx/ui/redlinefilterpage.ui"_ustr, u"RedlineFilterPage"_ustr) , m_bModified(false) - , m_pRedlinTable(nullptr) + , m_pRedlineTable(nullptr) , m_xCbDate(m_xBuilder->weld_check_button(u"date"_ustr)) , m_xLbDate(m_xBuilder->weld_combo_box(u"datecond"_ustr)) , m_xDfDate(new SvtCalendarBox(m_xBuilder->weld_menu_button(u"startdate"_ustr))) @@ -550,9 +549,9 @@ SvxTPFilter::~SvxTPFilter() { } -void SvxTPFilter::SetRedlinTable(SvxRedlinTable* pTable) +void SvxTPFilter::SetRedlineTable(SvxRedlineTable* pTable) { - m_pRedlinTable = pTable; + m_pRedlineTable = pTable; } void SvxTPFilter::EnableDateLine1(bool bFlag) @@ -636,9 +635,9 @@ void SvxTPFilter::SetDateMode(sal_uInt16 nMode) SelDateHdl(*m_xLbDate); } -SvxRedlinDateMode SvxTPFilter::GetDateMode() const +SvxRedlineDateMode SvxTPFilter::GetDateMode() const { - return static_cast<SvxRedlinDateMode>(m_xLbDate->get_active()); + return static_cast<SvxRedlineDateMode>(m_xLbDate->get_active()); } void SvxTPFilter::ClearAuthors() { @@ -785,30 +784,30 @@ void SvxTPFilter::ShowAction(bool bShow) IMPL_LINK_NOARG(SvxTPFilter, SelDateHdl, weld::ComboBox&, void) { - SvxRedlinDateMode nKind = static_cast<SvxRedlinDateMode>(m_xLbDate->get_active()); + SvxRedlineDateMode nKind = static_cast<SvxRedlineDateMode>(m_xLbDate->get_active()); switch(nKind) { - case SvxRedlinDateMode::BEFORE: - case SvxRedlinDateMode::SINCE: + case SvxRedlineDateMode::BEFORE: + case SvxRedlineDateMode::SINCE: EnableDateLine1(true); EnableDateLine2(false); break; - case SvxRedlinDateMode::EQUAL: - case SvxRedlinDateMode::NOTEQUAL: + case SvxRedlineDateMode::EQUAL: + case SvxRedlineDateMode::NOTEQUAL: EnableDateLine1(true); m_xTfDate->set_sensitive(false); m_xTfDate->set_text(OUString()); EnableDateLine2(false); break; - case SvxRedlinDateMode::BETWEEN: + case SvxRedlineDateMode::BETWEEN: EnableDateLine1(true); EnableDateLine2(true); break; - case SvxRedlinDateMode::SAVE: + case SvxRedlineDateMode::SAVE: EnableDateLine1(false); EnableDateLine2(false); break; - case SvxRedlinDateMode::NONE: + case SvxRedlineDateMode::NONE: break; } m_bModified = true; @@ -873,25 +872,25 @@ void SvxTPFilter::DeactivatePage() { if(m_bModified) { - if (m_pRedlinTable) + if (m_pRedlineTable) { - m_pRedlinTable->SetFilterDate(IsDate()); - m_pRedlinTable->SetDateTimeMode(GetDateMode()); - m_pRedlinTable->SetFirstDate(GetFirstDate()); - m_pRedlinTable->SetLastDate(GetLastDate()); - m_pRedlinTable->SetFirstTime(GetFirstTime()); - m_pRedlinTable->SetLastTime(GetLastTime()); - m_pRedlinTable->SetFilterAuthor(IsAuthor()); - m_pRedlinTable->SetAuthor(GetSelectedAuthor()); + m_pRedlineTable->SetFilterDate(IsDate()); + m_pRedlineTable->SetDateTimeMode(GetDateMode()); + m_pRedlineTable->SetFirstDate(GetFirstDate()); + m_pRedlineTable->SetLastDate(GetLastDate()); + m_pRedlineTable->SetFirstTime(GetFirstTime()); + m_pRedlineTable->SetLastTime(GetLastTime()); + m_pRedlineTable->SetFilterAuthor(IsAuthor()); + m_pRedlineTable->SetAuthor(GetSelectedAuthor()); - m_pRedlinTable->SetFilterComment(IsComment()); + m_pRedlineTable->SetFilterComment(IsComment()); utl::SearchParam aSearchParam( m_xEdComment->get_text(), utl::SearchParam::SearchType::Regexp,false ); - m_pRedlinTable->SetCommentParams(&aSearchParam); + m_pRedlineTable->SetCommentParams(&aSearchParam); - m_pRedlinTable->UpdateFilterTest(); + m_pRedlineTable->UpdateFilterTest(); } m_aReadyLink.Call(this); @@ -919,16 +918,16 @@ IMPL_LINK(SvxTPFilter, ModifyDate, SvtCalendarBox&, rTF, void) if (m_xDfDate->get_label().isEmpty()) m_xDfDate->set_date(aDate); - if(m_pRedlinTable!=nullptr) - m_pRedlinTable->SetFirstDate(m_xDfDate->get_date()); + if (m_pRedlineTable != nullptr) + m_pRedlineTable->SetFirstDate(m_xDfDate->get_date()); } else if (m_xDfDate2.get() == &rTF) { if (m_xDfDate2->get_label().isEmpty()) m_xDfDate2->set_date(aDate); - if (m_pRedlinTable) - m_pRedlinTable->SetLastDate(m_xDfDate2->get_date()); + if (m_pRedlineTable) + m_pRedlineTable->SetLastDate(m_xDfDate2->get_date()); } m_bModified=true; } @@ -941,17 +940,16 @@ IMPL_LINK(SvxTPFilter, ModifyTime, weld::FormattedSpinButton&, rTF, void) if (m_xTfDate->get_text().isEmpty()) SetFirstTime(aTime); - if (m_pRedlinTable!=nullptr) - m_pRedlinTable->SetFirstTime(GetFirstTime()); + if (m_pRedlineTable != nullptr) + m_pRedlineTable->SetFirstTime(GetFirstTime()); } else if (m_xTfDate2.get() == &rTF) { if (m_xTfDate2->get_text().isEmpty()) SetLastTime(aTime); - if (m_pRedlinTable!=nullptr) - m_pRedlinTable->SetLastTime(GetLastTime()); - + if (m_pRedlineTable != nullptr) + m_pRedlineTable->SetLastTime(GetLastTime()); } m_bModified=true; } @@ -970,7 +968,7 @@ SvxAcceptChgCtr::SvxAcceptChgCtr(weld::Container* pParent) m_xTPFilter.reset(new SvxTPFilter(m_xTabCtrl->get_page(u"filter"_ustr))); m_xTPView.reset(new SvxTPView(m_xTabCtrl->get_page(u"view"_ustr))); - m_xTPFilter->SetRedlinTable(m_xTPView->GetTableControl()); + m_xTPFilter->SetRedlineTable(m_xTPView->GetTableControl()); m_xTabCtrl->set_current_page(u"view"_ustr); m_xTabCtrl->set_help_id(HID_REDLINE_CTRL_VIEW); m_xTabCtrl->show(); diff --git a/sw/source/uibase/inc/redlndlg.hxx b/sw/source/uibase/inc/redlndlg.hxx index 101c59cc533d..630924d1d9d9 100644 --- a/sw/source/uibase/inc/redlndlg.hxx +++ b/sw/source/uibase/inc/redlndlg.hxx @@ -59,8 +59,7 @@ class SW_DLLPUBLIC SwRedlineAcceptDlg final : public SfxListener std::vector<std::unique_ptr<SwRedlineDataChild>> m_RedlineChildren; // purely here so we don't leak - std::vector<std::unique_ptr<RedlinData>> - m_RedlinData; + std::vector<std::unique_ptr<RedlineData>> m_RedlineData; SwRedlineDataParentSortArr m_aUsedSeqNo; Timer m_aSelectTimer; OUString m_sInserted; @@ -82,7 +81,7 @@ class SW_DLLPUBLIC SwRedlineAcceptDlg final : public SfxListener std::unique_ptr<SvxAcceptChgCtr> m_xTabPagesCTRL; std::unique_ptr<weld::Menu> m_xPopup, m_xSortMenu; SvxTPView& m_rTPView; - SvxRedlinTable* m_pTable; + SvxRedlineTable* m_pTable; bool m_bInitialSelect = true; diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx index a14108a1cb11..74c8314b8cc9 100644 --- a/sw/source/uibase/misc/redlndlg.cxx +++ b/sw/source/uibase/misc/redlndlg.cxx @@ -141,7 +141,7 @@ const SwRedlineData* lcl_get_selected_redlinedata(const weld::TreeView& rTreeVie { if (std::unique_ptr<weld::TreeIter> xEntry = rTreeView.get_selected()) { - RedlinData* pRedlinData = weld::fromId<RedlinData*>(rTreeView.get_id(*xEntry)); + RedlineData* pRedlinData = weld::fromId<RedlineData*>(rTreeView.get_id(*xEntry)); if (rTreeView.get_iter_depth(*xEntry)) return static_cast<SwRedlineDataChild*>(pRedlinData->pData)->pChild; else @@ -160,7 +160,7 @@ void lcl_reselect(weld::TreeView& rTreeView, const SwRedlineData* pSelectedEntry rTreeView.all_foreach( [&rTreeView, &pSelectedEntryRedlineData](weld::TreeIter& rIter) { - RedlinData* pRedlinData = weld::fromId<RedlinData*>(rTreeView.get_id(rIter)); + RedlineData* pRedlinData = weld::fromId<RedlineData*>(rTreeView.get_id(rIter)); const SwRedlineData* pRedlineData; if (rTreeView.get_iter_depth(rIter)) pRedlineData = static_cast<SwRedlineDataChild*>(pRedlinData->pData)->pChild; @@ -297,7 +297,7 @@ void SwRedlineAcceptDlg::Init(SwRedlineTable::size_type nStart) else { rTreeView.clear(); - m_RedlinData.clear(); + m_RedlineData.clear(); m_RedlineChildren.clear(); m_RedlineParents.erase(m_RedlineParents.begin() + nStart, m_RedlineParents.end()); } @@ -615,7 +615,7 @@ void SwRedlineAcceptDlg::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint) weld::TreeView& rTreeView = m_pTable->GetWidget(); rTreeView.all_foreach([&rTreeView, &rRedlineData](weld::TreeIter& rIter) { - RedlinData* pRedlinData = weld::fromId<RedlinData*>(rTreeView.get_id(rIter)); + RedlineData* pRedlinData = weld::fromId<RedlineData*>(rTreeView.get_id(rIter)); const SwRedlineData* pRedlineData; if (rTreeView.get_iter_depth(rIter)) pRedlineData = static_cast<SwRedlineDataChild*>(pRedlinData->pData)->pChild; @@ -769,7 +769,7 @@ void SwRedlineAcceptDlg::InsertChildren(SwRedlineDataParent *pParent, const SwRa if (bValidChild) { - std::unique_ptr<RedlinData> pData(new RedlinData); + std::unique_ptr<RedlineData> pData(new RedlineData); pData->pData = pRedlineChild; pData->bDisabled = true; @@ -784,7 +784,7 @@ void SwRedlineAcceptDlg::InsertChildren(SwRedlineDataParent *pParent, const SwRa OUString sId(weld::toId(pData.get())); rTreeView.insert(pParent->xTLBParent.get(), -1, nullptr, &sId, nullptr, nullptr, false, xChild.get()); - m_RedlinData.push_back(std::move(pData)); + m_RedlineData.push_back(std::move(pData)); rTreeView.set_image(*xChild, sImage, -1); rTreeView.set_text(*xChild, sAuthor, 1); @@ -1034,7 +1034,7 @@ void SwRedlineAcceptDlg::InsertParents(SwRedlineTable::size_type nStart, SwRedli m_RedlineParents.insert(m_RedlineParents.begin() + i, std::unique_ptr<SwRedlineDataParent>(pRedlineParent)); - std::unique_ptr<RedlinData> pData(new RedlinData); + std::unique_ptr<RedlineData> pData(new RedlineData); pData->pData = pRedlineParent; pData->bDisabled = false; @@ -1068,7 +1068,7 @@ void SwRedlineAcceptDlg::InsertParents(SwRedlineTable::size_type nStart, SwRedli rTreeView.insert(pParent->xTLBParent.get(), -1, nullptr, &sId, nullptr, nullptr, false, xParent.get()); } - m_RedlinData.push_back(std::move(pData)); + m_RedlineData.push_back(std::move(pData)); rTreeView.set_image(*xParent, sImage, -1); rTreeView.set_text(*xParent, sAuthor, 1); @@ -1112,7 +1112,7 @@ void SwRedlineAcceptDlg::CallAcceptReject( bool bSelect, bool bAccept ) if (bSelect && nPos == -1) nPos = rTreeView.get_iter_index_in_parent(rEntry); - RedlinData *pData = weld::fromId<RedlinData*>(rTreeView.get_id(rEntry)); + RedlineData* pData = weld::fromId<RedlineData*>(rTreeView.get_id(rEntry)); if (!pData->bDisabled) aRedlines.emplace_back(rTreeView.make_iterator(&rEntry)); @@ -1142,7 +1142,7 @@ void SwRedlineAcceptDlg::CallAcceptReject( bool bSelect, bool bAccept ) if ( bMoreRedlines && aRedlines.size() == 1 ) { std::unique_ptr<weld::TreeIter> xChild(rTreeView.make_iterator( &*aRedlines[0] )); - RedlinData *pData = weld::fromId<RedlinData*>(rTreeView.get_id(*xChild)); + RedlineData* pData = weld::fromId<RedlineData*>(rTreeView.get_id(*xChild)); if ( pData->bDisabled ) bMoreRedlines = false; } @@ -1185,7 +1185,7 @@ void SwRedlineAcceptDlg::CallAcceptReject( bool bSelect, bool bAccept ) std::unique_ptr<weld::TreeIter> xChild(rTreeView.make_iterator( &*rRedLine )); if ( rTreeView.iter_children(*xChild) ) { - RedlinData *pData = weld::fromId<RedlinData*>(rTreeView.get_id(*xChild)); + RedlineData* pData = weld::fromId<RedlineData*>(rTreeView.get_id(*xChild)); // disabled for redline stack, but not for redlines of table rows if ( !pData->bDisabled ) { @@ -1233,7 +1233,7 @@ SwRedlineTable::size_type SwRedlineAcceptDlg::GetRedlinePos(const weld::TreeIter return SwRedlineTable::npos; weld::TreeView& rTreeView = m_pTable->GetWidget(); - return pSh->FindRedlineOfData( *static_cast<SwRedlineDataParent*>(weld::fromId<RedlinData*>( + return pSh->FindRedlineOfData( *static_cast<SwRedlineDataParent*>(weld::fromId<RedlineData*>( rTreeView.get_id(rEntry))->pData)->pData ); } @@ -1350,7 +1350,7 @@ IMPL_LINK_NOARG(SwRedlineAcceptDlg, GotoHdl, Timer *, void) std::unique_ptr<weld::TreeIter> xChild(rTreeView.make_iterator( &*xActEntry )); if ( rTreeView.iter_children(*xChild) ) { - RedlinData *pData = reinterpret_cast<RedlinData*>(rTreeView.get_id(*xChild).toInt64()); + RedlineData *pData = reinterpret_cast<RedlineData*>(rTreeView.get_id(*xChild).toInt64()); // disabled for redline stack, but not for redlines of table rows if ( !pData->bDisabled ) { commit b1c91da3844b5d2973666e4e10c27d5824e87cae Author: Michael Weghorn <[email protected]> AuthorDate: Sat Jan 31 18:54:47 2026 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Sun Feb 1 09:13:21 2026 +0100 vcl: Drop unused SvTreeList::Insert return value Unused now after Change-Id: I859b0a04c81253608d369af0b45e3185a89d43fb Author: Michael Weghorn <[email protected]> Date: Sat Jan 31 18:50:25 2026 +0100 vcl: Drop unused SvTreeListBox::Insert return value Change-Id: I859b0a04c81253608d369af0b45e3185a89d43fb Change-Id: I68ca2b637d5b08924e234b5fa22054dd340d1420 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198473 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/include/vcl/toolkit/treelist.hxx b/include/vcl/toolkit/treelist.hxx index 3f84ef62a365..24b634f3f8f2 100644 --- a/include/vcl/toolkit/treelist.hxx +++ b/include/vcl/toolkit/treelist.hxx @@ -146,9 +146,11 @@ public: SvTreeListEntry* FirstChild(const SvTreeListEntry* pParent) const; - sal_uInt32 Insert( SvTreeListEntry* pEntry,SvTreeListEntry* pPar,sal_uInt32 nPos = TREELIST_APPEND); - sal_uInt32 Insert( SvTreeListEntry* pEntry,sal_uInt32 nRootPos = TREELIST_APPEND ) - { return Insert(pEntry, pRootItem.get(), nRootPos ); } + void Insert(SvTreeListEntry* pEntry, SvTreeListEntry* pPar, sal_uInt32 nPos = TREELIST_APPEND); + void Insert(SvTreeListEntry* pEntry, sal_uInt32 nRootPos = TREELIST_APPEND) + { + Insert(pEntry, pRootItem.get(), nRootPos); + } void InsertTree( SvTreeListEntry* pTree, SvTreeListEntry* pTargetParent, sal_uInt32 nListPos ); diff --git a/vcl/source/treelist/treelist.cxx b/vcl/source/treelist/treelist.cxx index c0777ce01e99..c392fc41e7c1 100644 --- a/vcl/source/treelist/treelist.cxx +++ b/vcl/source/treelist/treelist.cxx @@ -759,7 +759,7 @@ SvTreeListEntry* SvTreeList::NextSelected( const SvListView* pView, SvTreeListEn return pEntry; } -sal_uInt32 SvTreeList::Insert( SvTreeListEntry* pEntry,SvTreeListEntry* pParent,sal_uInt32 nPos ) +void SvTreeList::Insert(SvTreeListEntry* pEntry, SvTreeListEntry* pParent, sal_uInt32 nPos) { assert(pEntry && "Entry?"); @@ -789,8 +789,7 @@ sal_uInt32 SvTreeList::Insert( SvTreeListEntry* pEntry,SvTreeListEntry* pParent, else pEntry->nListPos = rList.size()-1; - Broadcast( SvListAction::INSERTED, pEntry ); - return nPos; // pEntry->nListPos; + Broadcast(SvListAction::INSERTED, pEntry); } sal_uInt32 SvTreeList::GetAbsPos( const SvTreeListEntry* pEntry) const
