Kaydet (Commit) a0b20e1f authored tarafından Noel Power's avatar Noel Power

fix definedName corruption for xlsx export ( bnc#741182 )

set symbol for builtin name using rangelist
üst 6008c3f5
...@@ -139,7 +139,7 @@ public: ...@@ -139,7 +139,7 @@ public:
sal_uInt16 InsertName( SCTAB nTab, sal_uInt16 nScNameIdx ); sal_uInt16 InsertName( SCTAB nTab, sal_uInt16 nScNameIdx );
/** Inserts a new built-in defined name. */ /** Inserts a new built-in defined name. */
sal_uInt16 InsertBuiltInName( sal_Unicode cBuiltIn, XclTokenArrayRef xTokArr, SCTAB nScTab ); sal_uInt16 InsertBuiltInName( sal_Unicode cBuiltIn, XclTokenArrayRef xTokArr, SCTAB nScTab, const ScRangeList& aRangeList );
sal_uInt16 InsertBuiltInName( sal_Unicode cBuiltIn, XclTokenArrayRef xTokArr, const ScRange& aRange ); sal_uInt16 InsertBuiltInName( sal_Unicode cBuiltIn, XclTokenArrayRef xTokArr, const ScRange& aRange );
/** Inserts a new defined name. Sets another unused name, if rName already exists. */ /** Inserts a new defined name. Sets another unused name, if rName already exists. */
sal_uInt16 InsertUniqueName( const String& rName, XclTokenArrayRef xTokArr, SCTAB nScTab ); sal_uInt16 InsertUniqueName( const String& rName, XclTokenArrayRef xTokArr, SCTAB nScTab );
...@@ -410,11 +410,14 @@ sal_uInt16 XclExpNameManagerImpl::InsertBuiltInName( sal_Unicode cBuiltIn, XclTo ...@@ -410,11 +410,14 @@ sal_uInt16 XclExpNameManagerImpl::InsertBuiltInName( sal_Unicode cBuiltIn, XclTo
return Append( xName ); return Append( xName );
} }
sal_uInt16 XclExpNameManagerImpl::InsertBuiltInName( sal_Unicode cBuiltIn, XclTokenArrayRef xTokArr, SCTAB nScTab ) sal_uInt16 XclExpNameManagerImpl::InsertBuiltInName( sal_Unicode cBuiltIn, XclTokenArrayRef xTokArr, SCTAB nScTab, const ScRangeList& rRangeList )
{ {
XclExpNameRef xName( new XclExpName( GetRoot(), cBuiltIn ) ); XclExpNameRef xName( new XclExpName( GetRoot(), cBuiltIn ) );
xName->SetTokenArray( xTokArr ); xName->SetTokenArray( xTokArr );
xName->SetLocalTab( nScTab ); xName->SetLocalTab( nScTab );
String sSymbol;
rRangeList.Format( sSymbol, SCR_ABS_3D, GetDocPtr(), ::formula::FormulaGrammar::CONV_XL_A1 );
xName->SetSymbol( sSymbol );
return Append( xName ); return Append( xName );
} }
...@@ -725,7 +728,7 @@ sal_uInt16 XclExpNameManager::InsertBuiltInName( sal_Unicode cBuiltIn, const ScR ...@@ -725,7 +728,7 @@ sal_uInt16 XclExpNameManager::InsertBuiltInName( sal_Unicode cBuiltIn, const ScR
if( !rRangeList.empty() ) if( !rRangeList.empty() )
{ {
XclTokenArrayRef xTokArr = GetFormulaCompiler().CreateFormula( EXC_FMLATYPE_NAME, rRangeList ); XclTokenArrayRef xTokArr = GetFormulaCompiler().CreateFormula( EXC_FMLATYPE_NAME, rRangeList );
nNameIdx = mxImpl->InsertBuiltInName( cBuiltIn, xTokArr, rRangeList.front()->aStart.Tab() ); nNameIdx = mxImpl->InsertBuiltInName( cBuiltIn, xTokArr, rRangeList.front()->aStart.Tab(), rRangeList );
} }
return nNameIdx; return nNameIdx;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment