diff options
author | Mohammed Abdul Azeem <azeemmysore@gmail.com> | 2017-07-09 22:37:00 +0530 |
---|---|---|
committer | Mohammed Abdul Azeem <azeemmysore@gmail.com> | 2017-07-10 20:05:09 +0200 |
commit | 5364990831a7d5773ddbc2f35842c7b3a8d5534a (patch) | |
tree | 6072d6dd0ded790d5658be55b1a619f4dcda6ee4 /sc | |
parent | 271882910107e177bc98af877f9c8b9f89c09795 (diff) |
Adding an overloaded IsXMLToken method:
Passing FastAttributeIter to the method makes the
code much cleaner and easy to read.
Change-Id: I227e9dc378dfba51168c29452667576a779dc215
Reviewed-on: https://gerrit.libreoffice.org/39730
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/xml/XMLCalculationSettingsContext.cxx | 12 | ||||
-rw-r--r-- | sc/source/filter/xml/XMLConsolidationContext.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/xml/datastreamimport.cxx | 4 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlbodyi.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlcelli.cxx | 4 | ||||
-rw-r--r-- | sc/source/filter/xml/xmldrani.cxx | 14 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlexternaltabi.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlrowi.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/xml/xmltabi.cxx | 4 |
9 files changed, 23 insertions, 23 deletions
diff --git a/sc/source/filter/xml/XMLCalculationSettingsContext.cxx b/sc/source/filter/xml/XMLCalculationSettingsContext.cxx index f39ccebe5eb6..e885d737de33 100644 --- a/sc/source/filter/xml/XMLCalculationSettingsContext.cxx +++ b/sc/source/filter/xml/XMLCalculationSettingsContext.cxx @@ -58,19 +58,19 @@ ScXMLCalculationSettingsContext::ScXMLCalculationSettingsContext( ScXMLImport& r switch( aIter.getToken() ) { case XML_ELEMENT( TABLE, XML_CASE_SENSITIVE ): - if( IsXMLToken( aIter.toCString(), XML_FALSE ) ) + if( IsXMLToken( aIter, XML_FALSE ) ) bIgnoreCase = true; break; case XML_ELEMENT( TABLE, XML_PRECISION_AS_SHOWN ): - if( IsXMLToken( aIter.toCString(), XML_TRUE ) ) + if( IsXMLToken( aIter, XML_TRUE ) ) bCalcAsShown = true; break; case XML_ELEMENT( TABLE, XML_SEARCH_CRITERIA_MUST_APPLY_TO_WHOLE_CELL ): - if( IsXMLToken( aIter.toCString(), XML_FALSE ) ) + if( IsXMLToken( aIter, XML_FALSE ) ) bMatchWholeCell = false; break; case XML_ELEMENT( TABLE, XML_AUTOMATIC_FIND_LABELS ): - if( IsXMLToken( aIter.toCString(), XML_FALSE ) ) + if( IsXMLToken( aIter, XML_FALSE ) ) bLookUpLabels = false; break; case XML_ELEMENT( TABLE, XML_NULL_YEAR ): @@ -80,11 +80,11 @@ ScXMLCalculationSettingsContext::ScXMLCalculationSettingsContext( ScXMLImport& r break; case XML_ELEMENT( TABLE, XML_USE_REGULAR_EXPRESSIONS ): // Overwrite only the default (regex true) value, not wildcard. - if( eSearchType == utl::SearchParam::SearchType::Regexp && IsXMLToken( aIter.toCString(), XML_FALSE ) ) + if( eSearchType == utl::SearchParam::SearchType::Regexp && IsXMLToken( aIter, XML_FALSE ) ) eSearchType = utl::SearchParam::SearchType::Normal; break; case XML_ELEMENT( TABLE, XML_USE_WILDCARDS ): - if( IsXMLToken( aIter.toCString(), XML_TRUE ) ) + if( IsXMLToken( aIter, XML_TRUE ) ) eSearchType = utl::SearchParam::SearchType::Wildcard; break; } diff --git a/sc/source/filter/xml/XMLConsolidationContext.cxx b/sc/source/filter/xml/XMLConsolidationContext.cxx index 8e27b573de7b..092f561cec99 100644 --- a/sc/source/filter/xml/XMLConsolidationContext.cxx +++ b/sc/source/filter/xml/XMLConsolidationContext.cxx @@ -65,7 +65,7 @@ ScXMLConsolidationContext::ScXMLConsolidationContext( sUseLabel = aIter.toString(); break; case XML_ELEMENT( TABLE, XML_LINK_TO_SOURCE_DATA ): - bLinkToSource = IsXMLToken( aIter.toCString(), XML_TRUE ); + bLinkToSource = IsXMLToken( aIter, XML_TRUE ); break; } } diff --git a/sc/source/filter/xml/datastreamimport.cxx b/sc/source/filter/xml/datastreamimport.cxx index 5e19c5215c15..4b61ae9398e5 100644 --- a/sc/source/filter/xml/datastreamimport.cxx +++ b/sc/source/filter/xml/datastreamimport.cxx @@ -49,10 +49,10 @@ ScXMLDataStreamContext::ScXMLDataStreamContext( } break; case XML_ELEMENT( CALC_EXT, XML_EMPTY_LINE_REFRESH ): - mbRefreshOnEmpty = IsXMLToken( aIter.toCString(), XML_TRUE ); + mbRefreshOnEmpty = IsXMLToken( aIter, XML_TRUE ); break; case XML_ELEMENT( CALC_EXT, XML_INSERTION_POSITION ): - meInsertPos = IsXMLToken( aIter.toCString(), XML_TOP ) ? + meInsertPos = IsXMLToken( aIter, XML_TOP ) ? sc::ImportPostProcessData::DataStream::InsertTop : sc::ImportPostProcessData::DataStream::InsertBottom; break; diff --git a/sc/source/filter/xml/xmlbodyi.cxx b/sc/source/filter/xml/xmlbodyi.cxx index e6f7bdfa8e7b..b8ad60262c87 100644 --- a/sc/source/filter/xml/xmlbodyi.cxx +++ b/sc/source/filter/xml/xmlbodyi.cxx @@ -102,7 +102,7 @@ ScXMLBodyContext::ScXMLBodyContext( ScXMLImport& rImport, { const sal_Int32 nLocalToken = nToken & TOKEN_MASK; if( nLocalToken == XML_STRUCTURE_PROTECTED ) - bProtected = IsXMLToken( it.toCString(), XML_TRUE ); + bProtected = IsXMLToken( it, XML_TRUE ); else if ( nLocalToken == XML_PROTECTION_KEY ) sPassword = it.toString(); else if ( nLocalToken == XML_PROTECTION_KEY_DIGEST_ALGORITHM ) diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index da912fa76523..36e174804372 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -254,9 +254,9 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport, { if (!it.isEmpty()) { - if ( IsXMLToken( it.toCString(), XML_TRUE ) ) + if ( IsXMLToken( it, XML_TRUE ) ) fValue = 1.0; - else if ( IsXMLToken( it.toCString(), XML_FALSE ) ) + else if ( IsXMLToken( it, XML_FALSE ) ) fValue = 0.0; else ::sax::Converter::convertDouble(fValue, it.toString() ); diff --git a/sc/source/filter/xml/xmldrani.cxx b/sc/source/filter/xml/xmldrani.cxx index f75322824351..2e3dbb2147e7 100644 --- a/sc/source/filter/xml/xmldrani.cxx +++ b/sc/source/filter/xml/xmldrani.cxx @@ -133,39 +133,39 @@ ScXMLDatabaseRangeContext::ScXMLDatabaseRangeContext( ScXMLImport& rImport, break; case XML_ELEMENT( TABLE, XML_IS_SELECTION ): { - bIsSelection = IsXMLToken( aIter.toCString(), XML_TRUE ); + bIsSelection = IsXMLToken( aIter, XML_TRUE ); } break; case XML_ELEMENT( TABLE, XML_ON_UPDATE_KEEP_STYLES ): { - bKeepFormats = IsXMLToken( aIter.toCString(), XML_TRUE ); + bKeepFormats = IsXMLToken( aIter, XML_TRUE ); } break; case XML_ELEMENT( TABLE, XML_ON_UPDATE_KEEP_SIZE ): { - bMoveCells = !IsXMLToken( aIter.toCString(), XML_TRUE ); + bMoveCells = !IsXMLToken( aIter, XML_TRUE ); } break; case XML_ELEMENT( TABLE, XML_HAS_PERSISTENT_DATA ): { - bStripData = !IsXMLToken( aIter.toCString(), XML_TRUE ); + bStripData = !IsXMLToken( aIter, XML_TRUE ); } break; case XML_ELEMENT( TABLE, XML_ORIENTATION ): { - bByRow = !IsXMLToken( aIter.toCString(), XML_COLUMN ); + bByRow = !IsXMLToken( aIter, XML_COLUMN ); mpQueryParam->bByRow = bByRow; } break; case XML_ELEMENT( TABLE, XML_CONTAINS_HEADER ): { - bHasHeader = IsXMLToken( aIter.toCString(), XML_TRUE ); + bHasHeader = IsXMLToken( aIter, XML_TRUE ); mpQueryParam->bHasHeader = bHasHeader; } break; case XML_ELEMENT( TABLE, XML_DISPLAY_FILTER_BUTTONS ): { - bAutoFilter = IsXMLToken( aIter.toCString(), XML_TRUE ); + bAutoFilter = IsXMLToken( aIter, XML_TRUE ); } break; case XML_ELEMENT( TABLE, XML_TARGET_RANGE_ADDRESS ): diff --git a/sc/source/filter/xml/xmlexternaltabi.cxx b/sc/source/filter/xml/xmlexternaltabi.cxx index e6edaa66461b..9ce7d4e57121 100644 --- a/sc/source/filter/xml/xmlexternaltabi.cxx +++ b/sc/source/filter/xml/xmlexternaltabi.cxx @@ -315,7 +315,7 @@ ScXMLExternalRefCellContext::ScXMLExternalRefCellContext( { if ( !it.isEmpty() ) { - mfCellValue = IsXMLToken( it.toCString(), XML_TRUE ) ? 1.0 : 0.0; + mfCellValue = IsXMLToken( it, XML_TRUE ) ? 1.0 : 0.0; mbIsNumeric = true; mbIsEmpty = false; } diff --git a/sc/source/filter/xml/xmlrowi.cxx b/sc/source/filter/xml/xmlrowi.cxx index 8903287504ac..41c6defe29fd 100644 --- a/sc/source/filter/xml/xmlrowi.cxx +++ b/sc/source/filter/xml/xmlrowi.cxx @@ -233,7 +233,7 @@ ScXMLTableRowsContext::ScXMLTableRowsContext( ScXMLImport& rImport, static_cast< sax_fastparser::FastAttributeList *>( xAttrList.get() ); auto &aIter( pAttribList->find( XML_ELEMENT( TABLE, XML_DISPLAY ) ) ); if( aIter != pAttribList->end() ) - bGroupDisplay = IsXMLToken( aIter.toCString(), XML_TRUE ); + bGroupDisplay = IsXMLToken( aIter, XML_TRUE ); } } } diff --git a/sc/source/filter/xml/xmltabi.cxx b/sc/source/filter/xml/xmltabi.cxx index c9cdb1b00a5b..c1bef215d008 100644 --- a/sc/source/filter/xml/xmltabi.cxx +++ b/sc/source/filter/xml/xmltabi.cxx @@ -160,7 +160,7 @@ ScXMLTableContext::ScXMLTableContext( ScXMLImport& rImport, sStyleName = it.toString(); break; case XML_ELEMENT( TABLE, XML_PROTECTED ): - aProtectData.mbProtected = IsXMLToken( it.toCString(), XML_TRUE ); + aProtectData.mbProtected = IsXMLToken( it, XML_TRUE ); break; case XML_ELEMENT( TABLE, XML_PRINT_RANGES ): sPrintRanges = it.toString(); @@ -177,7 +177,7 @@ ScXMLTableContext::ScXMLTableContext( ScXMLImport& rImport, break; case XML_ELEMENT( TABLE, XML_PRINT ): { - if (IsXMLToken( it.toCString(), XML_FALSE) ) + if ( IsXMLToken( it, XML_FALSE) ) bPrintEntireSheet = false; } break; |