diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2020-02-09 13:13:34 +0200 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2020-02-09 18:11:04 +0100 |
commit | c4818b1caff43e64f657666ec85d289f196cf2e0 (patch) | |
tree | e74280b8bc9637a3fb5d98c875d682c50928307f /reportdesign | |
parent | 0f1bd7f0f79a054f1af1c5aadd81f586f2e4f879 (diff) |
Fix undo and redo dropdowns in non-sfx2 modules
after commit c34edadf5bd3d1d9f3c9c056af28b8964d8f1ca0
("rework SvxUndoRedoControl to be a PopupWindowController")
accidentally enabled them there, instead of the simple
buttons those modules used to have. Just implement the
necessary stuff, instead of hiding the dropdown again.
Change-Id: Ic93114f7f3cec8e96f3389ceb0d52552cde02a83
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88333
Tested-by: Jenkins
Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Diffstat (limited to 'reportdesign')
-rw-r--r-- | reportdesign/source/ui/report/ReportController.cxx | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index 21f1a1021a9f..faeed5df7f21 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -453,6 +453,24 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const } } break; + case SID_GETUNDOSTRINGS: + case SID_GETREDOSTRINGS: + { + size_t ( SfxUndoManager::*retrieveCount )( bool const ) const = + ( _nId == SID_GETUNDOSTRINGS ) ? &SfxUndoManager::GetUndoActionCount : &SfxUndoManager::GetRedoActionCount; + + OUString ( SfxUndoManager::*retrieveComment )( size_t, bool const ) const = + ( _nId == SID_GETUNDOSTRINGS ) ? &SfxUndoManager::GetUndoActionComment : &SfxUndoManager::GetRedoActionComment; + + SfxUndoManager& rUndoManager( getUndoManager() ); + size_t nCount(( rUndoManager.*retrieveCount )( SfxUndoManager::TopLevel )); + Sequence<OUString> aSeq(nCount); + for (size_t n = 0; n < nCount; ++n) + aSeq[n] = (rUndoManager.*retrieveComment)( n, SfxUndoManager::TopLevel ); + aReturn.aValue <<= aSeq; + aReturn.bEnabled = true; + } + break; case SID_OBJECT_RESIZING: case SID_OBJECT_SMALLESTWIDTH: case SID_OBJECT_SMALLESTHEIGHT: @@ -1016,9 +1034,13 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > const OXUndoEnvironment::OUndoMode aLock( m_aReportModel->GetUndoEnv() ); bool ( SfxUndoManager::*doXDo )() = ( _nId == SID_UNDO ) ? &SfxUndoManager::Undo : &SfxUndoManager::Redo; - SfxUndoManager& rUndoManager( getUndoManager() ); - (rUndoManager.*doXDo)(); + + sal_Int16 nCount(1); + if (aArgs.hasElements() && aArgs[0].Name != "KeyModifier") + aArgs[0].Value >>= nCount; + while (nCount--) + (rUndoManager.*doXDo)(); InvalidateAll(); if (m_xGroupsFloater && m_xGroupsFloater->getDialog()->get_visible()) m_xGroupsFloater->UpdateData(); @@ -2022,6 +2044,8 @@ void OReportController::describeSupportedFeatures() implDescribeSupportedFeature( ".uno:SelectAllEdits", SID_SELECT_ALL_EDITS); implDescribeSupportedFeature( ".uno:CollapseSection", SID_COLLAPSE_SECTION); implDescribeSupportedFeature( ".uno:ExpandSection", SID_EXPAND_SECTION); + implDescribeSupportedFeature( ".uno:GetUndoStrings", SID_GETUNDOSTRINGS); + implDescribeSupportedFeature( ".uno:GetRedoStrings", SID_GETREDOSTRINGS); } void OReportController::impl_onModifyChanged() |