diff options
author | Mohammed Abdul Azeem <azeemmysore@gmail.com> | 2017-02-07 23:53:43 +0530 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2017-02-08 10:49:34 +0000 |
commit | 9b724094873d0808f0bd8ddab24adc372ae4e41c (patch) | |
tree | 890bcde7477298539d13f395ed2a302e2d3dfe68 /sc/source/filter/xml/xmlrowi.cxx | |
parent | 73cc391e9c9646e09722ce4324918646202c693b (diff) |
Adding an iterator for fastattributes:
This helps to avoid the expensive allocation and
freeing of OUString at some places.
Change-Id: I7d49974ce13799fcf62b989ce5d3c61b01316190
Reviewed-on: https://gerrit.libreoffice.org/34011
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'sc/source/filter/xml/xmlrowi.cxx')
-rw-r--r-- | sc/source/filter/xml/xmlrowi.cxx | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/sc/source/filter/xml/xmlrowi.cxx b/sc/source/filter/xml/xmlrowi.cxx index a8409582444d..0be493426951 100644 --- a/sc/source/filter/xml/xmlrowi.cxx +++ b/sc/source/filter/xml/xmlrowi.cxx @@ -59,37 +59,34 @@ ScXMLTableRowContext::ScXMLTableRowContext( ScXMLImport& rImport, assert( dynamic_cast< sax_fastparser::FastAttributeList *>( xAttrList.get() ) != nullptr ); pAttribList = static_cast< sax_fastparser::FastAttributeList *>( xAttrList.get() ); - const std::vector< sal_Int32 >& rAttrList = pAttribList->getFastAttributeTokens(); - for ( size_t i = 0; i < rAttrList.size(); i++ ) + for ( auto it = pAttribList->begin(); it != pAttribList->end(); ++it) { - const OUString sValue = OUString(pAttribList->getFastAttributeValue(i), - pAttribList->AttributeValueLength(i), RTL_TEXTENCODING_UTF8); - switch( rAttrTokenMap.Get( rAttrList[ i ] ) ) + switch( rAttrTokenMap.Get( it.getToken() ) ) { case XML_TOK_TABLE_ROW_ATTR_STYLE_NAME: { - sStyleName = sValue; + sStyleName = it.toString(); } break; case XML_TOK_TABLE_ROW_ATTR_VISIBILITY: { - sVisibility = sValue; + sVisibility = it.toString(); } break; case XML_TOK_TABLE_ROW_ATTR_REPEATED: { - nRepeatedRows = std::max( sValue.toInt32(), (sal_Int32) 1 ); + nRepeatedRows = std::max( it.toInt32(), (sal_Int32) 1 ); nRepeatedRows = std::min( nRepeatedRows, MAXROWCOUNT ); } break; case XML_TOK_TABLE_ROW_ATTR_DEFAULT_CELL_STYLE_NAME: { - sCellStyleName = sValue; + sCellStyleName = it.toString(); } break; /*case XML_TOK_TABLE_ROW_ATTR_USE_OPTIMAL_HEIGHT: { - sOptimalHeight = sValue; + sOptimalHeight = it.toString(); } break;*/ } |