diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-04-17 22:23:08 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-04-17 22:23:08 +0200 |
commit | cbcf7e32ade5b5402845e14065476f5423351ebf (patch) | |
tree | 39bb965e59b81b2b1a59bd7c63569feded367f84 | |
parent | e5322f13e0d433a7103edbf36cd3d2ab0d3e18c7 (diff) |
forgot the normal range names
-rw-r--r-- | sc/source/filter/oox/workbookhelper.cxx | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx index 6e5dce83429b..1110ebc9a17e 100644 --- a/sc/source/filter/oox/workbookhelper.cxx +++ b/sc/source/filter/oox/workbookhelper.cxx @@ -379,28 +379,6 @@ ScRangeData* lcl_addNewByNameAndTokens( ScDocument& rDoc, ScRangeName* pNames, c return pNew; } -ScRangeData* WorkbookGlobals::createNamedRangeObject( OUString& orName, const Sequence< FormulaToken>& rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags ) const -{ - // create the name and insert it into the Calc document - ScRangeData* pScRangeData = NULL; - if( !orName.isEmpty() ) try - { - // find an unused name - PropertySet aDocProps( mxDoc ); - Reference< XNamedRanges > xNamedRanges( aDocProps.getAnyProperty( PROP_NamedRanges ), UNO_QUERY_THROW ); - Reference< XNameAccess > xNameAccess( xNamedRanges, UNO_QUERY_THROW ); - orName = ContainerHelper::getUnusedName( xNameAccess, orName, '_' ); - // create the named range - ScDocument& rDoc = getScDocument(); - ScRangeName* pNames = rDoc.GetRangeName(); - pScRangeData = lcl_addNewByNameAndTokens( rDoc, pNames, orName, rTokens, nIndex, nNameFlags ); - } - catch (const Exception&) - { - } - return pScRangeData; -} - namespace { rtl::OUString findUnusedName( const ScRangeName* pRangeName, const rtl::OUString& rSuggestedName ) @@ -415,6 +393,23 @@ rtl::OUString findUnusedName( const ScRangeName* pRangeName, const rtl::OUString } +ScRangeData* WorkbookGlobals::createNamedRangeObject( OUString& orName, const Sequence< FormulaToken>& rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags ) const +{ + // create the name and insert it into the Calc document + ScRangeData* pScRangeData = NULL; + if( !orName.isEmpty() ) + { + ScDocument& rDoc = getScDocument(); + ScRangeName* pNames = rDoc.GetRangeName(); + // find an unused name + orName = findUnusedName( pNames, orName ); + // create the named range + pScRangeData = lcl_addNewByNameAndTokens( rDoc, pNames, orName, rTokens, nIndex, nNameFlags ); + } + return pScRangeData; +} + + ScRangeData* WorkbookGlobals::createLocalNamedRangeObject( OUString& orName, const Sequence< FormulaToken >& rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags, sal_Int32 nTab ) const { // create the name and insert it into the Calc document |