[PATCH] Removed duplicate set/get methods for initial tab count (fails while linking vbaobj.uno.so)

Albert Thuswaldner albert.thuswaldner at gmail.com
Tue Apr 17 12:06:07 PDT 2012


Hi,
This patch removes the duplicate Get/Set methods in appoptio.hxx which
the vba api uses. There was a long discussion back in the day about
this:

http://lists.freedesktop.org/archives/libreoffice/2011-June/013114.html

I CC:ing Noel Power if he as some opinion regarding this.

Now to the problem with this patch:

This patch makes the build fail in when linking vbaobj.uno.so:

/home/thuswa/work/libo2/workdir/unxlngi6.pro/CxxObject/sc/source/ui/vba/vbaapplication.o:
In function `ScVbaApplication::getSheetsInNewWorkbook()':
/home/thuswa/work/libo2/sc/source/ui/vba/vbaapplication.cxx:942:
undefined reference to `ScModule::GetDefaultsOptions()'
/home/thuswa/work/libo2/workdir/unxlngi6.pro/CxxObject/sc/source/ui/vba/vbaapplication.o:
In function `ScVbaApplication::setSheetsInNewWorkbook(long)':
/home/thuswa/work/libo2/sc/source/ui/vba/vbaapplication.cxx:955:
undefined reference to `ScModule::GetDefaultsOptions()'
collect2: ld returned 1 exit status
make[1]: *** [/home/thuswa/work/libo2/workdir/unxlngi6.pro/LinkTarget/Library/vbaobj.uno.so]
Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [sc] Error 2

I cant find a logical reason why this fails. The "scmod.hxx" which
defines the symbol is included as before, also considering the minimal
changes that I have made to the file:

diff --git a/sc/source/ui/vba/vbaapplication.cxx
b/sc/source/ui/vba/vbaapplication.cxx
index d0201a4..478e8f4 100644
--- a/sc/source/ui/vba/vbaapplication.cxx
+++ b/sc/source/ui/vba/vbaapplication.cxx
@@ -79,7 +79,7 @@
 #include "global.hxx"
 #include "scmod.hxx"
 #include "docoptio.hxx"
-#include "appoptio.hxx"
+#include "defaultsoptions.hxx"

 #include <osl/file.hxx>
 #include <rtl/instance.hxx>
@@ -939,8 +939,8 @@ ScVbaApplication::setEnableCancelKey(sal_Int32
/*lEnableCancelKey*/) throw (uno:

 sal_Int32 SAL_CALL ScVbaApplication::getSheetsInNewWorkbook() throw
(uno::RuntimeException)
 {
-    const ScAppOptions& rAppOpt = SC_MOD()->GetAppOptions();
-    return rAppOpt.GetTabCountInNewSpreadsheet();
+    const ScDefaultsOptions& rOpt = SC_MOD()->GetDefaultsOptions();
+    return rOpt.GetInitTabCount();
 }

 void SAL_CALL ScVbaApplication::setSheetsInNewWorkbook( sal_Int32
SheetsInNewWorkbook ) throw (script::BasicErrorException,
uno::RuntimeException)
@@ -952,8 +952,8 @@ void SAL_CALL
ScVbaApplication::setSheetsInNewWorkbook( sal_Int32 SheetsInNewWor
     }
     else
     {
-        ScAppOptions& rAppOpt = const_cast< ScAppOptions&
>(SC_MOD()->GetAppOptions());
-        rAppOpt.SetTabCountInNewSpreadsheet( SheetsInNewWorkbook );
+        ScDefaultsOptions& rOpt = const_cast< ScDefaultsOptions&
>(SC_MOD()->GetDefaultsOptions());
+        rOpt.SetInitTabCount( SheetsInNewWorkbook );
     }
 }


Is the vba part of the code treated in some special way? Wild guess:
all symbols are not automatically exported to here (don't know if that
is even possible)? Or what might be the problem?

Thanks for your help.
/Albert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Removed-duplicate-set-get-methods-for-initial-tab-co.patch
Type: text/x-patch
Size: 4915 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20120417/e476c035/attachment.bin>


More information about the LibreOffice mailing list