diff options
Diffstat (limited to 'sfx2/source/appl/appuno.cxx')
-rwxr-xr-x[-rw-r--r--] | sfx2/source/appl/appuno.cxx | 551 |
1 files changed, 229 insertions, 322 deletions
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index 7a69c6d3b49f..8f68e21a2453 100644..100755 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -95,7 +95,9 @@ #include <tools/cachestr.hxx> #include <osl/mutex.hxx> #include <comphelper/sequence.hxx> +#include <framework/documentundoguard.hxx> #include <rtl/ustrbuf.hxx> +#include <comphelper/interaction.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::ucb; @@ -116,7 +118,6 @@ using namespace ::com::sun::star::io; #include <sfx2/fcontnr.hxx> #include "frmload.hxx" #include <sfx2/frame.hxx> -#include "sfxbasic.hxx" #include <sfx2/objsh.hxx> #include <sfx2/objuno.hxx> #include <sfx2/unoctitm.hxx> @@ -127,7 +128,7 @@ using namespace ::com::sun::star::io; #include "fltoptint.hxx" #include <sfx2/docfile.hxx> #include <sfx2/sfxbasecontroller.hxx> -#include "brokenpackageint.hxx" +#include <sfx2/brokenpackageint.hxx> #include "eventsupplier.hxx" #include "xpackcreator.hxx" #include "plugin.hxx" @@ -135,7 +136,6 @@ using namespace ::com::sun::star::io; #include <ownsubfilterservice.hxx> #include "SfxDocumentMetaData.hxx" - #define PROTOCOLHANDLER_SERVICENAME "com.sun.star.frame.ProtocolHandler" static char const sTemplateRegionName[] = "TemplateRegionName"; @@ -161,7 +161,7 @@ static char const sDontEdit[] = "DontEdit"; static char const sSilent[] = "Silent"; static char const sJumpMark[] = "JumpMark"; static char const sFileName[] = "FileName"; -static char const sSalvageURL[] = "SalvagedFile"; +static char const sSalvagedFile[] = "SalvagedFile"; static char const sStatusInd[] = "StatusIndicator"; static char const sModel[] = "Model"; static char const sFrame[] = "Frame"; @@ -187,6 +187,10 @@ static char const sUseSystemDialog[] = "UseSystemDialog"; static char const sStandardDir[] = "StandardDir"; static char const sBlackList[] = "BlackList"; static char const sModifyPasswordInfo[] = "ModifyPasswordInfo"; +static char const sSuggestedSaveAsDir[] = "SuggestedSaveAsDir"; +static char const sSuggestedSaveAsName[] = "SuggestedSaveAsName"; +static char const sEncryptionData[] = "EncryptionData"; + void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& rArgs, SfxAllItemSet& rSet, const SfxSlot* pSlot ) { @@ -221,10 +225,10 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque return; } - USHORT nWhich = rSet.GetPool()->GetWhich(nSlotId); - BOOL bConvertTwips = ( rSet.GetPool()->GetMetric( nWhich ) == SFX_MAPUNIT_TWIP ); + sal_uInt16 nWhich = rSet.GetPool()->GetWhich(nSlotId); + sal_Bool bConvertTwips = ( rSet.GetPool()->GetMetric( nWhich ) == SFX_MAPUNIT_TWIP ); pItem->SetWhich( nWhich ); - USHORT nSubCount = pType->nAttribs; + sal_uInt16 nSubCount = pType->nAttribs; const ::com::sun::star::beans::PropertyValue& rProp = pPropsVal[0]; String aName = rProp.Name; @@ -269,11 +273,11 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque } #endif // complex property; collect sub items from the parameter set and reconstruct complex item - USHORT nFound=0; + sal_uInt16 nFound=0; for ( sal_uInt16 n=0; n<nCount; n++ ) { const ::com::sun::star::beans::PropertyValue& rPropValue = pPropsVal[n]; - USHORT nSub; + sal_uInt16 nSub; for ( nSub=0; nSub<nSubCount; nSub++ ) { // search sub item by name @@ -283,7 +287,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque const char* pName = aStr.GetBuffer(); if ( rPropValue.Name.compareToAscii( pName ) == COMPARE_EQUAL ) { - BYTE nSubId = (BYTE) (sal_Int8) pType->aAttrib[nSub].nAID; + sal_uInt8 nSubId = (sal_uInt8) (sal_Int8) pType->aAttrib[nSub].nAID; if ( bConvertTwips ) nSubId |= CONVERT_TWIPS; if ( pItem->PutValue( rPropValue.Value, nSubId ) ) @@ -339,11 +343,11 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque return; } - USHORT nWhich = rSet.GetPool()->GetWhich(rArg.nSlotId); - BOOL bConvertTwips = ( rSet.GetPool()->GetMetric( nWhich ) == SFX_MAPUNIT_TWIP ); + sal_uInt16 nWhich = rSet.GetPool()->GetWhich(rArg.nSlotId); + sal_Bool bConvertTwips = ( rSet.GetPool()->GetMetric( nWhich ) == SFX_MAPUNIT_TWIP ); pItem->SetWhich( nWhich ); const SfxType* pType = rArg.pType; - USHORT nSubCount = pType->nAttribs; + sal_uInt16 nSubCount = pType->nAttribs; if ( nSubCount == 0 ) { // "simple" (base type) argument @@ -374,14 +378,14 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque else { // complex argument, could be passed in one struct - BOOL bAsWholeItem = FALSE; + sal_Bool bAsWholeItem = sal_False; for ( sal_uInt16 n=0; n<nCount; n++ ) { const ::com::sun::star::beans::PropertyValue& rProp = pPropsVal[n]; String aName = rProp.Name; if ( aName.CompareToAscii(rArg.pName) == COMPARE_EQUAL ) { - bAsWholeItem = TRUE; + bAsWholeItem = sal_True; #ifdef DBG_UTIL ++nFoundArgs; #endif @@ -404,11 +408,11 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque // complex argument; collect sub items from argument array and reconstruct complex item // only put item if at least one member was found and had the correct type // (is this a good idea?! Should we ask for *all* members?) - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; for ( sal_uInt16 n=0; n<nCount; n++ ) { const ::com::sun::star::beans::PropertyValue& rProp = pPropsVal[n]; - for ( USHORT nSub=0; nSub<nSubCount; nSub++ ) + for ( sal_uInt16 nSub=0; nSub<nSubCount; nSub++ ) { // search sub item by name ByteString aStr( rArg.pName ); @@ -418,17 +422,17 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if ( rProp.Name.compareToAscii( pName ) == COMPARE_EQUAL ) { // at least one member found ... - bRet = TRUE; + bRet = sal_True; #ifdef DBG_UTIL ++nFoundArgs; #endif - BYTE nSubId = (BYTE) (sal_Int8) pType->aAttrib[nSub].nAID; + sal_uInt8 nSubId = (sal_uInt8) (sal_Int8) pType->aAttrib[nSub].nAID; if ( bConvertTwips ) nSubId |= CONVERT_TWIPS; if (!pItem->PutValue( rProp.Value, nSubId ) ) { // ... but it was not convertable - bRet = FALSE; + bRet = sal_False; #ifdef DBG_UTIL ByteString aDbgStr( "Property not convertable: "); aDbgStr += rArg.pName; @@ -689,7 +693,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque { ::rtl::OUString sVal; sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength()); - DBG_ASSERT( bOK, "invalid type or value for StanadardDir" ); + DBG_ASSERT( bOK, "invalid type or value for StandardDir" ); if (bOK) rSet.Put( SfxStringItem( SID_STANDARD_DIR, sVal ) ); } @@ -713,11 +717,11 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxStringItem( SID_FILE_NAME, sVal ) ); } - else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sSalvageURL)) ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sSalvagedFile)) ) { ::rtl::OUString sVal; sal_Bool bOK = (rProp.Value >>= sVal); - DBG_ASSERT( bOK, "invalid type or value for SalvageURL" ); + DBG_ASSERT( bOK, "invalid type or value for SalvagedFile" ); if (bOK) rSet.Put( SfxStringItem( SID_DOC_SALVAGE, sVal ) ); } @@ -725,7 +729,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque { ::rtl::OUString sVal; sal_Bool bOK = (rProp.Value >>= sVal); - DBG_ASSERT( bOK, "invalid type or value for SalvageURL" ); + DBG_ASSERT( bOK, "invalid type or value for FolderName" ); if (bOK) rSet.Put( SfxStringItem( SID_PATH, sVal ) ); } @@ -854,6 +858,26 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque { rSet.Put( SfxUnoAnyItem( SID_MODIFYPASSWORDINFO, rProp.Value ) ); } + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sEncryptionData)) ) + { + rSet.Put( SfxUnoAnyItem( SID_ENCRYPTIONDATA, rProp.Value ) ); + } + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sSuggestedSaveAsDir)) ) + { + ::rtl::OUString sVal; + sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength()); + DBG_ASSERT( bOK, "invalid type or value for SuggestedSaveAsDir" ); + if (bOK) + rSet.Put( SfxStringItem( SID_SUGGESTEDSAVEASDIR, sVal ) ); + } + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sSuggestedSaveAsName)) ) + { + ::rtl::OUString sVal; + sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength()); + DBG_ASSERT( bOK, "invalid type or value for SuggestedSaveAsName" ); + if (bOK) + rSet.Put( SfxStringItem( SID_SUGGESTEDSAVEASNAME, sVal ) ); + } #ifdef DBG_UTIL else --nFoundArgs; @@ -919,10 +943,10 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta if ( !pSlot->IsMode(SFX_SLOT_METHOD) ) { // slot is a property - USHORT nWhich = rSet.GetPool()->GetWhich(nSlotId); + sal_uInt16 nWhich = rSet.GetPool()->GetWhich(nSlotId); if ( rSet.GetItemState( nWhich ) == SFX_ITEM_SET ) //??? { - USHORT nSubCount = pType->nAttribs; + sal_uInt16 nSubCount = pType->nAttribs; if ( nSubCount ) // it's a complex property, we want it split into simple types // so we expect to get as many items as we have (sub) members @@ -948,15 +972,15 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta else { // slot is a method - USHORT nFormalArgs = pSlot->GetFormalArgumentCount(); - for ( USHORT nArg=0; nArg<nFormalArgs; ++nArg ) + sal_uInt16 nFormalArgs = pSlot->GetFormalArgumentCount(); + for ( sal_uInt16 nArg=0; nArg<nFormalArgs; ++nArg ) { // check every formal argument of the method const SfxFormalArgument &rArg = pSlot->GetFormalArgument( nArg ); - USHORT nWhich = rSet.GetPool()->GetWhich( rArg.nSlotId ); + sal_uInt16 nWhich = rSet.GetPool()->GetWhich( rArg.nSlotId ); if ( rSet.GetItemState( nWhich ) == SFX_ITEM_SET ) //??? { - USHORT nSubCount = rArg.pType->nAttribs; + sal_uInt16 nSubCount = rArg.pType->nAttribs; if ( nSubCount ) // argument has a complex type, we want it split into simple types // so for this argument we expect to get as many items as we have (sub) members @@ -1069,6 +1093,13 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta nAdditional++; if ( rSet.GetItemState( SID_MODIFYPASSWORDINFO ) == SFX_ITEM_SET ) nAdditional++; + if ( rSet.GetItemState( SID_SUGGESTEDSAVEASDIR ) == SFX_ITEM_SET ) + nAdditional++; + if ( rSet.GetItemState( SID_ENCRYPTIONDATA ) == SFX_ITEM_SET ) + nAdditional++; + nAdditional++; + if ( rSet.GetItemState( SID_SUGGESTEDSAVEASNAME ) == SFX_ITEM_SET ) + nAdditional++; // consider additional arguments nProps += nAdditional; @@ -1084,10 +1115,10 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta if ( rSet.Count() != nItems ) { // detect unknown item and present error message - const USHORT *pRanges = rSet.GetRanges(); + const sal_uInt16 *pRanges = rSet.GetRanges(); while ( *pRanges ) { - for(USHORT nId = *pRanges++; nId <= *pRanges; ++nId) + for(sal_uInt16 nId = *pRanges++; nId <= *pRanges; ++nId) { if ( rSet.GetItemState(nId) < SFX_ITEM_SET ) //??? // not really set @@ -1096,12 +1127,12 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta if ( !pSlot->IsMode(SFX_SLOT_METHOD) && nId == rSet.GetPool()->GetWhich( pSlot->GetSlotId() ) ) continue; - USHORT nFormalArgs = pSlot->GetFormalArgumentCount(); - USHORT nArg; + sal_uInt16 nFormalArgs = pSlot->GetFormalArgumentCount(); + sal_uInt16 nArg; for ( nArg=0; nArg<nFormalArgs; ++nArg ) { const SfxFormalArgument &rArg = pSlot->GetFormalArgument( nArg ); - USHORT nWhich = rSet.GetPool()->GetWhich( rArg.nSlotId ); + sal_uInt16 nWhich = rSet.GetPool()->GetWhich( rArg.nSlotId ); if ( nId == nWhich ) break; } @@ -1204,12 +1235,18 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta continue; if ( nId == SID_NOAUTOSAVE ) continue; + if ( nId == SID_ENCRYPTIONDATA ) + continue; // used only internally if ( nId == SID_SAVETO ) continue; if ( nId == SID_MODIFYPASSWORDINFO ) continue; + if ( nId == SID_SUGGESTEDSAVEASDIR ) + continue; + if ( nId == SID_SUGGESTEDSAVEASNAME ) + continue; } ByteString aDbg( "Unknown item detected: "); @@ -1231,12 +1268,12 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta if ( !pSlot->IsMode(SFX_SLOT_METHOD) ) { // slot is a property - USHORT nWhich = rSet.GetPool()->GetWhich(nSlotId); - BOOL bConvertTwips = ( rSet.GetPool()->GetMetric( nWhich ) == SFX_MAPUNIT_TWIP ); + sal_uInt16 nWhich = rSet.GetPool()->GetWhich(nSlotId); + sal_Bool bConvertTwips = ( rSet.GetPool()->GetMetric( nWhich ) == SFX_MAPUNIT_TWIP ); SFX_ITEMSET_ARG( &rSet, pItem, SfxPoolItem, nWhich, sal_False ); if ( pItem ) //??? { - USHORT nSubCount = pType->nAttribs; + sal_uInt16 nSubCount = pType->nAttribs; if ( !nSubCount ) { pValue[nActProp].Name = String( String::CreateFromAscii( pSlot->pUnoName ) ) ; @@ -1250,9 +1287,9 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta else { // complex type, add a property value for every member of the struct - for ( USHORT n=1; n<=nSubCount; ++n ) + for ( sal_uInt16 n=1; n<=nSubCount; ++n ) { - BYTE nSubId = (BYTE) (sal_Int8) pType->aAttrib[n-1].nAID; + sal_uInt8 nSubId = (sal_uInt8) (sal_Int8) pType->aAttrib[n-1].nAID; if ( bConvertTwips ) nSubId |= CONVERT_TWIPS; @@ -1276,16 +1313,16 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta else { // slot is a method - USHORT nFormalArgs = pSlot->GetFormalArgumentCount(); - for ( USHORT nArg=0; nArg<nFormalArgs; ++nArg ) + sal_uInt16 nFormalArgs = pSlot->GetFormalArgumentCount(); + for ( sal_uInt16 nArg=0; nArg<nFormalArgs; ++nArg ) { const SfxFormalArgument &rArg = pSlot->GetFormalArgument( nArg ); - USHORT nWhich = rSet.GetPool()->GetWhich( rArg.nSlotId ); - BOOL bConvertTwips = ( rSet.GetPool()->GetMetric( nWhich ) == SFX_MAPUNIT_TWIP ); + sal_uInt16 nWhich = rSet.GetPool()->GetWhich( rArg.nSlotId ); + sal_Bool bConvertTwips = ( rSet.GetPool()->GetMetric( nWhich ) == SFX_MAPUNIT_TWIP ); SFX_ITEMSET_ARG( &rSet, pItem, SfxPoolItem, nWhich, sal_False ); if ( pItem ) //??? { - USHORT nSubCount = rArg.pType->nAttribs; + sal_uInt16 nSubCount = rArg.pType->nAttribs; if ( !nSubCount ) { pValue[nActProp].Name = String( String::CreateFromAscii( rArg.pName ) ) ; @@ -1299,9 +1336,9 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta else { // complex type, add a property value for every member of the struct - for ( USHORT n = 1; n <= nSubCount; ++n ) + for ( sal_uInt16 n = 1; n <= nSubCount; ++n ) { - BYTE nSubId = (BYTE) (sal_Int8) rArg.pType->aAttrib[n-1].nAID; + sal_uInt8 nSubId = (sal_uInt8) (sal_Int8) rArg.pType->aAttrib[n-1].nAID; if ( bConvertTwips ) nSubId |= CONVERT_TWIPS; @@ -1495,7 +1532,7 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta } if ( rSet.GetItemState( SID_DOC_SALVAGE, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sSalvageURL)); + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sSalvagedFile)); pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); } if ( rSet.GetItemState( SID_PATH, sal_False, &pItem ) == SFX_ITEM_SET ) @@ -1574,6 +1611,21 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sModifyPasswordInfo)); pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); } + if ( rSet.GetItemState( SID_ENCRYPTIONDATA, sal_False, &pItem ) == SFX_ITEM_SET ) + { + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sEncryptionData)); + pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); + } + if ( rSet.GetItemState( SID_SUGGESTEDSAVEASDIR, sal_False, &pItem ) == SFX_ITEM_SET ) + { + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sSuggestedSaveAsDir)); + pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); + } + if ( rSet.GetItemState( SID_SUGGESTEDSAVEASNAME, sal_False, &pItem ) == SFX_ITEM_SET ) + { + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sSuggestedSaveAsName)); + pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); + } } } @@ -1729,12 +1781,9 @@ void SAL_CALL SfxMacroLoader::removeStatusListener( { } -// ----------------------------------------------------------------------- ErrCode SfxMacroLoader::loadMacro( const ::rtl::OUString& rURL, com::sun::star::uno::Any& rRetval, SfxObjectShell* pSh ) throw ( ::com::sun::star::uno::RuntimeException ) { - SfxApplication* pApp = SFX_APP(); - pApp->EnterBasicCall(); SfxObjectShell* pCurrent = pSh; if ( !pCurrent ) // all not full qualified names use the BASIC of the given or current document @@ -1780,18 +1829,21 @@ ErrCode SfxMacroLoader::loadMacro( const ::rtl::OUString& rURL, com::sun::star:: if ( pBasMgr ) { - if ( pSh && pDoc ) + const bool bIsAppBasic = ( pBasMgr == pAppMgr ); + const bool bIsDocBasic = ( pBasMgr != pAppMgr ); + + if ( pDoc ) { - // security check for macros from document basic if an SFX context (pSh) is given + // security check for macros from document basic if an SFX doc is given if ( !pDoc->AdjustMacroMode( String() ) ) // check forbids execution return ERRCODE_IO_ACCESSDENIED; } - else if ( pSh && pSh->GetMedium() ) + else if ( pDoc && pDoc->GetMedium() ) { - pSh->AdjustMacroMode( String() ); - SFX_ITEMSET_ARG( pSh->GetMedium()->GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, sal_False); - SFX_ITEMSET_ARG( pSh->GetMedium()->GetItemSet(), pMacroExecModeItem, SfxUInt16Item, SID_MACROEXECMODE, sal_False); + pDoc->AdjustMacroMode( String() ); + SFX_ITEMSET_ARG( pDoc->GetMedium()->GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, sal_False); + SFX_ITEMSET_ARG( pDoc->GetMedium()->GetItemSet(), pMacroExecModeItem, SfxUInt16Item, SID_MACROEXECMODE, sal_False); if ( pUpdateDocItem && pMacroExecModeItem && pUpdateDocItem->GetValue() == document::UpdateDocMode::NO_UPDATE && pMacroExecModeItem->GetValue() == document::MacroExecMode::NEVER_EXECUTE ) @@ -1808,76 +1860,49 @@ ErrCode SfxMacroLoader::loadMacro( const ::rtl::OUString& rURL, com::sun::star:: aQualifiedMethod.Erase( nArgsPos - nHashPos - 1 ); } - SbxMethod *pMethod = SfxQueryMacro( pBasMgr, aQualifiedMethod ); - if ( pMethod ) + if ( pBasMgr->HasMacro( aQualifiedMethod ) ) { - // arguments must be quoted - String aQuotedArgs; - if ( aArgs.Len()<2 || aArgs.GetBuffer()[1] == '\"') - // no args or already quoted args - aQuotedArgs = aArgs; - else + Any aOldThisComponent; + const bool bSetDocMacroMode = ( pDoc != NULL ) && bIsDocBasic; + const bool bSetGlobalThisComponent = ( pDoc != NULL ) && bIsAppBasic; + if ( bSetDocMacroMode ) { - // quote parameters - aArgs.Erase(0,1); - aArgs.Erase( aArgs.Len()-1,1); - - aQuotedArgs = '('; - - sal_uInt16 nCount = aArgs.GetTokenCount(','); - for ( sal_uInt16 n=0; n<nCount; n++ ) - { - aQuotedArgs += '\"'; - aQuotedArgs += aArgs.GetToken( n, ',' ); - aQuotedArgs += '\"'; - if ( n<nCount-1 ) - aQuotedArgs += ','; - } - - aQuotedArgs += ')'; + // mark document: it executes an own macro, so it's in a modal mode + pDoc->SetMacroMode_Impl( sal_True ); } - Any aOldThisComponent; - if ( pSh ) + if ( bSetGlobalThisComponent ) { - if ( pBasMgr != pAppMgr ) - // mark document: it executes an own macro, so it's in a modal mode - pSh->SetMacroMode_Impl( TRUE ); - if ( pBasMgr == pAppMgr ) - { - // document is executed via AppBASIC, adjust ThisComponent variable - aOldThisComponent = pAppMgr->SetGlobalUNOConstant( "ThisComponent", makeAny( pSh->GetModel() ) ); - } + // document is executed via AppBASIC, adjust ThisComponent variable + aOldThisComponent = pAppMgr->SetGlobalUNOConstant( "ThisComponent", makeAny( pDoc->GetModel() ) ); } - // add quoted arguments and do the call - String aCall( '[' ); - aCall += pMethod->GetName(); - aCall += aQuotedArgs; - aCall += ']'; - // just to let the shell be alive - SfxObjectShellRef rSh = pSh; + SfxObjectShellRef xKeepDocAlive = pDoc; - // execute function using its Sbx parent, - SbxVariable* pRet = pMethod->GetParent()->Execute( aCall ); - if ( pRet ) { - USHORT nFlags = pRet->GetFlags(); - pRet->SetFlag( SBX_READWRITE | SBX_NO_BROADCAST ); - rRetval = sbxToUnoValue( pRet ); - pRet->SetFlags( nFlags ); + // attempt to protect the document against the script tampering with its Undo Context + ::std::auto_ptr< ::framework::DocumentUndoGuard > pUndoGuard; + if ( bIsDocBasic ) + pUndoGuard.reset( new ::framework::DocumentUndoGuard( pDoc->GetModel() ) ); + + // execute the method + SbxVariableRef retValRef = new SbxVariable; + nErr = pBasMgr->ExecuteMacro( aQualifiedMethod, aArgs, retValRef ); + if ( nErr == ERRCODE_NONE ) + rRetval = sbxToUnoValue( retValRef ); } - nErr = SbxBase::GetError(); - if ( ( pBasMgr == pAppMgr ) && pSh ) + if ( bSetGlobalThisComponent ) { pAppMgr->SetGlobalUNOConstant( "ThisComponent", aOldThisComponent ); } - if ( pSh && pSh->GetModel().is() ) - // remove flag for modal mode - pSh->SetMacroMode_Impl( FALSE ); + if ( bSetDocMacroMode ) + { + // remove flag for modal mode + pDoc->SetMacroMode_Impl( sal_False ); + } } else nErr = ERRCODE_BASIC_PROC_UNDEFINED; @@ -1896,7 +1921,6 @@ ErrCode SfxMacroLoader::loadMacro( const ::rtl::OUString& rURL, com::sun::star:: nErr = SbxBase::GetError(); } - pApp->LeaveBasicCall(); SbxBase::ResetError(); return nErr; } @@ -1919,7 +1943,7 @@ Reference < XDispatch > SAL_CALL SfxAppDispatchProvider::queryDispatch( const ::rtl::OUString& /*sTargetFrameName*/, FrameSearchFlags /*eSearchFlags*/ ) throw( RuntimeException ) { - USHORT nId( 0 ); + sal_uInt16 nId( 0 ); sal_Bool bMasterCommand( sal_False ); Reference < XDispatch > xDisp; const SfxSlot* pSlot = 0; @@ -1927,9 +1951,9 @@ Reference < XDispatch > SAL_CALL SfxAppDispatchProvider::queryDispatch( if ( aURL.Protocol.compareToAscii( "slot:" ) == COMPARE_EQUAL || aURL.Protocol.compareToAscii( "commandId:" ) == COMPARE_EQUAL ) { - nId = (USHORT) aURL.Path.toInt32(); + nId = (sal_uInt16) aURL.Path.toInt32(); SfxShell* pShell; - pAppDisp->GetShellAndSlot_Impl( nId, &pShell, &pSlot, TRUE, TRUE ); + pAppDisp->GetShellAndSlot_Impl( nId, &pShell, &pSlot, sal_True, sal_True ); } else if ( aURL.Protocol.compareToAscii( ".uno:" ) == COMPARE_EQUAL ) { @@ -1972,10 +1996,10 @@ throw (::com::sun::star::uno::RuntimeException) std::list< sal_Int16 > aGroupList; SfxSlotPool* pAppSlotPool = &SFX_APP()->GetAppSlotPool_Impl(); - const ULONG nMode( SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_MENUCONFIG ); + const sal_uIntPtr nMode( SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_MENUCONFIG ); // Gruppe anw"ahlen ( Gruppe 0 ist intern ) - for ( USHORT i=0; i<pAppSlotPool->GetGroupCount(); i++ ) + for ( sal_uInt16 i=0; i<pAppSlotPool->GetGroupCount(); i++ ) { String aName = pAppSlotPool->SeekGroup( i ); const SfxSlot* pSfxSlot = pAppSlotPool->FirstSlot(); @@ -2007,11 +2031,11 @@ throw (::com::sun::star::uno::RuntimeException) if ( pAppSlotPool ) { - const ULONG nMode( SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_MENUCONFIG ); + const sal_uIntPtr nMode( SFX_SLOT_TOOLBOXCONFIG|SFX_SLOT_ACCELCONFIG|SFX_SLOT_MENUCONFIG ); rtl::OUString aCmdPrefix( RTL_CONSTASCII_USTRINGPARAM( ".uno:" )); // Gruppe anw"ahlen ( Gruppe 0 ist intern ) - for ( USHORT i=0; i<pAppSlotPool->GetGroupCount(); i++ ) + for ( sal_uInt16 i=0; i<pAppSlotPool->GetGroupCount(); i++ ) { String aName = pAppSlotPool->SeekGroup( i ); const SfxSlot* pSfxSlot = pAppSlotPool->FirstSlot(); @@ -2126,151 +2150,6 @@ SFX2_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment( *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ; } -SFX2_DLLPUBLIC sal_Bool SAL_CALL component_writeInfo( - void* , - void* pRegistryKey ) -{ - ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > xKey( reinterpret_cast< ::com::sun::star::registry::XRegistryKey* >( pRegistryKey ) ) ; - - // register actual implementations and their services - ::rtl::OUString aImpl; - ::rtl::OUString aTempStr; - ::rtl::OUString aKeyStr; - Reference< XRegistryKey > xNewKey; - Reference< XRegistryKey > xLoaderKey; - - // PluginObject - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += ::sfx2::PluginObject::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - xNewKey->createKey( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.SpecialEmbeddedObject")) ); - - // IFrameObject - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += ::sfx2::IFrameObject::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - xNewKey->createKey( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.SpecialEmbeddedObject")) ); - - // global app event broadcaster - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += SfxGlobalEvents_Impl::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - xNewKey->createKey( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.GlobalEventBroadcaster")) ); - - // global app dispatcher - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += SfxAppDispatchProvider::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - xNewKey->createKey( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.ProtocolHandler")) ); - - // standalone document info - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += SfxStandaloneDocumentInfoObject::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - xNewKey->createKey( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.StandaloneDocumentInfo")) ); - - // frame loader - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += SfxFrameLoader_Impl::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - Sequence < ::rtl::OUString > aServices = SfxFrameLoader_Impl::impl_getStaticSupportedServiceNames(); - sal_Int32 nCount = aServices.getLength(); - for ( sal_Int16 i=0; i<nCount; i++ ) - xNewKey->createKey( aServices.getConstArray()[i] ); - - // macro loader - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += SfxMacroLoader::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - xNewKey->createKey( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.ProtocolHandler")) ); - - // - sfx document templates - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += SfxDocTplService::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - xNewKey->createKey( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.DocumentTemplates")) ); - - // quickstart wrapper service - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += ShutdownIcon::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - xNewKey->createKey( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.office.Quickstart")) ); - - // application script library container service - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += SfxApplicationScriptLibraryContainer::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - xNewKey->createKey( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.ApplicationScriptLibraryContainer")) ); - - // application dialog library container service - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += SfxApplicationDialogLibraryContainer::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - xNewKey->createKey( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.ApplicationDialogLibraryContainer")) ); - - // converter of fs folders to packages - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += OPackageStructureCreator::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - Sequence< ::rtl::OUString > rServices = OPackageStructureCreator::impl_getStaticSupportedServiceNames(); - for( sal_Int32 ind = 0; ind < rServices.getLength(); ind++ ) - xNewKey->createKey( rServices.getConstArray()[ind] ); - - // subfilter to parse a stream in OASIS format generated by the filter - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += ::sfx2::OwnSubFilterService::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - rServices = ::sfx2::OwnSubFilterService::impl_getStaticSupportedServiceNames(); - for( sal_Int32 ind = 0; ind < rServices.getLength(); ind++ ) - xNewKey->createKey( rServices.getConstArray()[ind] ); - - // document meta data - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += comp_SfxDocumentMetaData::_getImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - xNewKey->createKey( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.DocumentProperties")) ); // writer compatable document properties @@ -2281,10 +2160,6 @@ SFX2_DLLPUBLIC sal_Bool SAL_CALL component_writeInfo( aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); xNewKey = xKey->createKey( aTempStr ); xNewKey->createKey( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.writer.DocumentProperties")) ); - - return sal_True; -} - SFX2_DLLPUBLIC void* SAL_CALL component_getFactory( const sal_Char* pImplementationName , void* pServiceManager , @@ -2381,18 +2256,18 @@ RequestFilterOptions::RequestFilterOptions( ::com::sun::star::uno::Reference< :: ::rtl::OUString temp; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > temp2; ::com::sun::star::document::FilterOptionsRequest aOptionsRequest( temp, - temp2, + temp2, rModel, rProperties ); - m_aRequest <<= aOptionsRequest; + m_aRequest <<= aOptionsRequest; - m_pAbort = new ContinuationAbort; - m_pOptions = new FilterOptionsContinuation; + m_pAbort = new comphelper::OInteractionAbort; + m_pOptions = new FilterOptionsContinuation; - m_lContinuations.realloc( 2 ); - m_lContinuations[0] = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation >( m_pAbort ); - m_lContinuations[1] = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation >( m_pOptions ); + m_lContinuations.realloc( 2 ); + m_lContinuations[0] = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation >( m_pAbort ); + m_lContinuations[1] = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation >( m_pOptions ); } ::com::sun::star::uno::Any SAL_CALL RequestFilterOptions::getRequest() @@ -2409,108 +2284,140 @@ RequestFilterOptions::RequestFilterOptions( ::com::sun::star::uno::Reference< :: } //========================================================================= +class RequestPackageReparation_Impl : public ::cppu::WeakImplHelper1< ::com::sun::star::task::XInteractionRequest > +{ + ::com::sun::star::uno::Any m_aRequest; + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > m_lContinuations; + comphelper::OInteractionApprove* m_pApprove; + comphelper::OInteractionDisapprove* m_pDisapprove; -RequestPackageReparation::RequestPackageReparation( ::rtl::OUString aName ) +public: + RequestPackageReparation_Impl( ::rtl::OUString aName ); + sal_Bool isApproved(); + virtual ::com::sun::star::uno::Any SAL_CALL getRequest() throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > SAL_CALL getContinuations() + throw( ::com::sun::star::uno::RuntimeException ); +}; + +RequestPackageReparation_Impl::RequestPackageReparation_Impl( ::rtl::OUString aName ) { ::rtl::OUString temp; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > temp2; ::com::sun::star::document::BrokenPackageRequest aBrokenPackageRequest( temp, temp2, aName ); - m_aRequest <<= aBrokenPackageRequest; - - m_pApprove = new ContinuationApprove; - m_pDisapprove = new ContinuationDisapprove; - + m_pApprove = new comphelper::OInteractionApprove; + m_pDisapprove = new comphelper::OInteractionDisapprove; m_lContinuations.realloc( 2 ); m_lContinuations[0] = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation >( m_pApprove ); m_lContinuations[1] = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation >( m_pDisapprove ); } -/*uno::*/Any SAL_CALL RequestPackageReparation::queryInterface( const /*uno::*/Type& rType ) throw (RuntimeException) +sal_Bool RequestPackageReparation_Impl::isApproved() { - return ::cppu::queryInterface ( rType, - // OWeakObject interfaces - dynamic_cast< XInterface* > ( (XInteractionRequest *) this ), - static_cast< XWeak* > ( this ), - // my own interfaces - static_cast< XInteractionRequest* > ( this ) ); + return m_pApprove->wasSelected(); } -void SAL_CALL RequestPackageReparation::acquire( ) throw () +::com::sun::star::uno::Any SAL_CALL RequestPackageReparation_Impl::getRequest() + throw( ::com::sun::star::uno::RuntimeException ) { - OWeakObject::acquire(); + return m_aRequest; } -void SAL_CALL RequestPackageReparation::release( ) throw () +::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > + SAL_CALL RequestPackageReparation_Impl::getContinuations() + throw( ::com::sun::star::uno::RuntimeException ) { - OWeakObject::release(); + return m_lContinuations; } -::com::sun::star::uno::Any SAL_CALL RequestPackageReparation::getRequest() - throw( ::com::sun::star::uno::RuntimeException ) +RequestPackageReparation::RequestPackageReparation( ::rtl::OUString aName ) { - return m_aRequest; + pImp = new RequestPackageReparation_Impl( aName ); + pImp->acquire(); } -::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > - SAL_CALL RequestPackageReparation::getContinuations() - throw( ::com::sun::star::uno::RuntimeException ) +RequestPackageReparation::~RequestPackageReparation() { - return m_lContinuations; + pImp->release(); +} + +sal_Bool RequestPackageReparation::isApproved() +{ + return pImp->isApproved(); +} + +com::sun::star::uno::Reference < ::com::sun::star::task::XInteractionRequest > RequestPackageReparation::GetRequest() +{ + return com::sun::star::uno::Reference < ::com::sun::star::task::XInteractionRequest >(pImp); } //========================================================================= +class NotifyBrokenPackage_Impl : public ::cppu::WeakImplHelper1< ::com::sun::star::task::XInteractionRequest > +{ + ::com::sun::star::uno::Any m_aRequest; + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > m_lContinuations; + comphelper::OInteractionAbort* m_pAbort; -NotifyBrokenPackage::NotifyBrokenPackage( ::rtl::OUString aName ) +public: + NotifyBrokenPackage_Impl( ::rtl::OUString aName ); + sal_Bool isAborted(); + virtual ::com::sun::star::uno::Any SAL_CALL getRequest() throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > SAL_CALL getContinuations() + throw( ::com::sun::star::uno::RuntimeException ); +}; + +NotifyBrokenPackage_Impl::NotifyBrokenPackage_Impl( ::rtl::OUString aName ) { ::rtl::OUString temp; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > temp2; ::com::sun::star::document::BrokenPackageRequest aBrokenPackageRequest( temp, temp2, aName ); - m_aRequest <<= aBrokenPackageRequest; - - m_pAbort = new ContinuationAbort; - + m_pAbort = new comphelper::OInteractionAbort; m_lContinuations.realloc( 1 ); m_lContinuations[0] = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation >( m_pAbort ); } -/*uno::*/Any SAL_CALL NotifyBrokenPackage::queryInterface( const /*uno::*/Type& rType ) throw (RuntimeException) +sal_Bool NotifyBrokenPackage_Impl::isAborted() { - return ::cppu::queryInterface ( rType, - // OWeakObject interfaces - dynamic_cast< XInterface* > ( (XInteractionRequest *) this ), - static_cast< XWeak* > ( this ), - // my own interfaces - static_cast< XInteractionRequest* > ( this ) ); + return m_pAbort->wasSelected(); } -void SAL_CALL NotifyBrokenPackage::acquire( ) throw () +::com::sun::star::uno::Any SAL_CALL NotifyBrokenPackage_Impl::getRequest() + throw( ::com::sun::star::uno::RuntimeException ) { - OWeakObject::acquire(); + return m_aRequest; } -void SAL_CALL NotifyBrokenPackage::release( ) throw () +::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > + SAL_CALL NotifyBrokenPackage_Impl::getContinuations() + throw( ::com::sun::star::uno::RuntimeException ) { - OWeakObject::release(); + return m_lContinuations; } -::com::sun::star::uno::Any SAL_CALL NotifyBrokenPackage::getRequest() - throw( ::com::sun::star::uno::RuntimeException ) +NotifyBrokenPackage::NotifyBrokenPackage( ::rtl::OUString aName ) { - return m_aRequest; + pImp = new NotifyBrokenPackage_Impl( aName ); + pImp->acquire(); } -::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > - SAL_CALL NotifyBrokenPackage::getContinuations() - throw( ::com::sun::star::uno::RuntimeException ) +NotifyBrokenPackage::~NotifyBrokenPackage() { - return m_lContinuations; + pImp->release(); } +sal_Bool NotifyBrokenPackage::isAborted() +{ + return pImp->isAborted(); +} + +com::sun::star::uno::Reference < ::com::sun::star::task::XInteractionRequest > NotifyBrokenPackage::GetRequest() +{ + return com::sun::star::uno::Reference < ::com::sun::star::task::XInteractionRequest >(pImp); +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |