diff options
author | Kurt Zenker <kz@openoffice.org> | 2005-01-19 09:12:19 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2005-01-19 09:12:19 +0000 |
commit | 373e57677a280682a8747ad6a6f10533fb294a6a (patch) | |
tree | baf93fa71d617d5696f13a72bd84738e8075abe9 /sfx2 | |
parent | 2d6993b80b9f90cfaa04f84e0d61db4591d4735e (diff) |
INTEGRATION: CWS fwkbugfix04 (1.53.22); FILE MERGED
2005/01/14 12:50:41 mba 1.53.22.1: #i38655#: check for macros also after import of binary formats
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/objmisc.cxx | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index d4686cf22e4a..2c96ef7322c0 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -2,9 +2,9 @@ * * $RCSfile: objmisc.cxx,v $ * - * $Revision: 1.55 $ + * $Revision: 1.56 $ * - * last change: $Author: kz $ $Date: 2005-01-18 14:44:54 $ + * last change: $Author: kz $ $Date: 2005-01-19 10:12:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -199,6 +199,7 @@ using namespace ::com::sun::star::script; #include "../appl/app.hrc" #include "secmacrowarnings.hxx" #include "sfxdlg.hxx" +#include "scriptcont.hxx" using namespace ::com::sun::star; @@ -2123,6 +2124,38 @@ void SfxObjectShell::InPlaceActivate( BOOL bActivate ) } */ } +BOOL SfxObjectShell::HasMacros_Impl() const +{ + BOOL bHasMacros = (pImp->pBasicLibContainer != 0); + try + { + if ( bHasMacros ) + { + // a library container exists; check if it's empty + try + { + // usually a "Standard" library is always present (design) + // for this reason we must check if it's empty + uno::Reference < container::XNameAccess > xLib; + uno::Any aAny = pImp->pBasicLibContainer->getByName(::rtl::OUString::createFromAscii("Standard")); + aAny >>= xLib; + if ( xLib.is() ) + bHasMacros = xLib->hasElements(); + } + catch ( uno::Exception& ) + { + // if no "Standard" library is present we check for others + // here we assume that they are not empty (because they have been created by the user) + bHasMacros = pImp->pBasicLibContainer->hasElements(); + } + } + } + catch( uno::Exception& ) + { + } + + return bHasMacros; +} |