editeng/source/accessibility/AccessibleEditableTextPara.cxx | 62 ++++-------- 1 file changed, 25 insertions(+), 37 deletions(-)
New commits: commit 7aa10d2be124386928314160c4d81dd7978c7494 Author: Jochen Nitschke <j.nitschke+loger...@ok.de> Date: Tue Sep 13 01:26:03 2016 +0200 fix out of bounds error there are 22 entries, but Sequence was allocated with 21 fields Change-Id: I6af71e2ece99b643843b4d82e0c6be332be361fa Reviewed-on: https://gerrit.libreoffice.org/28852 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Michael Stahl <mst...@redhat.com> diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx index 709a229..0faf064 100644 --- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx +++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx @@ -831,43 +831,31 @@ namespace accessibility static uno::Sequence< OUString > const & getAttributeNames() { - static uno::Sequence< OUString >* pNames = nullptr; - - if( pNames == nullptr ) - { - uno::Sequence< OUString >* pSeq = new uno::Sequence< OUString >( 21 ); - OUString* pStrings = pSeq->getArray(); - sal_Int32 i = 0; - #define STR(x) pStrings[i++] = x - STR("CharColor"); - STR("CharContoured"); - STR("CharEmphasis"); - STR("CharEscapement"); - STR("CharFontName"); - STR("CharHeight"); - STR("CharPosture"); - STR("CharShadowed"); - STR("CharStrikeout"); - STR("CharCaseMap"); - STR("CharUnderline"); - STR("CharUnderlineColor"); - STR("CharWeight"); - STR("NumberingLevel"); - STR("NumberingRules"); - STR("ParaAdjust"); - STR("ParaBottomMargin"); - STR("ParaFirstLineIndent"); - STR("ParaLeftMargin"); - STR("ParaLineSpacing"); - STR("ParaRightMargin"); - STR("ParaTabStops"); - #undef STR - DBG_ASSERT( i == pSeq->getLength(), "Please adjust length" ); - if( i != pSeq->getLength() ) - pSeq->realloc( i ); - pNames = pSeq; - } - return *pNames; + static const uno::Sequence<OUString> aNames{ + "CharColor", + "CharContoured", + "CharEmphasis", + "CharEscapement", + "CharFontName", + "CharHeight", + "CharPosture", + "CharShadowed", + "CharStrikeout", + "CharCaseMap", + "CharUnderline", + "CharUnderlineColor", + "CharWeight", + "NumberingLevel", + "NumberingRules", + "ParaAdjust", + "ParaBottomMargin", + "ParaFirstLineIndent", + "ParaLeftMargin", + "ParaLineSpacing", + "ParaRightMargin", + "ParaTabStops"}; + + return aNames; } struct IndexCompare _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits