summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2016-09-13 01:26:03 +0200
committerMichael Stahl <mstahl@redhat.com>2016-09-13 13:09:44 +0000
commit7aa10d2be124386928314160c4d81dd7978c7494 (patch)
treead584596518a30343c6c94ad1b1e7c1424bb74af /editeng
parentfad9786b06d188ba6e354620f57176f3d94a6637 (diff)
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 <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/accessibility/AccessibleEditableTextPara.cxx62
1 files changed, 25 insertions, 37 deletions
diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
index 709a229f0932..0faf064416b7 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