Index: sc/source/ui/unoobj/docuno.cxx
===================================================================
RCS file: /cvs/sc/sc/source/ui/unoobj/docuno.cxx,v
retrieving revision 1.50
diff -u -r1.50 docuno.cxx
--- sc/source/ui/unoobj/docuno.cxx	23 Mar 2005 13:08:32 -0000	1.50
+++ sc/source/ui/unoobj/docuno.cxx	28 Jul 2005 16:07:27 -0000
@@ -89,6 +89,9 @@
 #include <com/sun/star/i18n/XForbiddenCharacters.hpp>
 #include <com/sun/star/script/XLibraryContainer.hpp>
 #include <com/sun/star/lang/XInitialization.hpp>
+#ifdef ENABLE_VBA
+#include <org/openoffice/vba/XGlobals.hpp>
+#endif //ENABLE_VBA
 #ifndef _COMPHELPER_PROCESSFACTORY_HXX_
 #include <comphelper/processfactory.hxx>
 #endif
@@ -126,6 +129,10 @@
 #endif
 
 using namespace com::sun::star;
+#ifdef ENABLE_VBA
+#define SC_VBA_GLOBALS_PROP "VBAGlobals"
+#define SC_VBA_COLORPALETTE_PROP "ColorPalette"
+#endif //ENABLE_VBA
 
 //------------------------------------------------------------------------
 
@@ -164,6 +170,10 @@
         {MAP_CHAR_LEN(SC_UNO_RUNTIMEUID),        0, &getCppuType(static_cast< const rtl::OUString * >(0)),    beans::PropertyAttribute::READONLY},
         {MAP_CHAR_LEN(SC_UNO_HASVALIDSIGNATURES),0, &getBooleanCppuType(),                                    beans::PropertyAttribute::READONLY},
 		{MAP_CHAR_LEN("BuildId"),			     0,	&::getCppuType(static_cast< const rtl::OUString * >(0)), 0, 0},
+#ifdef ENABLE_VBA
+        {MAP_CHAR_LEN(SC_VBA_GLOBALS_PROP),      0, &getCppuType((uno::Sequence< uno::Any >*)0),              beans::PropertyAttribute::READONLY},
+        {MAP_CHAR_LEN(SC_VBA_COLORPALETTE_PROP),      0, &getCppuType((uno::Reference< container::XIndexAccess >*)0),              beans::PropertyAttribute::READONLY},
+#endif //ENABLE_VBA
 
 		{0,0,0,0}
 	};
@@ -1357,7 +1359,12 @@ void SAL_CALL ScModelObj::setPropertyVal
                {
                        aValue >>= maBuildId;
                }
-
+#ifdef ENABLE_VBA
+               else if ( aString.EqualsAscii( SC_VBA_COLORPALETTE_PROP  ) )
+               {
+                       aValue >>= xColorPalette;
+               }
+#endif
                if ( aNewOpt != rOldOpt )
                {
                        pDoc->SetDocOptions( aNewOpt );
@@ -1476,6 +1484,30 @@
 		{
 			aRet <<= maBuildId;
 		}
+#ifdef ENABLE_VBA
+               else if ( aString.EqualsAscii( SC_VBA_COLORPALETTE_PROP  ) )
+               {
+                       aRet <<= xColorPalette;
+               }
+		else if ( aString.EqualsAscii( SC_VBA_GLOBALS_PROP ) )
+		{
+			uno::Reference < uno::XComponentContext > xCtx;
+			uno::Reference < beans::XPropertySet > xProps(
+				::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
+			xCtx.set( xProps->getPropertyValue( rtl::OUString( 
+				RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), 
+				uno::UNO_QUERY_THROW );
+			uno::Reference< org::openoffice::vba::XGlobals > xGlobals(
+				xCtx->getValueByName(
+				::rtl::OUString::createFromAscii( 
+					"/singletons/org.openoffice.vba.theGlobals") ), 
+				uno::UNO_QUERY );
+			if ( xGlobals.is() )
+			{
+				aRet <<= xGlobals->getGlobals();
+			}
+		}
+#endif //ENABLE_VBA
 	}
 
 	return aRet;
--- sc/inc/docuno.hxx   2005-11-10 16:36:27.000000000 +0000
+++ sc/inc/docuno.hxx  2006-07-26 17:12:22.000000000 +0100
@@ -169,6 +169,7 @@ private:
        com::sun::star::uno::Reference<com::sun::star::uno::XInterface> xDrawMarkerTab;
        com::sun::star::uno::Reference<com::sun::star::uno::XInterface> xDrawDashTab;
     com::sun::star::uno::Reference<com::sun::star::uno::XInterface> xChartDataProv;
+    com::sun::star::uno::Reference<com::sun::star::container::XIndexAccess> xColorPalette;

        BOOL                                    FillRenderMarkData( const com::sun::star::uno::Any& aSelection,
                                                                               ScMarkData& rMark, ScPrintSelectionStatus& rStatus ) const;
Index: sc/source/ui/unoobj/makefile.mk
===================================================================
RCS file: /cvs/sc/sc/source/ui/unoobj/makefile.mk,v
retrieving revision 1.16
diff -u -r1.16 makefile.mk
--- sc/source/ui/unoobj/makefile.mk	11 Aug 2004 09:08:22 -0000	1.16
+++ sc/source/ui/unoobj/makefile.mk	28 Jul 2005 20:54:41 -0000
@@ -81,6 +81,10 @@
 .INCLUDE :  sc.mk
 .INCLUDE :  $(PRJ)$/util$/makefile.pmk
 
+.IF "$(ENABLE_VBA)"=="YES"
+	CDEFS+=-DENABLE_VBA
+.ENDIF
+
 # --- Files --------------------------------------------------------
 SLO1FILES =  \
         $(SLO)$/docuno.obj \
