sd/inc/TransitionPreset.hxx | 4 +- sd/source/core/TransitionPreset.cxx | 44 ++++++++++-------------- sd/source/ui/animations/CustomAnimationPane.cxx | 14 ++++++- sd/source/ui/animations/SlideTransitionPane.cxx | 14 ++++++- 4 files changed, 46 insertions(+), 30 deletions(-)
New commits: commit 12ff9056ff468c407af389aa2fbf7943d839b93b Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> AuthorDate: Mon Jan 28 20:39:17 2019 -0500 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Aug 7 12:56:29 2019 +0200 sd: LOK: support localization of slide transition presets Reviewed-on: https://gerrit.libreoffice.org/68264 Reviewed-by: Andras Timar <andras.ti...@collabora.com> Tested-by: Andras Timar <andras.ti...@collabora.com> (cherry picked from commit 312346531dde33cd000a1d3c95c7b7829b656438) Reviewed-on: https://gerrit.libreoffice.org/76283 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> (cherry picked from commit 3fa4f52ad52a1db53c2336eac8053502b03681e3) Change-Id: Ic3ea57e537e118e10d155203921574967154c234 Reviewed-on: https://gerrit.libreoffice.org/77083 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sd/inc/TransitionPreset.hxx b/sd/inc/TransitionPreset.hxx index d4c5381c7039..19a5228c910d 100644 --- a/sd/inc/TransitionPreset.hxx +++ b/sd/inc/TransitionPreset.hxx @@ -42,7 +42,6 @@ class TransitionPreset { public: static const TransitionPresetList& getTransitionPresetList(); - static bool importTransitionPresetList( TransitionPresetList& rList ); sal_Int16 getTransition() const { return mnTransition; } sal_Int16 getSubtype() const { return mnSubtype; } @@ -57,6 +56,9 @@ public: private: TransitionPreset( const css::uno::Reference< css::animations::XAnimationNode >& xNode ); + static bool importTransitionPresetList(TransitionPresetList& rList); + static std::map<OUString, TransitionPresetList> mPresetsMap; + sal_Int16 mnTransition; sal_Int16 mnSubtype; bool mbDirection; diff --git a/sd/source/core/TransitionPreset.cxx b/sd/source/core/TransitionPreset.cxx index 26c89f96bca5..ac6f7ad79598 100644 --- a/sd/source/core/TransitionPreset.cxx +++ b/sd/source/core/TransitionPreset.cxx @@ -30,13 +30,17 @@ #include <comphelper/getexpandeduri.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/propertysequence.hxx> +#include <comphelper/lok.hxx> #include <unotools/pathoptions.hxx> +#include <unotools/syslocaleoptions.hxx> #include <officecfg/Office/UI/Effects.hxx> #include <tools/stream.hxx> #include <rtl/uri.hxx> #include <rtl/instance.hxx> #include <sal/log.hxx> +#include <osl/diagnose.h> +#include <vcl/svapp.hxx> #include <CustomAnimationPreset.hxx> #include <TransitionPreset.hxx> @@ -237,34 +241,24 @@ bool TransitionPreset::importTransitionPresetList( TransitionPresetList& rList ) return bRet; } -namespace -{ - class ImportedTransitionPresetList - { - private: - sd::TransitionPresetList m_aTransitionPresetList; - public: - ImportedTransitionPresetList() - { - sd::TransitionPreset::importTransitionPresetList( - m_aTransitionPresetList); - } - const sd::TransitionPresetList& getList() const - { - return m_aTransitionPresetList; - } - }; - - class theTransitionPresetList : - public rtl::Static<ImportedTransitionPresetList, - theTransitionPresetList> - { - }; -} +std::map<OUString, TransitionPresetList> sd::TransitionPreset::mPresetsMap; const TransitionPresetList& TransitionPreset::getTransitionPresetList() { - return theTransitionPresetList::get().getList(); + // Support localization per-view. Currently not useful for Desktop + // but very much critical for LOK. The cache now is per-language. + const OUString aLang = comphelper::LibreOfficeKit::isActive() + ? comphelper::LibreOfficeKit::getLanguageTag().getLanguage() + : SvtSysLocaleOptions().GetLanguageTag().getLanguage(); + + SolarMutexGuard aGuard; + const auto it = mPresetsMap.find(aLang); + if (it != mPresetsMap.end()) + return it->second; + + TransitionPresetList& rList = mPresetsMap[aLang]; + sd::TransitionPreset::importTransitionPresetList(rList); + return rList; } } commit d0ad5705ff6a06620c685cde4166424c40214f1e Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> AuthorDate: Sat Aug 18 09:59:53 2018 -0400 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Aug 7 12:56:24 2019 +0200 sidebar: hide preview and play controls in lokit Change-Id: I7fc9470082612af4c4d7e56ff704936da5c63ce4 Reviewed-on: https://gerrit.libreoffice.org/73501 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> (cherry picked from commit a59b4a2dcec4ad2131350a9999185ebcd07c5fc8) Reviewed-on: https://gerrit.libreoffice.org/77082 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index 76794375426b..0db0f4723d8f 100644 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -50,6 +50,7 @@ #include <vcl/combobox.hxx> #include <vcl/scrbar.hxx> +#include <comphelper/lok.hxx> #include <comphelper/sequence.hxx> #include <sfx2/frame.hxx> #include <sfx2/sidebar/Theme.hxx> @@ -495,8 +496,17 @@ void CustomAnimationPane::updateControls() mpFTDuration->Enable( mxView.is() ); mpCBXDuration->Enable( mxView.is() ); mpCustomAnimationList->Enable( mxView.is() ); - mpPBPlay->Enable( mxView.is() ); - mpCBAutoPreview->Enable( mxView.is() ); + if (comphelper::LibreOfficeKit::isActive()) + { + mpPBPlay->Hide(); + mpCBAutoPreview->Check(false); + mpCBAutoPreview->Hide(); + } + else + { + mpPBPlay->Enable( mxView.is() ); + mpCBAutoPreview->Enable( mxView.is() ); + } if( !mxView.is() ) { diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx index b7025bacfb30..e43c2f28520f 100644 --- a/sd/source/ui/animations/SlideTransitionPane.cxx +++ b/sd/source/ui/animations/SlideTransitionPane.cxx @@ -36,6 +36,7 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <EventMultiplexer.hxx> +#include <comphelper/lok.hxx> #include <sal/log.hxx> #include <svtools/controldims.hxx> #include <svx/gallery.hxx> @@ -698,8 +699,17 @@ void SlideTransitionPane::updateControls() mpMF_ADVANCE_AUTO_AFTER->SetValue( aEffect.mfTime * 100.0); } - SdOptions* pOptions = SD_MOD()->GetSdOptions(DocumentType::Impress); - mpCB_AUTO_PREVIEW->Check( pOptions->IsPreviewTransitions() ); + if (comphelper::LibreOfficeKit::isActive()) + { + mpPB_PLAY->Hide(); + mpCB_AUTO_PREVIEW->Check(false); + mpCB_AUTO_PREVIEW->Hide(); + } + else + { + SdOptions* pOptions = SD_MOD()->GetSdOptions(DocumentType::Impress); + mpCB_AUTO_PREVIEW->Check( pOptions->IsPreviewTransitions() ); + } mbUpdatingControls = false; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits