summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-10-29 09:34:00 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-10-30 00:30:45 +0200
commit5823c27d7fbce3e65ff8684f0a5f21d14a97ab77 (patch)
tree5f3a09a7b455c496a8f535595eb02e3f1a2a69c7 /editeng
parent52f6aa4bf1047f98ab9884799baa104bca9d2a47 (diff)
Prepare for removal of non-const operator[] from Sequence in editeng
Change-Id: Ibdf2db715cb85481342db2a72f27bea6a5b73b7a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124360 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/accessibility/AccessibleEditableTextPara.cxx4
-rw-r--r--editeng/source/items/frmitems.cxx34
-rw-r--r--editeng/source/items/paraitem.cxx18
-rw-r--r--editeng/source/items/textitem.cxx3
-rw-r--r--editeng/source/misc/hangulhanja.cxx5
5 files changed, 35 insertions, 29 deletions
diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
index 79fb443c6d85..e547767911e2 100644
--- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx
+++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
@@ -1247,7 +1247,7 @@ namespace accessibility
// NumberingPrefix
sal_Int32 nRes = aRes.getLength();
aRes.realloc( nRes + 1 );
- beans::PropertyValue &rRes = aRes[nRes];
+ beans::PropertyValue &rRes = aRes.getArray()[nRes];
rRes.Name = "NumberingPrefix";
OUString numStr;
if (aBulletInfo.nType != SVX_NUM_CHAR_SPECIAL && aBulletInfo.nType != SVX_NUM_BITMAP)
@@ -1261,7 +1261,7 @@ namespace accessibility
{
nRes = aRes.getLength();
aRes.realloc( nRes + 1 );
- beans::PropertyValue &rResField = aRes[nRes];
+ beans::PropertyValue &rResField = aRes.getArray()[nRes];
rResField.Name = "FieldType";
rResField.Value <<= strFieldType.toAsciiLowerCase();
rResField.Handle = -1;
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 6aec451c8024..ba55d734515c 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -1388,16 +1388,17 @@ bool SvxBoxItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
case 0:
{
// 4 Borders and 5 distances
- uno::Sequence< uno::Any > aSeq( 9 );
- aSeq[0] <<= SvxBoxItem::SvxLineToLine(GetLeft(), bConvert);
- aSeq[1] <<= SvxBoxItem::SvxLineToLine(GetRight(), bConvert);
- aSeq[2] <<= SvxBoxItem::SvxLineToLine(GetBottom(), bConvert);
- aSeq[3] <<= SvxBoxItem::SvxLineToLine(GetTop(), bConvert);
- aSeq[4] <<= static_cast<sal_Int32>(bConvert ? convertTwipToMm100( GetSmallestDistance()) : GetSmallestDistance());
- aSeq[5] <<= static_cast<sal_Int32>(bConvert ? convertTwipToMm100( nTopDist ) : nTopDist );
- aSeq[6] <<= static_cast<sal_Int32>(bConvert ? convertTwipToMm100( nBottomDist ) : nBottomDist );
- aSeq[7] <<= static_cast<sal_Int32>(bConvert ? convertTwipToMm100( nLeftDist ) : nLeftDist );
- aSeq[8] <<= static_cast<sal_Int32>(bConvert ? convertTwipToMm100( nRightDist ) : nRightDist );
+ uno::Sequence< uno::Any > aSeq{
+ uno::Any(SvxBoxItem::SvxLineToLine(GetLeft(), bConvert)),
+ uno::Any(SvxBoxItem::SvxLineToLine(GetRight(), bConvert)),
+ uno::Any(SvxBoxItem::SvxLineToLine(GetBottom(), bConvert)),
+ uno::Any(SvxBoxItem::SvxLineToLine(GetTop(), bConvert)),
+ uno::Any(static_cast<sal_Int32>(bConvert ? convertTwipToMm100( GetSmallestDistance()) : GetSmallestDistance())),
+ uno::Any(static_cast<sal_Int32>(bConvert ? convertTwipToMm100( nTopDist ) : nTopDist )),
+ uno::Any(static_cast<sal_Int32>(bConvert ? convertTwipToMm100( nBottomDist ) : nBottomDist )),
+ uno::Any(static_cast<sal_Int32>(bConvert ? convertTwipToMm100( nLeftDist ) : nLeftDist )),
+ uno::Any(static_cast<sal_Int32>(bConvert ? convertTwipToMm100( nRightDist ) : nRightDist ))
+ };
rVal <<= aSeq;
return true;
}
@@ -2209,18 +2210,19 @@ bool SvxBoxInfoItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
case 0:
{
// 2 BorderLines, flags, valid flags and distance
- css::uno::Sequence< css::uno::Any > aSeq( 5 );
- aSeq[0] <<= SvxBoxItem::SvxLineToLine( pHori.get(), bConvert);
- aSeq[1] <<= SvxBoxItem::SvxLineToLine( pVert.get(), bConvert);
if ( IsTable() )
nVal |= 0x01;
if ( IsDist() )
nVal |= 0x02;
if ( IsMinDist() )
nVal |= 0x04;
- aSeq[2] <<= nVal;
- aSeq[3] <<= static_cast<sal_Int16>(nValidFlags);
- aSeq[4] <<= static_cast<sal_Int32>(bConvert ? convertTwipToMm100(GetDefDist()) : GetDefDist());
+ css::uno::Sequence< css::uno::Any > aSeq{
+ uno::Any(SvxBoxItem::SvxLineToLine( pHori.get(), bConvert)),
+ uno::Any(SvxBoxItem::SvxLineToLine( pVert.get(), bConvert)),
+ uno::Any(nVal),
+ uno::Any(static_cast<sal_Int16>(nValidFlags)),
+ uno::Any(static_cast<sal_Int32>(bConvert ? convertTwipToMm100(GetDefDist()) : GetDefDist()))
+ };
rVal <<= aSeq;
return true;
}
diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx
index aa15c834846a..6f5e5f9acd80 100644
--- a/editeng/source/items/paraitem.cxx
+++ b/editeng/source/items/paraitem.cxx
@@ -824,35 +824,37 @@ bool SvxTabStopItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
uno::Sequence < uno::Sequence < uno::Any > > aAnySeq;
if (!(rVal >>= aAnySeq))
return false;
+ auto aAnySeqRange = asNonConstRange(aAnySeq);
sal_Int32 nLength = aAnySeq.getLength();
aSeq.realloc( nLength );
+ auto pSeq = aSeq.getArray();
for ( sal_Int32 n=0; n<nLength; n++ )
{
- uno::Sequence < uno::Any >& rAnySeq = aAnySeq[n];
+ uno::Sequence < uno::Any >& rAnySeq = aAnySeqRange[n];
if ( rAnySeq.getLength() == 4 )
{
- if (!(rAnySeq[0] >>= aSeq[n].Position)) return false;
- if (!(rAnySeq[1] >>= aSeq[n].Alignment))
+ if (!(rAnySeq[0] >>= pSeq[n].Position)) return false;
+ if (!(rAnySeq[1] >>= pSeq[n].Alignment))
{
sal_Int32 nVal = 0;
if (rAnySeq[1] >>= nVal)
- aSeq[n].Alignment = static_cast<css::style::TabAlign>(nVal);
+ pSeq[n].Alignment = static_cast<css::style::TabAlign>(nVal);
else
return false;
}
- if (!(rAnySeq[2] >>= aSeq[n].DecimalChar))
+ if (!(rAnySeq[2] >>= pSeq[n].DecimalChar))
{
OUString aVal;
if ( (rAnySeq[2] >>= aVal) && aVal.getLength() == 1 )
- aSeq[n].DecimalChar = aVal.toChar();
+ pSeq[n].DecimalChar = aVal.toChar();
else
return false;
}
- if (!(rAnySeq[3] >>= aSeq[n].FillChar))
+ if (!(rAnySeq[3] >>= pSeq[n].FillChar))
{
OUString aVal;
if ( (rAnySeq[3] >>= aVal) && aVal.getLength() == 1 )
- aSeq[n].FillChar = aVal.toChar();
+ pSeq[n].FillChar = aVal.toChar();
else
return false;
}
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index 22c86e4cabd1..75470ff20e4a 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -114,9 +114,10 @@ SvxFontListItem::SvxFontListItem( const FontList* pFontLst,
{
sal_Int32 nCount = pFontList->GetFontNameCount();
aFontNameSeq.realloc( nCount );
+ auto pFontNameSeq = aFontNameSeq.getArray();
for ( sal_Int32 i = 0; i < nCount; i++ )
- aFontNameSeq[i] = pFontList->GetFontName(i).GetFamilyName();
+ pFontNameSeq[i] = pFontList->GetFontName(i).GetFamilyName();
}
}
diff --git a/editeng/source/misc/hangulhanja.cxx b/editeng/source/misc/hangulhanja.cxx
index 67eb7aae9b3d..186a7ccb2298 100644
--- a/editeng/source/misc/hangulhanja.cxx
+++ b/editeng/source/misc/hangulhanja.cxx
@@ -407,13 +407,14 @@ namespace editeng
{
sal_Int32 nCount = m_aCurrentSuggestions.getLength();
Sequence< OUString > aTmp(nCount);
- aTmp[0]=aRecentlyUsed->second;
+ auto pTmp = aTmp.getArray();
+ pTmp[0]=aRecentlyUsed->second;
sal_Int32 nDiff = 1;
for( sal_Int32 n=1; n<nCount; n++)//we had 0 already
{
if( nDiff && m_aCurrentSuggestions[n-nDiff]==aRecentlyUsed->second )
nDiff=0;
- aTmp[n]=m_aCurrentSuggestions[n-nDiff];
+ pTmp[n]=m_aCurrentSuggestions[n-nDiff];
}
m_aCurrentSuggestions = aTmp;
}