summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2021-06-09 23:17:41 +0200
committerJulien Nabet <serval2412@yahoo.fr>2021-06-10 08:30:12 +0200
commit159030991c70fc3c4018ef28abf1814902a0aebb (patch)
tree02f3b436f205a71e32b3fbaa9c4ab21d2ab5f830 /svx
parent36db408b9027da01464927e5853950435596ae05 (diff)
Simplify Sequences initializations (sot/stock/svl/svtools/svx)
Change-Id: Iec21851d69f4a8d5f557e9ed2d30e5f680cd62c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116943 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/accessibility/charmapacc.cxx8
-rw-r--r--svx/source/fmcomp/gridcell.cxx15
-rw-r--r--svx/source/form/formcontroller.cxx13
-rw-r--r--svx/source/xml/xmleohlp.cxx2
4 files changed, 15 insertions, 23 deletions
diff --git a/svx/source/accessibility/charmapacc.cxx b/svx/source/accessibility/charmapacc.cxx
index b70927a1c626..0de91ccee450 100644
--- a/svx/source/accessibility/charmapacc.cxx
+++ b/svx/source/accessibility/charmapacc.cxx
@@ -287,18 +287,14 @@ Sequence< sal_Int32 > SAL_CALL SvxShowCharSetAcc::getSelectedAccessibleRows( )
{
OExternalLockGuard aGuard( this );
- Sequence< sal_Int32 > aSel(1);
- aSel[0] = SvxShowCharSet::GetRowPos(m_pParent->GetSelectIndexId());
- return aSel;
+ return { SvxShowCharSet::GetRowPos(m_pParent->GetSelectIndexId()) };
}
Sequence< sal_Int32 > SAL_CALL SvxShowCharSetAcc::getSelectedAccessibleColumns( )
{
OExternalLockGuard aGuard( this );
- Sequence< sal_Int32 > aSel(1);
- aSel[0] = SvxShowCharSet::GetColumnPos(m_pParent->GetSelectIndexId());
- return aSel;
+ return { SvxShowCharSet::GetColumnPos(m_pParent->GetSelectIndexId()) };
}
sal_Bool SAL_CALL SvxShowCharSetAcc::isAccessibleRowSelected( sal_Int32 nRow )
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index e1f01621024e..cb5129e89326 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -53,7 +53,7 @@
#include <comphelper/types.hxx>
#include <connectivity/formattedcolumnvalue.hxx>
#include <i18nlangtag/lang.h>
-
+#include <o3tl/safeint.hxx>
#include <svl/numuno.hxx>
#include <svl/zforlist.hxx>
#include <svx/dialmgr.hxx>
@@ -4064,7 +4064,6 @@ sal_Int16 SAL_CALL FmXListBoxCell::getSelectedItemPos()
Sequence< sal_Int16 > SAL_CALL FmXListBoxCell::getSelectedItemsPos()
{
::osl::MutexGuard aGuard( m_aMutex );
- Sequence<sal_Int16> aSeq;
if (m_pBox)
{
@@ -4073,11 +4072,10 @@ Sequence< sal_Int16 > SAL_CALL FmXListBoxCell::getSelectedItemsPos()
auto nActive = rBox.get_active();
if (nActive != -1)
{
- aSeq = Sequence<sal_Int16>(1);
- aSeq.getArray()[0] = nActive;
+ return { o3tl::narrowing<short>(nActive) };
}
}
- return aSeq;
+ return {};
}
OUString SAL_CALL FmXListBoxCell::getSelectedItem()
@@ -4100,8 +4098,6 @@ css::uno::Sequence<OUString> SAL_CALL FmXListBoxCell::getSelectedItems()
{
::osl::MutexGuard aGuard( m_aMutex );
- css::uno::Sequence<OUString> aSeq;
-
if (m_pBox)
{
UpdateFromColumn();
@@ -4109,11 +4105,10 @@ css::uno::Sequence<OUString> SAL_CALL FmXListBoxCell::getSelectedItems()
auto nActive = rBox.get_active();
if (nActive != -1)
{
- aSeq = css::uno::Sequence<OUString>(1);
- aSeq.getArray()[0] = rBox.get_text(nActive);
+ return { rBox.get_text(nActive) };
}
}
- return aSeq;
+ return {};
}
void SAL_CALL FmXListBoxCell::selectItemPos(sal_Int16 nPos, sal_Bool bSelect)
diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx
index 84aef7b60d90..f71034f17348 100644
--- a/svx/source/form/formcontroller.cxx
+++ b/svx/source/form/formcontroller.cxx
@@ -4150,12 +4150,13 @@ void FormController::deleteInterceptor(const Reference< XDispatchProviderInterce
void FormController::implInvalidateCurrentControlDependentFeatures()
{
- Sequence< sal_Int16 > aCurrentControlDependentFeatures(4);
-
- aCurrentControlDependentFeatures[0] = FormFeature::SortAscending;
- aCurrentControlDependentFeatures[1] = FormFeature::SortDescending;
- aCurrentControlDependentFeatures[2] = FormFeature::AutoFilter;
- aCurrentControlDependentFeatures[3] = FormFeature::RefreshCurrentControl;
+ Sequence< sal_Int16 > aCurrentControlDependentFeatures
+ {
+ FormFeature::SortAscending,
+ FormFeature::SortDescending,
+ FormFeature::AutoFilter,
+ FormFeature::RefreshCurrentControl
+ };
invalidateFeatures( aCurrentControlDependentFeatures );
}
diff --git a/svx/source/xml/xmleohlp.cxx b/svx/source/xml/xmleohlp.cxx
index c63be9f109e0..1e850a2c0703 100644
--- a/svx/source/xml/xmleohlp.cxx
+++ b/svx/source/xml/xmleohlp.cxx
@@ -666,7 +666,7 @@ Any SAL_CALL SvXMLEmbeddedObjectHelper::getByName(
Sequence< OUString > SAL_CALL SvXMLEmbeddedObjectHelper::getElementNames()
{
- return Sequence< OUString >(0);
+ return {};
}
sal_Bool SAL_CALL SvXMLEmbeddedObjectHelper::hasByName( const OUString& rURLStr )