Commits

Anonymous committed dd4210c

calc33stopper1: #i79854# do not create defined names in Calc for functions

Comments (0)

Files changed (2)

sc/source/filter/excel/xiname.cxx

     mpScData( 0 ),
     mcBuiltIn( EXC_BUILTIN_UNKNOWN ),
     mnScTab( SCTAB_MAX ),
+    mbFunction( false ),
     mbVBName( false )
 {
     ExcelToSc& rFmlaConv = GetOldFmlaConverter();
 
     // 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
     // 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 );

sc/source/filter/inc/xiname.hxx

     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:
     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.
 };
 
 // ----------------------------------------------------------------------------
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.