summaryrefslogtreecommitdiffstats
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
parenttdf#90407 Change the auto-fit alg. to match better with OOXML (diff)
downloadcore-83829de5ad87240d2c54925da23a84c1e8964c54.tar.gz
core-83829de5ad87240d2c54925da23a84c1e8964c54.zip
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>
-rw-r--r--framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx6
-rw-r--r--framework/source/uiconfiguration/uiconfigurationmanager.cxx6
-rw-r--r--include/sfx2/app.hxx4
-rw-r--r--include/svtools/acceleratorexecute.hxx2
-rw-r--r--offapi/com/sun/star/ui/XUIConfigurationManager.idl7
-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
-rw-r--r--svtools/source/misc/acceleratorexecute.cxx23
10 files changed, 3 insertions, 99 deletions
diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
index d20c4764dc57..b2346455d228 100644
--- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
@@ -122,7 +122,6 @@ public:
virtual void SAL_CALL insertSettings( const OUString& NewResourceURL, const css::uno::Reference< css::container::XIndexAccess >& aNewData ) override;
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getImageManager() override;
virtual css::uno::Reference< css::ui::XAcceleratorConfiguration > SAL_CALL getShortCutManager() override;
- virtual css::uno::Reference< css::ui::XAcceleratorConfiguration > SAL_CALL createShortCutManager() override;
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getEventsManager() override;
// XModuleUIConfigurationManager
@@ -1409,11 +1408,6 @@ Reference< XInterface > SAL_CALL ModuleUIConfigurationManager::getImageManager()
return Reference< XInterface >( static_cast<cppu::OWeakObject*>(m_xModuleImageManager.get()), UNO_QUERY );
}
-Reference< ui::XAcceleratorConfiguration > SAL_CALL ModuleUIConfigurationManager::createShortCutManager()
-{
- return ui::ModuleAcceleratorConfiguration::createWithModuleIdentifier(m_xContext, m_aModuleIdentifier);
-}
-
Reference< ui::XAcceleratorConfiguration > SAL_CALL ModuleUIConfigurationManager::getShortCutManager()
{
SolarMutexGuard g;
diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
index 2203090fbeef..495bbb573896 100644
--- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
@@ -111,7 +111,6 @@ public:
virtual void SAL_CALL insertSettings( const OUString& NewResourceURL, const css::uno::Reference< css::container::XIndexAccess >& aNewData ) override;
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getImageManager() override;
virtual css::uno::Reference< css::ui::XAcceleratorConfiguration > SAL_CALL getShortCutManager() override;
- virtual css::uno::Reference< css::ui::XAcceleratorConfiguration > SAL_CALL createShortCutManager() override;
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getEventsManager() override;
// XUIConfigurationPersistence
@@ -1126,11 +1125,6 @@ Reference< XInterface > SAL_CALL UIConfigurationManager::getImageManager()
return Reference< XInterface >( static_cast<cppu::OWeakObject*>(m_xImageManager.get()), UNO_QUERY );
}
-Reference< XAcceleratorConfiguration > SAL_CALL UIConfigurationManager::createShortCutManager()
-{
- return DocumentAcceleratorConfiguration::createWithDocumentRoot(m_xContext, m_xDocConfigStorage);
-}
-
Reference< XAcceleratorConfiguration > SAL_CALL UIConfigurationManager::getShortCutManager()
{
// SAFE ->
diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx
index 6687dc1f1653..fd8e556c7af1 100644
--- a/include/sfx2/app.hxx
+++ b/include/sfx2/app.hxx
@@ -27,8 +27,6 @@
#include <svl/poolitem.hxx>
#include <vcl/bitmapex.hxx>
#include <tools/link.hxx>
-#include <com/sun/star/ui/XAcceleratorConfiguration.hpp>
-#include <unordered_map>
#include <sfx2/shell.hxx>
@@ -175,8 +173,6 @@ public:
SAL_DLLPRIVATE SfxChildWinFactory* GetChildWinFactoryById(sal_uInt16 nId) const;
SAL_DLLPRIVATE std::vector<SfxViewFrame*>& GetViewFrames_Impl() const;
SAL_DLLPRIVATE std::vector<SfxViewShell*>& GetViewShells_Impl() const;
- /* unordered_map<ModuleName+Language, acceleratorConfigurationClassInstance> */
- SAL_DLLPRIVATE std::unordered_map<OUString, css::uno::Reference<css::ui::XAcceleratorConfiguration>>& GetAcceleratorConfs_Impl() const;
SAL_DLLPRIVATE std::vector<SfxObjectShell*>& GetObjectShells_Impl() const;
SAL_DLLPRIVATE void SetViewFrame_Impl(SfxViewFrame *pViewFrame);
diff --git a/include/svtools/acceleratorexecute.hxx b/include/svtools/acceleratorexecute.hxx
index 5d5ac4ca71c7..f43fefe43507 100644
--- a/include/svtools/acceleratorexecute.hxx
+++ b/include/svtools/acceleratorexecute.hxx
@@ -175,8 +175,6 @@ class SVT_DLLPUBLIC AcceleratorExecute final
static css::uno::Reference< css::ui::XAcceleratorConfiguration > st_openModuleConfig(const css::uno::Reference< css::uno::XComponentContext >& rxContext ,
const css::uno::Reference< css::frame::XFrame >& xFrame);
- static css::uno::Reference<css::ui::XAcceleratorConfiguration> lok_createNewAcceleratorConfiguration(const css::uno::Reference< css::uno::XComponentContext >& rxContext, OUString sModule);
- void lok_setModuleConfig(css::uno::Reference<css::ui::XAcceleratorConfiguration> acceleratorConfig);
/** TODO document me */
static css::uno::Reference< css::ui::XAcceleratorConfiguration > st_openDocConfig(const css::uno::Reference< css::frame::XModel >& xModel);
diff --git a/offapi/com/sun/star/ui/XUIConfigurationManager.idl b/offapi/com/sun/star/ui/XUIConfigurationManager.idl
index 492d388d4402..cf18387f0ecb 100644
--- a/offapi/com/sun/star/ui/XUIConfigurationManager.idl
+++ b/offapi/com/sun/star/ui/XUIConfigurationManager.idl
@@ -218,13 +218,6 @@ interface XUIConfigurationManager : ::com::sun::star::uno::XInterface
*/
com::sun::star::ui::XAcceleratorConfiguration getShortCutManager();
- /**
- @since LibreOffice 7.6
- Creates a new configuration manager in case there are different views with different languages.
- This function enables those views to have short cut keys specific to the languages.
- */
- com::sun::star::ui::XAcceleratorConfiguration createShortCutManager();
-
/** retrieves the events manager from the user interface configuration manager.
<p>
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());
diff --git a/svtools/source/misc/acceleratorexecute.cxx b/svtools/source/misc/acceleratorexecute.cxx
index bc25a45661bd..9fa76e56deaf 100644
--- a/svtools/source/misc/acceleratorexecute.cxx
+++ b/svtools/source/misc/acceleratorexecute.cxx
@@ -38,8 +38,6 @@
#include <osl/mutex.hxx>
#include <rtl/ref.hxx>
-#include <comphelper/lok.hxx>
-
namespace svt
{
@@ -408,27 +406,6 @@ css::uno::Reference< css::ui::XAcceleratorConfiguration > AcceleratorExecute::st
return xAccCfg;
}
-css::uno::Reference<css::ui::XAcceleratorConfiguration> AcceleratorExecute::lok_createNewAcceleratorConfiguration(const css::uno::Reference< css::uno::XComponentContext >& rxContext, OUString sModule)
-{
- css::uno::Reference< css::ui::XModuleUIConfigurationManagerSupplier > xUISupplier(css::ui::theModuleUIConfigurationManagerSupplier::get(rxContext));
-
- try
- {
- css::uno::Reference<css::ui::XUIConfigurationManager> xUIManager = xUISupplier->getUIConfigurationManager(sModule);
-
- // Return new short cut manager in case current view's language is different from previous ones.
- return xUIManager->createShortCutManager();
- }
- catch(const css::container::NoSuchElementException&)
- {}
-
- return css::uno::Reference<css::ui::XAcceleratorConfiguration>();
-}
-
-void AcceleratorExecute::lok_setModuleConfig(css::uno::Reference<css::ui::XAcceleratorConfiguration> acceleratorConfig)
-{
- this->m_xModuleCfg = acceleratorConfig;
-}
css::uno::Reference< css::ui::XAcceleratorConfiguration > AcceleratorExecute::st_openDocConfig(const css::uno::Reference< css::frame::XModel >& xModel)
{