summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2012-09-11 08:48:02 +0100
committerMichael Meeks <michael.meeks@suse.com>2012-09-12 12:49:49 +0100
commit4597483e00bffcc4e30d379dcf6fad42bc565e56 (patch)
treeb590428b0e3ae3c7056e6c18f008d7179dc5ba38 /sfx2
parentc414499bbd456389ac6cacf677327bff9e6b43f9 (diff)
targetted VBA re-work.
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/inc/sfx2/sfxsids.hrc1
-rw-r--r--sfx2/source/control/unoctitm.cxx13
-rw-r--r--sfx2/source/doc/docmacromode.cxx53
-rw-r--r--sfx2/source/view/viewprn.cxx6
4 files changed, 13 insertions, 60 deletions
diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc
index 0b53930c08be..549ac0ee4139 100644
--- a/sfx2/inc/sfx2/sfxsids.hrc
+++ b/sfx2/inc/sfx2/sfxsids.hrc
@@ -57,7 +57,6 @@
#define SID_VERSION_VISIBLE (SID_SFX_START + 313)
#define SID_PASTE_UNFORMATTED (SID_SFX_START + 314)
-#define SID_DIALOG_RETURN (SID_SFX_START + 318)
#define SID_PRINTER_NOTFOUND_WARN (SID_SFX_START + 320)
#define SID_PRINTER_NAME (SID_SFX_START + 322)
#define SID_PRINTER_CHANGESTODOC (SID_SFX_START + 324)
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 23ca46f4e014..1af5157d4868 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -634,7 +634,6 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util
// Filter arguments which shouldn't be part of the sequence property value
sal_Bool bTemp = sal_Bool();
sal_uInt16 nModifier(0);
- sal_Bool bVBARequest = sal_False;
std::vector< ::com::sun::star::beans::PropertyValue > aAddArgs;
for( sal_Int32 n=0; n<nCount; n++ )
{
@@ -651,10 +650,6 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util
}
else if( rProp.Name.equalsAsciiL("KeyModifier",11))
rProp.Value >>= nModifier;
- else if( rProp.Name.equalsAsciiL("VBADialogResultRequest",22) )
- {
- rProp.Value >>= bVBARequest;
- }
else
aAddArgs.push_back( aArgs[n] );
}
@@ -740,14 +735,6 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util
pDispatcher->GetBindings()->Execute_Impl( aReq, pSlot, pShell );
pItem = aReq.GetReturnValue();
bSuccess = aReq.IsDone() || pItem != NULL;
- if ( bVBARequest )
- {
- SFX_REQUEST_ARG( aReq, pDlgRet, SfxBoolItem, SID_DIALOG_RETURN, sal_False );
- if ( pDlgRet )
- {
- bSuccess = pDlgRet->GetValue();
- }
- }
}
}
#ifdef DBG_UTIL
diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx
index 47547569f58b..999ab2076aa5 100644
--- a/sfx2/source/doc/docmacromode.cxx
+++ b/sfx2/source/doc/docmacromode.cxx
@@ -28,7 +28,6 @@
#include <com/sun/star/task/InteractionClassification.hpp>
#include <com/sun/star/security/DocumentDigitalSignatures.hpp>
#include <com/sun/star/script/XLibraryQueryExecutable.hpp>
-#include <com/sun/star/script/vba/XVBACompatibility.hpp>
#include <comphelper/componentcontext.hxx>
#include <comphelper/processfactory.hxx>
@@ -65,7 +64,6 @@ namespace sfx2
using ::com::sun::star::uno::UNO_SET_THROW;
using ::com::sun::star::script::XLibraryContainer;
using ::com::sun::star::script::XLibraryQueryExecutable;
- using ::com::sun::star::script::vba::XVBACompatibility;
using ::com::sun::star::container::XNameAccess;
using ::com::sun::star::uno::UNO_QUERY_THROW;
using ::com::sun::star::uno::UNO_QUERY;
@@ -331,8 +329,6 @@ namespace sfx2
if ( xScripts.is() )
xContainer.set( xScripts->getBasicLibraries(), UNO_QUERY_THROW );
- Reference< XVBACompatibility > xDocVBAMode( xContainer, UNO_QUERY );
- sal_Bool bIsVBAMode = ( xDocVBAMode.is() && xDocVBAMode->getVBACompatibilityMode() );
if ( xContainer.is() )
{
// a library container exists; check if it's empty
@@ -345,47 +341,24 @@ namespace sfx2
{
::rtl::OUString aStdLibName( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) );
Sequence< ::rtl::OUString > aElements = xContainer->getElementNames();
- sal_Int32 nElementCount = aElements.getLength();
- if ( nElementCount )
+ if ( aElements.getLength() )
{
- // old check, if more than 1 library or the first library isn't the expected 'Standard'
- // trigger the security 'nag' dialog
- if ( !bIsVBAMode && ( nElementCount > 1 || !aElements[0].equals( aStdLibName ) ) )
+ if ( aElements.getLength() > 1 || !aElements[0].equals( aStdLibName ) )
bHasMacroLib = sal_True;
else
{
- // other wise just check all libraries for executeable code
- Reference< XLibraryQueryExecutable > xLib( xContainer, UNO_QUERY );
+ // usually a "Standard" library is always present (design)
+ // for this reason we must check if it's empty
+ //
+ // Note: Since #i73229#, this is not true anymore. There's no default
+ // "Standard" lib anymore. Wouldn't it be time to get completely
+ // rid of the "Standard" thingie - this shouldn't be necessary
+ // anymore, should it?
+ Reference < XNameAccess > xLib;
+ Any aAny = xContainer->getByName( aStdLibName );
+ aAny >>= xLib;
if ( xLib.is() )
- {
- const ::rtl::OUString* pElementName = aElements.getConstArray();
- for ( sal_Int32 index = 0; index < nElementCount; ++index )
- {
- bHasMacroLib = xLib->HasExecutableCode( pElementName[index] );
- if ( bHasMacroLib )
- break;
- }
- }
- }
- }
- }
- }
- if ( bIsVBAMode && !bHasMacroLib && xScripts.is() )
- {
- Reference< XLibraryContainer > xDlgContainer( xScripts->getDialogLibraries(), UNO_QUERY );
- if ( xDlgContainer.is() && xDlgContainer->hasElements() )
- {
- Sequence< ::rtl::OUString > aElements = xDlgContainer->getElementNames();
- sal_Int32 nElementCount = aElements.getLength();
- const ::rtl::OUString* pElementName = aElements.getConstArray();
- for ( sal_Int32 index = 0; index < nElementCount; ++index )
- {
- Reference< XNameAccess > xNameAccess;
- xDlgContainer->getByName( pElementName[index] ) >>= xNameAccess;
- if ( xNameAccess.is() && xNameAccess->hasElements() )
- {
- bHasMacroLib = sal_True;
- break;
+ bHasMacroLib = xLib->hasElements();
}
}
}
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index 5bc80c36073c..22f3780972e9 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -873,10 +873,6 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
aReq.AppendItem( SfxStringItem( SID_PRINTER_NAME, pDlgPrinter->GetName() ) );
aReq.Done();
}
- if ( nId == SID_SETUPPRINTER )
- {
- rReq.AppendItem( SfxBoolItem( SID_DIALOG_RETURN, sal_True ) );
- }
// take the changes made in the dialog
pPrinter = SetPrinter_Impl( pDlgPrinter );
@@ -893,8 +889,6 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
rReq.Ignore();
if ( SID_PRINTDOC == nId )
rReq.SetReturnValue(SfxBoolItem(0,sal_False));
- if ( nId == SID_SETUPPRINTER )
- rReq.AppendItem( SfxBoolItem( SID_DIALOG_RETURN, sal_False ) );
}
}
}