summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-04-17 22:23:08 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-04-17 22:23:08 +0200
commitcbcf7e32ade5b5402845e14065476f5423351ebf (patch)
tree39bb965e59b81b2b1a59bd7c63569feded367f84 /sc
parente5322f13e0d433a7103edbf36cd3d2ab0d3e18c7 (diff)
forgot the normal range names
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/oox/workbookhelper.cxx39
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