diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-10-29 10:18:33 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-10-31 18:42:08 +0100 |
commit | a8bf972230545cd0c0e5dcacb73f5fff804d22de (patch) | |
tree | 3621ede2540c6d49b88f59616530d858ff9703cc /toolkit/source/controls/dialogcontrol.cxx | |
parent | 20354bce87305a274c046cca39ffe8f16add2322 (diff) |
Prepare for removal of non-const operator[] from Sequence in toolkit
Change-Id: I10b3f696fdb0bff1781fb22ec560e1c6dfc10b9e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124401
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'toolkit/source/controls/dialogcontrol.cxx')
-rw-r--r-- | toolkit/source/controls/dialogcontrol.cxx | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx index 5c5df64850f8..cb5446e7a8ce 100644 --- a/toolkit/source/controls/dialogcontrol.cxx +++ b/toolkit/source/controls/dialogcontrol.cxx @@ -160,8 +160,9 @@ public: { auto s(ControlModelContainerBase::getSupportedServiceNames()); s.realloc(s.getLength() + 2); - s[s.getLength() - 2] = "com.sun.star.awt.UnoControlDialogModel"; - s[s.getLength() - 1] = "stardiv.vcl.controlmodel.Dialog"; + auto ps = s.getArray(); + ps[s.getLength() - 2] = "com.sun.star.awt.UnoControlDialogModel"; + ps[s.getLength() - 1] = "stardiv.vcl.controlmodel.Dialog"; return s; } }; @@ -509,15 +510,14 @@ void SAL_CALL UnoDialogControl::windowResized( const css::awt::WindowEvent& e ) // Remember that changes have been done by listener. No need to // update the position because of property change event. mbSizeModified = true; - Sequence< OUString > aProps( 2 ); - Sequence< Any > aValues( 2 ); // Properties in a sequence must be sorted! - aProps[0] = "Height"; - aProps[1] = "Width"; - aValues[0] <<= sal_Int32( - std::clamp(aAppFontSize.Height(), tools::Long(SAL_MIN_INT32), tools::Long(SAL_MAX_INT32))); - aValues[1] <<= sal_Int32( - std::clamp(aAppFontSize.Width(), tools::Long(SAL_MIN_INT32), tools::Long(SAL_MAX_INT32))); + Sequence< OUString > aProps{ "Height", "Width" }; + Sequence< Any > aValues{ + Any(sal_Int32( + std::clamp(aAppFontSize.Height(), tools::Long(SAL_MIN_INT32), tools::Long(SAL_MAX_INT32)))), + Any(sal_Int32( + std::clamp(aAppFontSize.Width(), tools::Long(SAL_MIN_INT32), tools::Long(SAL_MAX_INT32)))) + }; ImplSetPropertyValues( aProps, aValues, true ); mbSizeModified = false; @@ -538,14 +538,13 @@ void SAL_CALL UnoDialogControl::windowMoved( const css::awt::WindowEvent& e ) // Remember that changes have been done by listener. No need to // update the position because of property change event. mbPosModified = true; - Sequence< OUString > aProps( 2 ); - Sequence< Any > aValues( 2 ); - aProps[0] = "PositionX"; - aProps[1] = "PositionY"; - aValues[0] <<= sal_Int32( - std::clamp(aTmp.Width(), tools::Long(SAL_MIN_INT32), tools::Long(SAL_MAX_INT32))); - aValues[1] <<= sal_Int32( - std::clamp(aTmp.Height(), tools::Long(SAL_MIN_INT32), tools::Long(SAL_MAX_INT32))); + Sequence< OUString > aProps{ "PositionX", "PositionY" }; + Sequence< Any > aValues{ + Any(sal_Int32( + std::clamp(aTmp.Width(), tools::Long(SAL_MIN_INT32), tools::Long(SAL_MAX_INT32)))), + Any(sal_Int32( + std::clamp(aTmp.Height(), tools::Long(SAL_MIN_INT32), tools::Long(SAL_MAX_INT32)))) + }; ImplSetPropertyValues( aProps, aValues, true ); mbPosModified = false; |