summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorGökay Şatır <gokaysatir@collabora.com>2023-03-20 11:17:37 +0300
committerGökay ŞATIR <gokaysatir@collabora.com>2023-04-11 10:10:06 +0200
commit83829de5ad87240d2c54925da23a84c1e8964c54 (patch)
tree467079c12c5d2a420308455c1de00844d4776a08 /sfx2
parent81ff712657dba53376c94c9bb266e7c838ef40e2 (diff)
Revert "[API CHANGE] Add createShortCutManager function to..."
This reverts commit 67fcd647341118747a4e7cd404d907d29613778c. Signed-off-by: Gökay Şatır <gokaysatir@collabora.com> Change-Id: I9d0652df63ab7ce9b220aff37008b18d8d511a03 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149138 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/app.cxx5
-rw-r--r--sfx2/source/inc/appdata.hxx2
-rw-r--r--sfx2/source/view/lokhelper.cxx6
-rw-r--r--sfx2/source/view/viewsh.cxx41
4 files changed, 3 insertions, 51 deletions
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index 2f7fec749a9c..293deabad99d 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -378,11 +378,6 @@ std::vector<SfxViewShell*>& SfxApplication::GetViewShells_Impl() const
return pImpl->maViewShells;
}
-std::unordered_map<OUString, css::uno::Reference<css::ui::XAcceleratorConfiguration>>& SfxApplication::GetAcceleratorConfs_Impl() const
-{
- return pImpl->maAcceleratorConfs;
-}
-
std::vector<SfxObjectShell*>& SfxApplication::GetObjectShells_Impl() const
{
return pImpl->maObjShells;
diff --git a/sfx2/source/inc/appdata.hxx b/sfx2/source/inc/appdata.hxx
index 05a4e19eb217..121ba43f5581 100644
--- a/sfx2/source/inc/appdata.hxx
+++ b/sfx2/source/inc/appdata.hxx
@@ -32,7 +32,6 @@
#include <sfx2/msgpool.hxx>
#include <o3tl/enumarray.hxx>
#include "sfxpicklist.hxx"
-#include "com/sun/star/ui/XAcceleratorConfiguration.hpp"
#include <bitset.hxx>
#include <memory>
@@ -101,7 +100,6 @@ public:
maStbCtrlFactories;
std::vector<SfxViewFrame*> maViewFrames;
std::vector<SfxViewShell*> maViewShells;
- std::unordered_map<OUString, css::uno::Reference<css::ui::XAcceleratorConfiguration>> maAcceleratorConfs;
std::vector<SfxObjectShell*>
maObjShells;
std::unique_ptr<SfxBasicManagerHolder>
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 8bf9d36d0beb..166aa124777e 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -170,13 +170,13 @@ void SfxLokHelper::setView(int nId)
{
DisableCallbacks dc;
- if (pViewShell == SfxViewShell::Current())
- return;
-
// update the current LOK language and locale for the dialog tunneling
comphelper::LibreOfficeKit::setLanguageTag(pViewShell->GetLOKLanguageTag());
comphelper::LibreOfficeKit::setLocale(pViewShell->GetLOKLocale());
+ if (pViewShell == SfxViewShell::Current())
+ return;
+
SfxViewFrame* pViewFrame = pViewShell->GetViewFrame();
pViewFrame->MakeActive_Impl(false);
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 1e847d2e5149..28b133174aef 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -47,7 +47,6 @@
#include <com/sun/star/view/XRenderable.hpp>
#include <com/sun/star/uno/Reference.hxx>
#include <cppuhelper/implbase.hxx>
-#include <com/sun/star/ui/XAcceleratorConfiguration.hpp>
#include <tools/diagnose_ex.h>
#include <tools/urlobj.hxx>
@@ -90,7 +89,6 @@
#include <iostream>
#include <vector>
#include <libxml/xmlwriter.h>
-#include <unordered_map>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -1412,50 +1410,11 @@ void SfxViewShell::Notify( SfxBroadcaster& rBC,
bool SfxViewShell::ExecKey_Impl(const KeyEvent& aKey)
{
- bool setModuleConfig = false; // In case libreofficekit is active, we will re-set the module config class.
if (!pImpl->m_xAccExec)
{
pImpl->m_xAccExec = ::svt::AcceleratorExecute::createAcceleratorHelper();
pImpl->m_xAccExec->init(::comphelper::getProcessComponentContext(),
pFrame->GetFrame().GetFrameInterface());
- setModuleConfig = true;
- }
-
- if (comphelper::LibreOfficeKit::isActive())
- {
- // Get the module name.
- css::uno::Reference< css::uno::XComponentContext > xContext (::comphelper::getProcessComponentContext());
- css::uno::Reference< css::frame::XModuleManager2 > xModuleManager(css::frame::ModuleManager::create(xContext));
- OUString sModule = xModuleManager->identify(pFrame->GetFrame().GetFrameInterface());
-
- // Get the language name.
- OUString viewLang = GetLOKLanguageTag().getBcp47();
-
- // Merge them & have a key.
- OUString key = sModule + viewLang;
-
- // Check it in configurations map. Create a configuration manager if there isn't one for the key.
- std::unordered_map<OUString, css::uno::Reference<com::sun::star::ui::XAcceleratorConfiguration>>& acceleratorConfs = SfxApplication::Get()->GetAcceleratorConfs_Impl();
- if (acceleratorConfs.find(key) == acceleratorConfs.end())
- {
- // Create a new configuration manager for the module.
-
- OUString actualLang = officecfg::Setup::L10N::ooLocale::get();
-
- std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
- officecfg::Setup::L10N::ooLocale::set(viewLang, batch);
- batch->commit();
-
- // We have set the language. Time to create the config manager.
- acceleratorConfs[key] = svt::AcceleratorExecute::lok_createNewAcceleratorConfiguration(::comphelper::getProcessComponentContext(), sModule);
-
- std::shared_ptr<comphelper::ConfigurationChanges> batch2(comphelper::ConfigurationChanges::create());
- officecfg::Setup::L10N::ooLocale::set(actualLang, batch2);
- batch2->commit();
- }
-
- if (setModuleConfig)
- pImpl->m_xAccExec->lok_setModuleConfig(acceleratorConfs[key]);
}
return pImpl->m_xAccExec->execute(aKey.GetKeyCode());