diff options
Diffstat (limited to 'sw/source/ui/uno/unomailmerge.cxx')
-rw-r--r-- | sw/source/ui/uno/unomailmerge.cxx | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/sw/source/ui/uno/unomailmerge.cxx b/sw/source/ui/uno/unomailmerge.cxx index 27cb34b6d98d..75637d39fe88 100644 --- a/sw/source/ui/uno/unomailmerge.cxx +++ b/sw/source/ui/uno/unomailmerge.cxx @@ -150,11 +150,11 @@ static CloseResult CloseModelAndDocSh( //////////////////////////////////////////////////////////// -static BOOL LoadFromURL_impl( +static sal_Bool LoadFromURL_impl( Reference< frame::XModel > &rxModel, SfxObjectShellRef &rxDocSh, const String &rURL, - BOOL bClose ) + sal_Bool bClose ) throw (RuntimeException) { // try to open the document readonly and hidden @@ -172,7 +172,7 @@ static BOOL LoadFromURL_impl( } catch( Exception & ) { - return FALSE; + return sal_False; } // try to get the DocShell @@ -185,7 +185,7 @@ static BOOL LoadFromURL_impl( pTmpDocShell = pTextDoc ? pTextDoc->GetDocShell() : 0; } - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; if (xTmpModel.is() && pTmpDocShell) // everything available? { if (bClose) @@ -193,10 +193,11 @@ static BOOL LoadFromURL_impl( // set new stuff rxModel = xTmpModel; rxDocSh = pTmpDocShell; - bRes = TRUE; + bRes = sal_True; } else { + // SfxObjectShellRef is ok here, since the document will be explicitly closed SfxObjectShellRef xTmpDocSh = pTmpDocShell; CloseModelAndDocSh( xTmpModel, xTmpDocSh ); } @@ -369,15 +370,15 @@ namespace //////////////////////////////////////////////////////////// -static BOOL DeleteTmpFile_Impl( +static sal_Bool DeleteTmpFile_Impl( Reference< frame::XModel > &rxModel, SfxObjectShellRef &rxDocSh, const String &rTmpFileURL ) { - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; if (rTmpFileURL.Len()) { - BOOL bDelete = TRUE; + sal_Bool bDelete = sal_True; if ( eVetoed == CloseModelAndDocSh( rxModel, rxDocSh ) ) { // somebody vetoed the closing, and took the ownership of the document @@ -385,7 +386,7 @@ static BOOL DeleteTmpFile_Impl( Reference< XEventListener > xEnsureDelete( new DelayedFileDeletion( rxModel, rTmpFileURL ) ); // note: as soon as #106931# is fixed, the whole DelayedFileDeletion is to be superseeded by // a better solution - bDelete = FALSE; + bDelete = sal_False; } rxModel = 0; @@ -400,7 +401,7 @@ static BOOL DeleteTmpFile_Impl( } } else - bRes = TRUE; // file will be deleted delayed + bRes = sal_True; // file will be deleted delayed } return bRes; } @@ -490,7 +491,7 @@ uno::Any SAL_CALL SwXMailMerge::execute( const OUString &rName = pArguments[i].Name; const Any &rValue = pArguments[i].Value; - BOOL bOK = TRUE; + sal_Bool bOK = sal_True; if (rName.equalsAscii( GetPropName( UNO_NAME_SELECTION ) )) bOK = rValue >>= aCurSelection; else if (rName.equalsAscii( GetPropName( UNO_NAME_RESULT_SET ) )) @@ -509,7 +510,7 @@ uno::Any SAL_CALL SwXMailMerge::execute( { bOK = rValue >>= aCurDocumentURL; if (aCurDocumentURL.getLength() - && !LoadFromURL_impl( xCurModel, xCurDocSh, aCurDocumentURL, FALSE )) + && !LoadFromURL_impl( xCurModel, xCurDocSh, aCurDocumentURL, sal_False )) throw RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Failed to create document from URL: " ) ) + aCurDocumentURL, static_cast < cppu::OWeakObject * > ( this ) ); } else if (rName.equalsAscii( GetPropName( UNO_NAME_OUTPUT_URL ) )) @@ -620,7 +621,7 @@ uno::Any SAL_CALL SwXMailMerge::execute( aCurSelection = aTranslated; } - SfxViewFrame* pFrame = SfxViewFrame::GetFirst( xCurDocSh, FALSE); + SfxViewFrame* pFrame = SfxViewFrame::GetFirst( xCurDocSh, sal_False); SwView *pView = PTR_CAST( SwView, pFrame->GetViewShell() ); if (!pView) throw RuntimeException(); @@ -686,7 +687,7 @@ uno::Any SAL_CALL SwXMailMerge::execute( // aDescriptor[ svx::daColumnObject ] not used aDescriptor[ svx::daSelection ] <<= aCurSelection; - USHORT nMergeType; + sal_uInt16 nMergeType; switch (nCurOutputType) { case MailMergeType::PRINTER : nMergeType = DBMGR_MERGE_MAILMERGE; break; @@ -707,11 +708,8 @@ uno::Any SAL_CALL SwXMailMerge::execute( uno::Reference< mail::XMailService > xInService; if (MailMergeType::PRINTER == nCurOutputType) { - SwPrintData aPrtData = *SW_MOD()->GetPrtOptions( FALSE ); IDocumentDeviceAccess* pIDDA = rSh.getIDocumentDeviceAccess(); - SwPrintData* pShellPrintData = pIDDA->getPrintData(); - if (pShellPrintData) - aPrtData = *pShellPrintData; + SwPrintData aPrtData( pIDDA->getPrintData() ); aPrtData.SetPrintSingleJobs( bCurSinglePrintJobs ); pIDDA->setPrintData( aPrtData ); // #i25686# printing should not be done asynchronously to prevent dangling offices @@ -818,13 +816,13 @@ uno::Any SAL_CALL SwXMailMerge::execute( if ( !bStoredAsTemporary ) throw RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Failed to save temporary file." ) ), static_cast < cppu::OWeakObject * > ( this ) ); - pMgr->SetMergeSilent( TRUE ); // suppress dialogs, message boxes, etc. + pMgr->SetMergeSilent( sal_True ); // suppress dialogs, message boxes, etc. const SwXMailMerge *pOldSrc = pMgr->GetMailMergeEvtSrc(); OSL_ENSURE( !pOldSrc || pOldSrc == this, "Ooops... different event source already set." ); pMgr->SetMailMergeEvtSrc( this ); // launch events for listeners SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE, SwDocShell::GetEventName(STR_SW_EVENT_MAIL_MERGE), xCurDocSh)); - BOOL bSucc = pMgr->MergeNew( aMergeDesc ); + sal_Bool bSucc = pMgr->MergeNew( aMergeDesc ); SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE_END, SwDocShell::GetEventName(STR_SW_EVENT_MAIL_MERGE_END), xCurDocSh)); pMgr->SetMailMergeEvtSrc( pOldSrc ); @@ -960,7 +958,7 @@ void SAL_CALL SwXMailMerge::setPropertyValue( OUString aText; bOK = rValue >>= aText; if (aText.getLength() - && !LoadFromURL_impl( xModel, xDocSh, aText, TRUE )) + && !LoadFromURL_impl( xModel, xDocSh, aText, sal_True )) throw RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Failed to create document from URL: " ) ) + aText, static_cast < cppu::OWeakObject * > ( this ) ); aDocumentURL = aText; } @@ -1033,7 +1031,7 @@ void SAL_CALL SwXMailMerge::setPropertyValue( if (bChanged) { PropertyChangeEvent aChgEvt( (XPropertySet *) this, rPropertyName, - FALSE, pCur->nWID, aOld, rValue ); + sal_False, pCur->nWID, aOld, rValue ); launchEvent( aChgEvt ); } } |