From 8f32509ee51a4985d17b65d6c6540081471951e7 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 9 Dec 2019 09:27:55 +0000 Subject: no longer have to worry about intra-module compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit in 'the next minor update' Change-Id: I1faffbbdf6d3bb538737568931d9053c4ec6bd11 Reviewed-on: https://gerrit.libreoffice.org/84731 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- include/vcl/edit.hxx | 5 +++-- vcl/source/control/edit.cxx | 19 +++++++------------ 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/include/vcl/edit.hxx b/include/vcl/edit.hxx index 5958f124ae51..3d4d8a790aa4 100644 --- a/include/vcl/edit.hxx +++ b/include/vcl/edit.hxx @@ -87,6 +87,7 @@ private: Link maActivateHdl; std::unique_ptr mpUIBuilder; + css::uno::Reference mxBreakIterator; css::uno::Reference mxISC; SAL_DLLPRIVATE bool ImplTruncateToMaxLen( OUString&, sal_Int32 nSelectionLen ) const; @@ -113,8 +114,8 @@ private: SAL_DLLPRIVATE void ImplCopy(css::uno::Reference const & rxClipboard); SAL_DLLPRIVATE void ImplPaste(css::uno::Reference const & rxClipboard); SAL_DLLPRIVATE long ImplGetTextYPosition() const; - SAL_DLLPRIVATE css::uno::Reference const & ImplGetInputSequenceChecker(); - SAL_DLLPRIVATE static css::uno::Reference ImplGetBreakIterator(); + SAL_DLLPRIVATE css::uno::Reference const& ImplGetInputSequenceChecker(); + SAL_DLLPRIVATE css::uno::Reference const& ImplGetBreakIterator(); SAL_DLLPRIVATE void filterText(); protected: diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 6eb9e991a38b..0bd6273670e3 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -739,22 +739,17 @@ OUString Edit::ImplGetValidString( const OUString& rString ) return aValidString; } -uno::Reference < i18n::XBreakIterator > Edit::ImplGetBreakIterator() +uno::Reference const& Edit::ImplGetBreakIterator() { - //!! since we don't want to become incompatible in the next minor update - //!! where this code will get integrated into, xISC will be a local - //!! variable instead of a class member! - uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); - return i18n::BreakIterator::create(xContext); + if (!mxBreakIterator) + mxBreakIterator = i18n::BreakIterator::create(::comphelper::getProcessComponentContext()); + return mxBreakIterator; } -uno::Reference < i18n::XExtendedInputSequenceChecker > const & Edit::ImplGetInputSequenceChecker() +uno::Reference const& Edit::ImplGetInputSequenceChecker() { - if ( !mxISC.is() ) - { - mxISC = i18n::InputSequenceChecker::create( - ::comphelper::getProcessComponentContext() ); - } + if (!mxISC.is()) + mxISC = i18n::InputSequenceChecker::create(::comphelper::getProcessComponentContext()); return mxISC; } -- cgit