diff options
author | Daniel Rentz [dr] <daniel.rentz@oracle.com> | 2010-10-22 11:56:55 +0200 |
---|---|---|
committer | Daniel Rentz [dr] <daniel.rentz@oracle.com> | 2010-10-22 11:56:55 +0200 |
commit | 96d13bf8031f10f3a12a3201b82186929ce7e5d0 (patch) | |
tree | 2b753cb570a2b9aa2d4b413d67128b6eda9a5ec2 /sc/source | |
parent | acfd9bcfa88e1de337e05eeff761c3ed28ca38d1 (diff) |
calc33stopper1: #i79854# do not create defined names in Calc for functions
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/filter/excel/xiname.cxx | 6 | ||||
-rw-r--r-- | sc/source/filter/inc/xiname.hxx | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/sc/source/filter/excel/xiname.cxx b/sc/source/filter/excel/xiname.cxx index 5d21d91c9f53..3d373f6c36ba 100644 --- a/sc/source/filter/excel/xiname.cxx +++ b/sc/source/filter/excel/xiname.cxx @@ -45,6 +45,7 @@ XclImpName::XclImpName( XclImpStream& rStrm, sal_uInt16 nXclNameIdx ) : mpScData( 0 ), mcBuiltIn( EXC_BUILTIN_UNKNOWN ), mnScTab( SCTAB_MAX ), + mbFunction( false ), mbVBName( false ) { ExcelToSc& rFmlaConv = GetOldFmlaConverter(); @@ -93,7 +94,8 @@ XclImpName::XclImpName( XclImpStream& rStrm, sal_uInt16 nXclNameIdx ) : // 2) *** convert sheet index and name *** -------------------------------- - // Visual Basic procedure + // functions and VBA + mbFunction = ::get_flag( nFlags, EXC_NAME_FUNC ); mbVBName = ::get_flag( nFlags, EXC_NAME_VB ); // get built-in name, or convert characters invalid in Calc @@ -210,7 +212,7 @@ XclImpName::XclImpName( XclImpStream& rStrm, sal_uInt16 nXclNameIdx ) : // 4) *** create a defined name in the Calc document *** ------------------ // #163146# do not ignore hidden names (may be regular names created by VBA scripts) - if( pTokArr /*&& (bBuiltIn || !::get_flag( nFlags, EXC_NAME_HIDDEN ))*/ && !mbVBName ) + if( pTokArr /*&& (bBuiltIn || !::get_flag( nFlags, EXC_NAME_HIDDEN ))*/ && !mbFunction && !mbVBName ) { // create the Calc name data ScRangeData* pData = new ScRangeData( GetDocPtr(), maScName, *pTokArr, ScAddress(), nNameType ); diff --git a/sc/source/filter/inc/xiname.hxx b/sc/source/filter/inc/xiname.hxx index ccf1b88af947..b5d9ca642d4f 100644 --- a/sc/source/filter/inc/xiname.hxx +++ b/sc/source/filter/inc/xiname.hxx @@ -50,6 +50,7 @@ public: inline SCTAB GetScTab() const { return mnScTab; } inline const ScRangeData* GetScRangeData() const { return mpScData; } inline bool IsGlobal() const { return mnScTab == SCTAB_MAX; } + inline bool IsFunction() const { return mbFunction; } inline bool IsVBName() const { return mbVBName; } private: @@ -58,7 +59,8 @@ private: const ScRangeData* mpScData; /// Pointer to Calc defined name (no ownership). sal_Unicode mcBuiltIn; /// Excel built-in name index. SCTAB mnScTab; /// Calc sheet index of local names. - bool mbVBName; /// true = Visual Basic procedure. + bool mbFunction; /// true = Name refers to a function (add-in or VBA). + bool mbVBName; /// true = Visual Basic procedure or function. }; // ---------------------------------------------------------------------------- |