diff options
Diffstat (limited to 'sw/source/ui/dochdl/swdtflvr.cxx')
-rw-r--r-- | sw/source/ui/dochdl/swdtflvr.cxx | 400 |
1 files changed, 199 insertions, 201 deletions
diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx index 0af9063d4c72..1c9caac9b5e2 100644 --- a/sw/source/ui/dochdl/swdtflvr.cxx +++ b/sw/source/ui/dochdl/swdtflvr.cxx @@ -88,6 +88,7 @@ #include <shellio.hxx> #include <ddefld.hxx> #include <doc.hxx> +#include <IDocumentUndoRedo.hxx> #include <pagedesc.hxx> #include <IMark.hxx> #include <docary.hxx> @@ -122,16 +123,15 @@ #include <avmedia/mediawindow.hxx> #include <swcrsr.hxx> #include <SwRewriter.hxx> -#include <undobj.hxx> #include <globals.hrc> #include <vos/mutex.hxx> #include <vcl/svapp.hxx> #include <swserv.hxx> #include <switerator.hxx> -extern BOOL bFrmDrag; -extern BOOL bDDINetAttr; -extern BOOL bExecuteDrag; +extern sal_Bool bFrmDrag; +extern sal_Bool bDDINetAttr; +extern sal_Bool bExecuteDrag; #define OLESIZE 11905 - 2 * lMinBorder, 6 * MM50 @@ -178,11 +178,11 @@ class SwTrnsfrDdeLink : public ::sfx2::SvBaseLink ::sfx2::SvLinkSourceRef refObj; SwTransferable& rTrnsfr; SwDocShell* pDocShell; - ULONG nOldTimeOut; - BOOL bDelBookmrk : 1; - BOOL bInDisconnect : 1; + sal_uLong nOldTimeOut; + sal_Bool bDelBookmrk : 1; + sal_Bool bInDisconnect : 1; - BOOL FindDocShell(); + sal_Bool FindDocShell(); using sfx2::SvBaseLink::Disconnect; @@ -196,9 +196,9 @@ public: const uno::Any & rValue ); virtual void Closed(); - BOOL WriteData( SvStream& rStrm ); + sal_Bool WriteData( SvStream& rStrm ); - void Disconnect( BOOL bRemoveDataAdvise ); + void Disconnect( sal_Bool bRemoveDataAdvise ); }; // helper class for Action and Undo enclosing @@ -209,7 +209,7 @@ class SwTrnsfrActionAndUndo public: SwTrnsfrActionAndUndo( SwWrtShell *pS, SwUndoId nId, const SwRewriter * pRewriter = 0, - BOOL bDelSel = FALSE) + sal_Bool bDelSel = sal_False) : pSh( pS ), eUndoId( nId ) { pSh->StartUndo( eUndoId, pRewriter ); @@ -219,7 +219,7 @@ public: } ~SwTrnsfrActionAndUndo() { - pSh->EndUndo( eUndoId ); + pSh->EndUndo(); pSh->EndAllAction(); } }; @@ -266,7 +266,7 @@ SwTransferable::~SwTransferable() // der DDELink braucht noch die WrtShell! if( refDdeLink.Is() ) { - ((SwTrnsfrDdeLink*)&refDdeLink)->Disconnect( TRUE ); + ((SwTrnsfrDdeLink*)&refDdeLink)->Disconnect( sal_True ); refDdeLink.Clear(); } @@ -441,14 +441,14 @@ sal_Bool SwTransferable::GetData( const DATA_FLAVOR& rFlavor ) pClpDocFac = new SwDocFac; SwDoc *const pTmpDoc = lcl_GetDoc(*pClpDocFac); - pTmpDoc->SetRefForDocShell( boost::addressof(aDocShellRef) ); pTmpDoc->LockExpFlds(); // nie die Felder updaten - Text so belassen pWrtShell->Copy( pTmpDoc ); // es wurde in der CORE eine neu angelegt (OLE-Objekte kopiert!) + aDocShellRef = pTmpDoc->GetTmpDocShell(); if( aDocShellRef.Is() ) SwTransferable::InitOle( aDocShellRef, *pTmpDoc ); - pTmpDoc->SetRefForDocShell( 0 ); + pTmpDoc->SetTmpDocShell( (SfxObjectShell*)NULL ); if( nSelectionType & nsSelectionType::SEL_TXT && !pWrtShell->HasMark() ) { @@ -456,7 +456,7 @@ sal_Bool SwTransferable::GetData( const DATA_FLAVOR& rFlavor ) Point aPos( SwEditWin::GetDDStartPosX(), SwEditWin::GetDDStartPosY()); - BOOL bSelect = bExecuteDrag && + sal_Bool bSelect = bExecuteDrag && pWrtShell->GetView().GetDocShell() && !pWrtShell->GetView().GetDocShell()->IsReadOnly(); if( pWrtShell->GetContentAtPos( aPos, aCntntAtPos, bSelect ) ) @@ -675,7 +675,7 @@ sal_Bool SwTransferable::WriteObject( SotStorageStreamRef& xStream, pEmbObj->SetupStorage( xWorkStore, SOFFICE_FILEFORMAT_CURRENT, sal_False ); // mba: no BaseURL for clipboard SfxMedium aMedium( xWorkStore, String() ); - bRet = pEmbObj->DoSaveObjectAs( aMedium, FALSE ); + bRet = pEmbObj->DoSaveObjectAs( aMedium, sal_False ); pEmbObj->DoSaveCompleted(); uno::Reference< embed::XTransactedObject > xTransact( xWorkStore, uno::UNO_QUERY ); @@ -690,7 +690,7 @@ sal_Bool SwTransferable::WriteObject( SotStorageStreamRef& xStream, delete pSrcStm; } - bRet = TRUE; + bRet = sal_True; xWorkStore->dispose(); xWorkStore = uno::Reference < embed::XStorage >(); @@ -733,7 +733,7 @@ sal_Bool SwTransferable::WriteObject( SotStorageStreamRef& xStream, xWrt->SetAsciiOptions( aAOpt ); // #102841# no start char for clipboard - xWrt->bUCS2_WithStartChar = FALSE; + xWrt->bUCS2_WithStartChar = sal_False; } break; } @@ -741,9 +741,9 @@ sal_Bool SwTransferable::WriteObject( SotStorageStreamRef& xStream, if( xWrt.Is() ) { SwDoc* pDoc = (SwDoc*)pObject; - xWrt->bWriteClipboardDoc = TRUE; + xWrt->bWriteClipboardDoc = sal_True; xWrt->bWriteOnlyFirstTable = 0 != (TRNSFR_TABELLE & eBufferType); - xWrt->SetShowProgress( FALSE ); + xWrt->SetShowProgress( sal_False ); SwWriter aWrt( *xStream, *pDoc ); if( !IsError( aWrt.Write( xWrt )) ) { @@ -760,7 +760,7 @@ sal_Bool SwTransferable::WriteObject( SotStorageStreamRef& xStream, int SwTransferable::Cut() { - int nRet = Copy( TRUE ); + int nRet = Copy( sal_True ); if( nRet ) DeleteSelection(); return nRet; @@ -783,7 +783,7 @@ void SwTransferable::DeleteSelection() // ----------------------------------------------------------------------- -int SwTransferable::PrepareForCopy( BOOL bIsCut ) +int SwTransferable::PrepareForCopy( sal_Bool bIsCut ) { int nRet = 1; if(!pWrtShell) @@ -843,7 +843,7 @@ int SwTransferable::PrepareForCopy( BOOL bIsCut ) { SwWait *pWait = 0; if( pWrtShell->ShouldWait() ) - pWait = new SwWait( *pWrtShell->GetView().GetDocShell(), TRUE ); + pWait = new SwWait( *pWrtShell->GetView().GetDocShell(), sal_True ); pClpDocFac = new SwDocFac; @@ -856,7 +856,6 @@ int SwTransferable::PrepareForCopy( BOOL bIsCut ) SwDoc *const pTmpDoc = lcl_GetDoc(*pClpDocFac); - pTmpDoc->SetRefForDocShell( boost::addressof(aDocShellRef) ); pTmpDoc->LockExpFlds(); // nie die Felder updaten - Text so belassen pWrtShell->Copy( pTmpDoc ); @@ -879,16 +878,17 @@ int SwTransferable::PrepareForCopy( BOOL bIsCut ) } // es wurde in der CORE eine neu angelegt (OLE-Objekte kopiert!) + aDocShellRef = pTmpDoc->GetTmpDocShell(); if( aDocShellRef.Is() ) SwTransferable::InitOle( aDocShellRef, *pTmpDoc ); - pTmpDoc->SetRefForDocShell( 0 ); + pTmpDoc->SetTmpDocShell( (SfxObjectShell*)NULL ); if( pWrtShell->IsObjSelected() ) eBufferType = TRNSFR_DRAWING; else { eBufferType = TRNSFR_DOCUMENT; - if (pWrtShell->IntelligentCut(nSelection, FALSE) != SwWrtShell::NO_WORD) + if (pWrtShell->IntelligentCut(nSelection, sal_False) != SwWrtShell::NO_WORD) eBufferType = (TransferBufferType)(TRNSFR_DOCUMENT_WORD | eBufferType); } @@ -957,7 +957,7 @@ int SwTransferable::PrepareForCopy( BOOL bIsCut ) //ObjectDescriptor wurde bereits aus der alten DocShell gefuellt. //Jetzt noch anpassen. Dadurch kann im GetData die erste Anfrage //auch noch mit delayed rendering beantwortet werden. - aObjDesc.mbCanLink = FALSE; + aObjDesc.mbCanLink = sal_False; Size aSz( OLESIZE ); aObjDesc.maSize = OutputDevice::LogicToLogic( aSz, MAP_TWIP, MAP_100TH_MM ); @@ -991,7 +991,7 @@ int SwTransferable::PrepareForCopy( BOOL bIsCut ) return nRet; } -int SwTransferable::Copy( BOOL bIsCut ) +int SwTransferable::Copy( sal_Bool bIsCut ) { int nRet = PrepareForCopy( bIsCut ); if ( nRet ) @@ -1007,7 +1007,7 @@ int SwTransferable::CalculateAndCopy() { if(!pWrtShell) return 0; - SwWait aWait( *pWrtShell->GetView().GetDocShell(), TRUE ); + SwWait aWait( *pWrtShell->GetView().GetDocShell(), sal_True ); String aStr( pWrtShell->Calculate() ); @@ -1029,7 +1029,7 @@ int SwTransferable::CopyGlossary( SwTextBlocks& rGlossary, { if(!pWrtShell) return 0; - SwWait aWait( *pWrtShell->GetView().GetDocShell(), TRUE ); + SwWait aWait( *pWrtShell->GetView().GetDocShell(), sal_True ); pClpDocFac = new SwDocFac; SwDoc *const pCDoc = lcl_GetDoc(*pClpDocFac); @@ -1039,15 +1039,15 @@ int SwTransferable::CopyGlossary( SwTextBlocks& rGlossary, SwCntntNode* pCNd = rNds.GoNext( &aNodeIdx ); // gehe zum 1. ContentNode SwPaM aPam( *pCNd ); - pCDoc->SetRefForDocShell( boost::addressof(aDocShellRef) ); pCDoc->LockExpFlds(); // nie die Felder updaten - Text so belassen pCDoc->InsertGlossary( rGlossary, rStr, aPam, 0 ); // es wurde in der CORE eine neu angelegt (OLE-Objekte kopiert!) + aDocShellRef = pCDoc->GetTmpDocShell(); if( aDocShellRef.Is() ) SwTransferable::InitOle( aDocShellRef, *pCDoc ); - pCDoc->SetRefForDocShell( 0 ); + pCDoc->SetTmpDocShell( (SfxObjectShell*)NULL ); eBufferType = TRNSFR_DOCUMENT; @@ -1060,7 +1060,7 @@ int SwTransferable::CopyGlossary( SwTextBlocks& rGlossary, //ObjectDescriptor wurde bereits aus der alten DocShell gefuellt. //Jetzt noch anpassen. Dadurch kann im GetData die erste Anfrage //auch noch mit delayed rendering beantwortet werden. - aObjDesc.mbCanLink = FALSE; + aObjDesc.mbCanLink = sal_False; Size aSz( OLESIZE ); aObjDesc.maSize = OutputDevice::LogicToLogic( aSz, MAP_TWIP, MAP_100TH_MM ); @@ -1078,7 +1078,7 @@ static inline uno::Reference < XTransferable > * lcl_getTransferPointer ( uno::R } // ----------------------------------------------------------------------- -BOOL SwTransferable::IsPaste( const SwWrtShell& rSh, +sal_Bool SwTransferable::IsPaste( const SwWrtShell& rSh, const TransferableDataHelper& rData ) { // Check the common case first: We can always paste our own data! @@ -1093,8 +1093,8 @@ BOOL SwTransferable::IsPaste( const SwWrtShell& rSh, // determine the proper paste action, and return true if we find one uno::Reference<XTransferable> xTransferable( rData.GetXTransferable() ); - USHORT nDestination = SwTransferable::GetSotDestination( rSh ); - USHORT nSourceOptions = + sal_uInt16 nDestination = SwTransferable::GetSotDestination( rSh ); + sal_uInt16 nSourceOptions = (( EXCHG_DEST_DOC_TEXTFRAME == nDestination || EXCHG_DEST_SWDOC_FREE_AREA == nDestination || EXCHG_DEST_DOC_TEXTFRAME_WEB == nDestination || @@ -1102,9 +1102,9 @@ BOOL SwTransferable::IsPaste( const SwWrtShell& rSh, ? EXCHG_IN_ACTION_COPY : EXCHG_IN_ACTION_MOVE); - ULONG nFormat; // output param for GetExchangeAction - USHORT nEventAction; // output param for GetExchangeAction - USHORT nAction = SotExchange::GetExchangeAction( + sal_uLong nFormat; // output param for GetExchangeAction + sal_uInt16 nEventAction; // output param for GetExchangeAction + sal_uInt16 nAction = SotExchange::GetExchangeAction( rData.GetDataFlavorExVector(), nDestination, nSourceOptions, /* ?? */ @@ -1123,9 +1123,9 @@ BOOL SwTransferable::IsPaste( const SwWrtShell& rSh, int SwTransferable::Paste( SwWrtShell& rSh, TransferableDataHelper& rData ) { - USHORT nEventAction, nAction=0, + sal_uInt16 nEventAction, nAction=0, nDestination = SwTransferable::GetSotDestination( rSh ); - ULONG nFormat = 0; + sal_uLong nFormat = 0; if( GetSwTransferable( rData ) ) { @@ -1133,7 +1133,7 @@ int SwTransferable::Paste( SwWrtShell& rSh, TransferableDataHelper& rData ) } else { - USHORT nSourceOptions = + sal_uInt16 nSourceOptions = (( EXCHG_DEST_DOC_TEXTFRAME == nDestination || EXCHG_DEST_SWDOC_FREE_AREA == nDestination || EXCHG_DEST_DOC_TEXTFRAME_WEB == nDestination || @@ -1162,20 +1162,20 @@ int SwTransferable::Paste( SwWrtShell& rSh, TransferableDataHelper& rData ) return EXCHG_INOUT_ACTION_NONE != nAction && SwTransferable::PasteData( rData, rSh, nAction, nFormat, - nDestination, FALSE, FALSE ); + nDestination, sal_False, sal_False ); } // ----------------------------------------------------------------------- int SwTransferable::PasteData( TransferableDataHelper& rData, - SwWrtShell& rSh, USHORT nAction, ULONG nFormat, - USHORT nDestination, BOOL bIsPasteFmt, + SwWrtShell& rSh, sal_uInt16 nAction, sal_uLong nFormat, + sal_uInt16 nDestination, sal_Bool bIsPasteFmt, sal_Bool bIsDefault, const Point* pPt, sal_Int8 nDropAction, - BOOL bPasteSelection ) + sal_Bool bPasteSelection ) { SwWait aWait( *rSh.GetView(). - GetDocShell(), FALSE ); + GetDocShell(), sal_False ); SwTrnsfrActionAndUndo* pAction = 0; SwModule* pMod = SW_MOD(); @@ -1198,14 +1198,14 @@ int SwTransferable::PasteData( TransferableDataHelper& rData, case EXCHG_DEST_DOC_URLBUTTON: case EXCHG_DEST_DOC_GROUPOBJ: // Rahmen/Objecte selektieren - SwTransferable::SetSelInShell( rSh, TRUE, pPt ); + SwTransferable::SetSelInShell( rSh, sal_True, pPt ); break; // case EXCHG_DEST_DOC_TEXTFRAME: // case EXCHG_DEST_SWDOC_FREE_AREA: // case EXCHG_DEST_DOC_URLFIELD: default: - SwTransferable::SetSelInShell( rSh, FALSE, pPt ); + SwTransferable::SetSelInShell( rSh, sal_False, pPt ); break; } } @@ -1220,21 +1220,21 @@ int SwTransferable::PasteData( TransferableDataHelper& rData, // - nicht bei ReRead einer Grafik/DDEDaten // - nicht bei D&D, fuer die richtige Selektion wurde im // Drop-Handler gesorgt - BOOL bDelSel = FALSE; + sal_Bool bDelSel = sal_False; switch( nDestination ) { case EXCHG_DEST_DOC_TEXTFRAME: case EXCHG_DEST_SWDOC_FREE_AREA: case EXCHG_DEST_DOC_TEXTFRAME_WEB: case EXCHG_DEST_SWDOC_FREE_AREA_WEB: - bDelSel = TRUE; + bDelSel = sal_True; break; } if( bDelSel ) // --> FME 2004-10-19 #i34830# pAction = new SwTrnsfrActionAndUndo( &rSh, UNDO_PASTE_CLIPBOARD, NULL, - TRUE ); + sal_True ); // <-- } @@ -1269,10 +1269,10 @@ int SwTransferable::PasteData( TransferableDataHelper& rData, } // im Drag&Drop duerfen keine MessageBoxen angezeigt werden - BOOL bMsg = 0 == pPt; - BYTE nActionFlags = static_cast< BYTE >(( nAction >> 8 ) & 0xFF); + sal_Bool bMsg = 0 == pPt; + sal_uInt8 nActionFlags = static_cast< sal_uInt8 >(( nAction >> 8 ) & 0xFF); - USHORT nClearedAction = ( nAction & EXCHG_ACTION_MASK ); + sal_uInt16 nClearedAction = ( nAction & EXCHG_ACTION_MASK ); // Selektionen loeschen switch( nClearedAction ) @@ -1392,7 +1392,7 @@ ASSERT( pPt, "EXCHG_OUT_ACTION_MOVE_PRIVATE: was soll hier passieren?" ); case SOT_FORMATSTR_ID_NETSCAPE_IMAGE: nRet = SwTransferable::_PasteTargetURL( rData, rSh, SW_PASTESDR_INSERT, - pPt, TRUE ); + pPt, sal_True ); break; default: @@ -1415,7 +1415,7 @@ ASSERT( pPt, "EXCHG_OUT_ACTION_MOVE_PRIVATE: was soll hier passieren?" ); case EXCHG_OUT_ACTION_INSERT_DDE: { - BOOL bReRead = 0 != CNT_HasGrf( rSh.GetCntType() ); + sal_Bool bReRead = 0 != CNT_HasGrf( rSh.GetCntType() ); nRet = SwTransferable::_PasteDDE( rData, rSh, bReRead, bMsg ); } break; @@ -1472,7 +1472,7 @@ ASSERT( pPt, "EXCHG_OUT_ACTION_MOVE_PRIVATE: was soll hier passieren?" ); nActionFlags, bMsg ); break; default: - ASSERT( FALSE, "unbekanntes Format" ); + ASSERT( sal_False, "unbekanntes Format" ); } break; @@ -1511,7 +1511,7 @@ ASSERT( pPt, "EXCHG_OUT_ACTION_MOVE_PRIVATE: was soll hier passieren?" ); break; default: - ASSERT( FALSE, "unbekannte Action" ); + ASSERT( sal_False, "unbekannte Action" ); } } @@ -1532,10 +1532,10 @@ ASSERT( pPt, "EXCHG_OUT_ACTION_MOVE_PRIVATE: was soll hier passieren?" ); // ----------------------------------------------------------------------- -USHORT SwTransferable::GetSotDestination( const SwWrtShell& rSh, +sal_uInt16 SwTransferable::GetSotDestination( const SwWrtShell& rSh, const Point* pPt ) { - USHORT nRet = EXCHG_INOUT_ACTION_NONE; + sal_uInt16 nRet = EXCHG_INOUT_ACTION_NONE; ObjCntType eOType; if( pPt ) @@ -1550,7 +1550,7 @@ USHORT SwTransferable::GetSotDestination( const SwWrtShell& rSh, { case OBJCNT_GRF: { - BOOL bIMap, bLink; + sal_Bool bIMap, bLink; if( pPt ) { bIMap = 0 != rSh.GetFmtFromObj( *pPt )->GetURL().GetMap(); @@ -1600,7 +1600,7 @@ JP 13.07.98: Bug 52637: es wird ein URL-Feld erkannt also werden nur die SwContentAtPos aCntntAtPos( SwContentAtPos::SW_INETATTR ); SfxItemSet aSet( (SfxItemPool&)rSh.GetAttrPool(), RES_TXTATR_INETFMT, RES_TXTATR_INETFMT ); - if( pPt ? ((SwWrtShell&)rSh).GetContentAtPos( *pPt, aCntntAtPos, FALSE ) + if( pPt ? ((SwWrtShell&)rSh).GetContentAtPos( *pPt, aCntntAtPos, sal_False ) : (rSh.GetAttr( aSet ) && aSet.Count()) ) nRet = EXCHG_DEST_DOC_URLFIELD; else @@ -1618,9 +1618,9 @@ JP 13.07.98: Bug 52637: es wird ein URL-Feld erkannt also werden nur die // ----------------------------------------------------------------------- int SwTransferable::_PasteFileContent( TransferableDataHelper& rData, - SwWrtShell& rSh, ULONG nFmt, BOOL bMsg ) + SwWrtShell& rSh, sal_uLong nFmt, sal_Bool bMsg ) { - USHORT nResId = MSG_CLPBRD_FORMAT_ERROR; + sal_uInt16 nResId = MSG_CLPBRD_FORMAT_ERROR; int nRet = 0; MSE40HTMLClipFormatObj aMSE40ClpObj; @@ -1661,10 +1661,10 @@ int SwTransferable::_PasteFileContent( TransferableDataHelper& rData, { pStream = aMSE40ClpObj.IsValid( *xStrm ); pRead = ReadHTML; - pRead->SetReadUTF8( TRUE ); + pRead->SetReadUTF8( sal_True ); //pRead->SetBaseURL( aMSE40ClpObj.GetBaseURL() ); - BOOL bNoComments = + sal_Bool bNoComments = ( nFmt == SOT_FORMATSTR_ID_HTML_NO_COMMENT ); pRead->SetIgnoreHTMLComments( bNoComments ); } @@ -1676,7 +1676,7 @@ int SwTransferable::_PasteFileContent( TransferableDataHelper& rData, else if( !pRead ) { pRead = ReadHTML; - pRead->SetReadUTF8( TRUE ); + pRead->SetReadUTF8( sal_True ); } } } @@ -1715,7 +1715,7 @@ int SwTransferable::_PasteFileContent( TransferableDataHelper& rData, // ----------------------------------------------------------------------- int SwTransferable::_PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh, - ULONG nFmt, BYTE nActionFlags, BOOL bMsg ) + sal_uLong nFmt, sal_uInt8 nActionFlags, sal_Bool bMsg ) { int nRet = 0; TransferableObjectDescriptor aObjDesc; @@ -1838,7 +1838,7 @@ int SwTransferable::_PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh, // try to get the replacement image from the clipboard Graphic aGraphic; - ULONG nGrFormat = 0; + sal_uLong nGrFormat = 0; // (wg. Selection Manager bei Trustet Solaris) #ifndef SOLARIS @@ -1926,7 +1926,7 @@ int SwTransferable::_PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh, if( nRet && ( nActionFlags & ( EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL >> 8) )) - SwTransferable::_PasteTargetURL( rData, rSh, 0, 0, FALSE ); + SwTransferable::_PasteTargetURL( rData, rSh, 0, 0, sal_False ); // let the object be unloaded if possible SwOLEObj::UnloadObject( xObj, rSh.GetDoc(), embed::Aspects::MSOLE_CONTENT ); @@ -1941,8 +1941,8 @@ int SwTransferable::_PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh, // ----------------------------------------------------------------------- int SwTransferable::_PasteTargetURL( TransferableDataHelper& rData, - SwWrtShell& rSh, USHORT nAction, - const Point* pPt, BOOL bInsertGRF ) + SwWrtShell& rSh, sal_uInt16 nAction, + const Point* pPt, sal_Bool bInsertGRF ) { int nRet = 0; INetImage aINetImg; @@ -1966,7 +1966,7 @@ int SwTransferable::_PasteTargetURL( TransferableDataHelper& rData, switch( nAction ) { case SW_PASTESDR_INSERT: - SwTransferable::SetSelInShell( rSh, FALSE, pPt ); + SwTransferable::SetSelInShell( rSh, sal_False, pPt ); rSh.Insert( sURL, aEmptyStr, aGrf ); break; @@ -1975,7 +1975,7 @@ int SwTransferable::_PasteTargetURL( TransferableDataHelper& rData, { rSh.ReplaceSdrObj( sURL, aEmptyStr, &aGrf ); Point aPt( pPt ? *pPt : rSh.GetCrsrDocPos() ); - SwTransferable::SetSelInShell( rSh, TRUE, &aPt ); + SwTransferable::SetSelInShell( rSh, sal_True, &aPt ); } else rSh.ReRead( sURL, aEmptyStr, &aGrf ); @@ -1988,7 +1988,7 @@ int SwTransferable::_PasteTargetURL( TransferableDataHelper& rData, rSh.ReRead( sURL, aEmptyStr, &aGrf ); else { - SwTransferable::SetSelInShell( rSh, FALSE, pPt ); + SwTransferable::SetSelInShell( rSh, sal_False, pPt ); rSh.Insert( sURL, aEmptyStr, aGrf ); } break; @@ -2010,7 +2010,7 @@ int SwTransferable::_PasteTargetURL( TransferableDataHelper& rData, if( aURL.GetURL() != aINetImg.GetTargetURL() || aURL.GetTargetFrameName() != aINetImg.GetTargetFrame() ) { - aURL.SetURL( aINetImg.GetTargetURL(), FALSE ); + aURL.SetURL( aINetImg.GetTargetURL(), sal_False ); aURL.SetTargetFrameName( aINetImg.GetTargetFrame() ); aSet.Put( aURL ); rSh.SetFlyFrmAttr( aSet ); @@ -2022,7 +2022,7 @@ int SwTransferable::_PasteTargetURL( TransferableDataHelper& rData, // ----------------------------------------------------------------------- -void SwTransferable::SetSelInShell( SwWrtShell& rSh, BOOL bSelectFrm, +void SwTransferable::SetSelInShell( SwWrtShell& rSh, sal_Bool bSelectFrm, const Point* pPt ) { if( bSelectFrm ) @@ -2035,7 +2035,7 @@ void SwTransferable::SetSelInShell( SwWrtShell& rSh, BOOL bSelectFrm, { rSh.HideCrsr(); rSh.EnterSelFrmMode( pPt ); - bFrmDrag = TRUE; + bFrmDrag = sal_True; } } } @@ -2046,22 +2046,22 @@ void SwTransferable::SetSelInShell( SwWrtShell& rSh, BOOL bSelectFrm, rSh.UnSelectFrm(); rSh.LeaveSelFrmMode(); rSh.GetView().GetEditWin().StopInsFrm(); - bFrmDrag = FALSE; + bFrmDrag = sal_False; } else if( rSh.GetView().GetDrawFuncPtr() ) rSh.GetView().GetEditWin().StopInsFrm(); rSh.EnterStdMode(); if( pPt ) - rSh.SwCrsrShell::SetCrsr( *pPt, TRUE ); + rSh.SwCrsrShell::SetCrsr( *pPt, sal_True ); } } // ----------------------------------------------------------------------- int SwTransferable::_PasteDDE( TransferableDataHelper& rData, - SwWrtShell& rWrtShell, BOOL bReReadGrf, - BOOL bMsg ) + SwWrtShell& rWrtShell, sal_Bool bReReadGrf, + sal_Bool bMsg ) { // Daten aus dem Clipboardformat String aApp, aTopic, aItem; @@ -2084,7 +2084,7 @@ int SwTransferable::_PasteDDE( TransferableDataHelper& rData, sfx2::MakeLnkName( aCmd, &aApp, aTopic, aItem ); // wollen wir jetzt eine Grafik einlesen ? - ULONG nFormat; + sal_uLong nFormat; if( !rData.HasFormat( FORMAT_RTF ) && !rData.HasFormat( SOT_FORMATSTR_ID_HTML ) && !rData.HasFormat( FORMAT_STRING ) && @@ -2106,10 +2106,10 @@ int SwTransferable::_PasteDDE( TransferableDataHelper& rData, } SwFieldType* pTyp = 0; - USHORT i = 1,j; + sal_uInt16 i = 1,j; String aName; - BOOL bAlreadyThere = FALSE, bDoublePaste = FALSE; - USHORT nSize = rWrtShell.GetFldTypeCount(); + sal_Bool bAlreadyThere = sal_False, bDoublePaste = sal_False; + sal_uInt16 nSize = rWrtShell.GetFldTypeCount(); const ::utl::TransliterationWrapper& rColl = ::GetAppCmpStrIgnore(); do { @@ -2125,7 +2125,7 @@ int SwTransferable::_PasteDDE( TransferableDataHelper& rData, sfx2::LINKUPDATE_ALWAYS == ((SwDDEFieldType*)pTyp)->GetType() ) { aName = pTyp->GetName(); - bDoublePaste = TRUE; + bDoublePaste = sal_True; break; } else if( rColl.isEqual( aName, pTyp->GetName() ) ) @@ -2133,10 +2133,10 @@ int SwTransferable::_PasteDDE( TransferableDataHelper& rData, } } if( j == nSize ) - bAlreadyThere = FALSE; + bAlreadyThere = sal_False; else { - bAlreadyThere = TRUE; + bAlreadyThere = sal_True; i++; } } @@ -2204,7 +2204,7 @@ int SwTransferable::_PasteDDE( TransferableDataHelper& rData, rWrtShell.Insert( aSwDDEField ); } - } while( FALSE ); + } while( sal_False ); } else pDDETyp = 0; // FeldTypen wieder entfernen @@ -2226,8 +2226,8 @@ int SwTransferable::_PasteDDE( TransferableDataHelper& rData, // ----------------------------------------------------------------------- int SwTransferable::_PasteSdrFormat( TransferableDataHelper& rData, - SwWrtShell& rSh, USHORT nAction, - const Point* pPt, BYTE nActionFlags ) + SwWrtShell& rSh, sal_uInt16 nAction, + const Point* pPt, sal_uInt8 nActionFlags ) { int nRet = 0; SotStorageStreamRef xStrm; @@ -2239,7 +2239,7 @@ int SwTransferable::_PasteSdrFormat( TransferableDataHelper& rData, if( nRet && ( nActionFlags & ( EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL >> 8) )) - SwTransferable::_PasteTargetURL( rData, rSh, 0, 0, FALSE ); + SwTransferable::_PasteTargetURL( rData, rSh, 0, 0, sal_False ); } return nRet; } @@ -2247,14 +2247,14 @@ int SwTransferable::_PasteSdrFormat( TransferableDataHelper& rData, // ----------------------------------------------------------------------- int SwTransferable::_PasteGrf( TransferableDataHelper& rData, SwWrtShell& rSh, - ULONG nFmt, USHORT nAction, const Point* pPt, - BYTE nActionFlags, BOOL /*bMsg*/ ) + sal_uLong nFmt, sal_uInt16 nAction, const Point* pPt, + sal_uInt8 nActionFlags, sal_Bool /*bMsg*/ ) { int nRet = 0; Graphic aGrf; INetBookmark aBkmk; - BOOL bCheckForGrf = FALSE, bCheckForImageMap = FALSE; + sal_Bool bCheckForGrf = sal_False, bCheckForImageMap = sal_False; switch( nFmt ) { @@ -2278,7 +2278,7 @@ int SwTransferable::_PasteGrf( TransferableDataHelper& rData, SwWrtShell& rSh, if( SW_PASTESDR_SETATTR == nAction ) nFmt = SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK; else - bCheckForGrf = TRUE; + bCheckForGrf = sal_True; } break; @@ -2293,7 +2293,7 @@ int SwTransferable::_PasteGrf( TransferableDataHelper& rData, SwWrtShell& rSh, aBkmk = INetBookmark( URIHelper::SmartRel2Abs(INetURLObject(), sTxt, Link(), false ), sDesc ); - bCheckForGrf = TRUE; + bCheckForGrf = sal_True; bCheckForImageMap = SW_PASTESDR_REPLACE == nAction; } } @@ -2318,7 +2318,7 @@ int SwTransferable::_PasteGrf( TransferableDataHelper& rData, SwWrtShell& rSh, { // dann als Hyperlink hinter die Grafik setzen nFmt = SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK; - nRet = TRUE; + nRet = sal_True; } } @@ -2331,7 +2331,7 @@ int SwTransferable::_PasteGrf( TransferableDataHelper& rData, SwWrtShell& rSh, switch( nAction ) { case SW_PASTESDR_INSERT: - SwTransferable::SetSelInShell( rSh, FALSE, pPt ); + SwTransferable::SetSelInShell( rSh, sal_False, pPt ); rSh.Insert( sURL, aEmptyStr, aGrf ); break; @@ -2340,7 +2340,7 @@ int SwTransferable::_PasteGrf( TransferableDataHelper& rData, SwWrtShell& rSh, { rSh.ReplaceSdrObj( sURL, aEmptyStr, &aGrf ); Point aPt( pPt ? *pPt : rSh.GetCrsrDocPos() ); - SwTransferable::SetSelInShell( rSh, TRUE, &aPt ); + SwTransferable::SetSelInShell( rSh, sal_True, &aPt ); } else rSh.ReRead( sURL, aEmptyStr, &aGrf ); @@ -2354,7 +2354,7 @@ int SwTransferable::_PasteGrf( TransferableDataHelper& rData, SwWrtShell& rSh, SfxItemSet aSet( rSh.GetAttrPool(), RES_URL, RES_URL ); rSh.GetFlyFrmAttr( aSet ); SwFmtURL aURL( (SwFmtURL&)aSet.Get( RES_URL ) ); - aURL.SetURL( aBkmk.GetURL(), FALSE ); + aURL.SetURL( aBkmk.GetURL(), sal_False ); aSet.Put( aURL ); rSh.SetFlyFrmAttr( aSet ); } @@ -2365,7 +2365,7 @@ int SwTransferable::_PasteGrf( TransferableDataHelper& rData, SwWrtShell& rSh, rSh.ReRead( sURL, aEmptyStr, &aGrf ); else { - SwTransferable::SetSelInShell( rSh, FALSE, pPt ); + SwTransferable::SetSelInShell( rSh, sal_False, pPt ); rSh.Insert( aBkmk.GetURL(), aEmptyStr, aGrf ); } break; @@ -2384,14 +2384,14 @@ int SwTransferable::_PasteGrf( TransferableDataHelper& rData, SwWrtShell& rSh, if( nActionFlags & ( EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL >> 8) ) - SwTransferable::_PasteTargetURL( rData, rSh, 0, 0, FALSE ); + SwTransferable::_PasteTargetURL( rData, rSh, 0, 0, sal_False ); } else if( bCheckForImageMap ) { // oder sollte das File ein ImageMap-File sein? ImageMap aMap; SfxMedium aMed( INetURLObject(aBkmk.GetURL()).GetFull(), - STREAM_STD_READ, FALSE ); + STREAM_STD_READ, sal_False ); SvStream* pStream = aMed.GetInStream(); if( pStream != NULL && !pStream->GetError() && @@ -2442,7 +2442,7 @@ int SwTransferable::_PasteImageMap( TransferableDataHelper& rData, // ----------------------------------------------------------------------- int SwTransferable::_PasteAsHyperlink( TransferableDataHelper& rData, - SwWrtShell& rSh, ULONG nFmt ) + SwWrtShell& rSh, sal_uLong nFmt ) { int nRet = 0; String sFile; @@ -2466,7 +2466,7 @@ int SwTransferable::_PasteAsHyperlink( TransferableDataHelper& rData, SfxItemSet aSet( rSh.GetAttrPool(), RES_URL, RES_URL ); rSh.GetFlyFrmAttr( aSet ); SwFmtURL aURL2( (SwFmtURL&)aSet.Get( RES_URL ) ); - aURL2.SetURL( sFile, FALSE ); + aURL2.SetURL( sFile, sal_False ); if( !aURL2.GetName().Len() ) aURL2.SetName( sFile ); aSet.Put( aURL2 ); @@ -2480,7 +2480,7 @@ int SwTransferable::_PasteAsHyperlink( TransferableDataHelper& rData, sDesc.Len() ? sDesc : sFile ); } } - nRet = TRUE; + nRet = sal_True; } return nRet; } @@ -2488,9 +2488,9 @@ int SwTransferable::_PasteAsHyperlink( TransferableDataHelper& rData, // ----------------------------------------------------------------------- int SwTransferable::_PasteFileName( TransferableDataHelper& rData, - SwWrtShell& rSh, ULONG nFmt, - USHORT nAction, const Point* pPt, - BYTE nActionFlags, BOOL bMsg ) + SwWrtShell& rSh, sal_uLong nFmt, + sal_uInt16 nAction, const Point* pPt, + sal_uInt8 nActionFlags, sal_Bool bMsg ) { int nRet = SwTransferable::_PasteGrf( rData, rSh, nFmt, nAction, pPt, nActionFlags, bMsg ); @@ -2515,7 +2515,7 @@ int SwTransferable::_PasteFileName( TransferableDataHelper& rData, } else { - BOOL bIsURLFile = SwTransferable::_CheckForURLOrLNKFile( rData, sFile, &sDesc ); + sal_Bool bIsURLFile = SwTransferable::_CheckForURLOrLNKFile( rData, sFile, &sDesc ); //Eigenes FileFormat? -->Einfuegen, nicht fuer StarWriter/Web String sFileURL = URIHelper::SmartRel2Abs(INetURLObject(), sFile, Link(), false ); @@ -2564,7 +2564,7 @@ int SwTransferable::_PasteFileName( TransferableDataHelper& rData, SfxItemSet aSet( rSh.GetAttrPool(), RES_URL, RES_URL ); rSh.GetFlyFrmAttr( aSet ); SwFmtURL aURL2( (SwFmtURL&)aSet.Get( RES_URL ) ); - aURL2.SetURL( sFile, FALSE ); + aURL2.SetURL( sFile, sal_False ); if( !aURL2.GetName().Len() ) aURL2.SetName( sFile ); aSet.Put( aURL2 ); @@ -2578,7 +2578,7 @@ int SwTransferable::_PasteFileName( TransferableDataHelper& rData, sDesc.Len() ? sDesc : sFile ); } } - nRet = TRUE; + nRet = sal_True; } } } @@ -2589,14 +2589,14 @@ int SwTransferable::_PasteFileName( TransferableDataHelper& rData, // ----------------------------------------------------------------------- int SwTransferable::_PasteDBData( TransferableDataHelper& rData, - SwWrtShell& rSh, ULONG nFmt, BOOL bLink, - const Point* pDragPt, BOOL bMsg ) + SwWrtShell& rSh, sal_uLong nFmt, sal_Bool bLink, + const Point* pDragPt, sal_Bool bMsg ) { int nRet = 0; String sTxt; if( rData.GetString( nFmt, sTxt ) && sTxt.Len() ) { - USHORT nWh = SOT_FORMATSTR_ID_SBA_CTRLDATAEXCHANGE == nFmt + sal_uInt16 nWh = SOT_FORMATSTR_ID_SBA_CTRLDATAEXCHANGE == nFmt ? 0 : SOT_FORMATSTR_ID_SBA_DATAEXCHANGE == nFmt ? (bLink @@ -2631,14 +2631,14 @@ int SwTransferable::_PasteDBData( TransferableDataHelper& rData, SfxUsrAnyItem* pColumnNameItem = 0; SfxUsrAnyItem* pSelectionItem = 0; - BOOL bDataAvailable = TRUE; + sal_Bool bDataAvailable = sal_True; ODataAccessDescriptor aDesc; if(bHaveColumnDescriptor) aDesc = OColumnTransferable::extractColumnDescriptor(rData); else if(ODataAccessObjectTransferable::canExtractObjectDescriptor(rVector) ) aDesc = ODataAccessObjectTransferable::extractObjectDescriptor(rData); else - bDataAvailable = FALSE; + bDataAvailable = sal_False; if ( bDataAvailable ) { @@ -2693,30 +2693,30 @@ int SwTransferable::_PasteDBData( TransferableDataHelper& rData, // ----------------------------------------------------------------------- int SwTransferable::_PasteFileList( TransferableDataHelper& rData, - SwWrtShell& rSh, BOOL bLink, - const Point* pPt, BOOL bMsg ) + SwWrtShell& rSh, sal_Bool bLink, + const Point* pPt, sal_Bool bMsg ) { int nRet = 0; FileList aFileList; if( rData.GetFileList( SOT_FORMAT_FILE_LIST, aFileList ) && aFileList.Count() ) { - USHORT nAct = bLink ? SW_PASTESDR_SETATTR : SW_PASTESDR_INSERT; + sal_uInt16 nAct = bLink ? SW_PASTESDR_SETATTR : SW_PASTESDR_INSERT; String sFlyNm; // iterate over the filelist - for( ULONG n = 0, nEnd = aFileList.Count(); n < nEnd; ++n ) + for( sal_uLong n = 0, nEnd = aFileList.Count(); n < nEnd; ++n ) { TransferDataContainer* pHlp = new TransferDataContainer; pHlp->CopyString( FORMAT_FILE, aFileList.GetFile( n )); TransferableDataHelper aData( pHlp ); if( SwTransferable::_PasteFileName( aData, rSh, SOT_FORMAT_FILE, nAct, - pPt, FALSE, bMsg )) + pPt, sal_False, bMsg )) { if( bLink ) { sFlyNm = rSh.GetFlyName(); - SwTransferable::SetSelInShell( rSh, FALSE, pPt ); + SwTransferable::SetSelInShell( rSh, sal_False, pPt ); } nRet = 1; } @@ -2733,17 +2733,17 @@ int SwTransferable::_PasteFileList( TransferableDataHelper& rData, // ----------------------------------------------------------------------- -BOOL SwTransferable::_CheckForURLOrLNKFile( TransferableDataHelper& rData, +sal_Bool SwTransferable::_CheckForURLOrLNKFile( TransferableDataHelper& rData, String& rFileName, String* pTitle ) { - BOOL bIsURLFile = FALSE; + sal_Bool bIsURLFile = sal_False; INetBookmark aBkmk; if( rData.GetINetBookmark( SOT_FORMATSTR_ID_SOLK, aBkmk ) ) { rFileName = aBkmk.GetURL(); if( pTitle ) *pTitle = aBkmk.GetDescription(); - bIsURLFile = TRUE; + bIsURLFile = sal_True; } else { @@ -2762,7 +2762,7 @@ ASSERT( !&rFileName, "how do we read today .URL - Files?" ); // ----------------------------------------------------------------------- -BOOL SwTransferable::IsPasteSpecial( const SwWrtShell& rWrtShell, +sal_Bool SwTransferable::IsPasteSpecial( const SwWrtShell& rWrtShell, const TransferableDataHelper& rData ) { // we can paste-special if there's an entry in the paste-special-format list @@ -2775,12 +2775,12 @@ BOOL SwTransferable::IsPasteSpecial( const SwWrtShell& rWrtShell, int SwTransferable::PasteFormat( SwWrtShell& rSh, TransferableDataHelper& rData, - ULONG nFormat ) + sal_uLong nFormat ) { - SwWait aWait( *rSh.GetView().GetDocShell(), FALSE ); + SwWait aWait( *rSh.GetView().GetDocShell(), sal_False ); int nRet = 0; - ULONG nPrivateFmt = FORMAT_PRIVATE; + sal_uLong nPrivateFmt = FORMAT_PRIVATE; SwTransferable *pClipboard = GetSwTransferable( rData ); if( pClipboard && ((TRNSFR_DOCUMENT|TRNSFR_GRAPHIC|TRNSFR_OLE) & pClipboard->eBufferType )) @@ -2791,7 +2791,7 @@ int SwTransferable::PasteFormat( SwWrtShell& rSh, else if( rData.HasFormat( nFormat ) ) { uno::Reference<XTransferable> xTransferable( rData.GetXTransferable() ); - USHORT nEventAction, + sal_uInt16 nEventAction, nDestination = SwTransferable::GetSotDestination( rSh ), nSourceOptions = (( EXCHG_DEST_DOC_TEXTFRAME == nDestination || @@ -2810,7 +2810,7 @@ int SwTransferable::PasteFormat( SwWrtShell& rSh, if( EXCHG_INOUT_ACTION_NONE != nAction ) nRet = SwTransferable::PasteData( rData, rSh, nAction, nFormat, - nDestination, TRUE, FALSE ); + nDestination, sal_True, sal_False ); } return nRet; } @@ -2818,9 +2818,9 @@ int SwTransferable::PasteFormat( SwWrtShell& rSh, // ----------------------------------------------------------------------- int SwTransferable::_TestAllowedFormat( const TransferableDataHelper& rData, - ULONG nFormat, USHORT nDestination ) + sal_uLong nFormat, sal_uInt16 nDestination ) { - USHORT nAction = EXCHG_INOUT_ACTION_NONE, nEventAction; + sal_uInt16 nAction = EXCHG_INOUT_ACTION_NONE, nEventAction; if( rData.HasFormat( nFormat )) { uno::Reference<XTransferable> xTransferable( rData.GetXTransferable() ); nAction = SotExchange::GetExchangeAction( @@ -2839,7 +2839,7 @@ int SwTransferable::_TestAllowedFormat( const TransferableDataHelper& rData, * the list of formats which will be offered to the user in the 'Paste * Special...' dialog and the paste button menu */ -static USHORT aPasteSpecialIds[] = +static sal_uInt16 aPasteSpecialIds[] = { SOT_FORMATSTR_ID_HTML, SOT_FORMATSTR_ID_HTML_SIMPLE, @@ -2866,7 +2866,7 @@ int SwTransferable::PasteUnformatted( SwWrtShell& rSh, TransferableDataHelper& r // ----------------------------------------------------------------------- -int SwTransferable::PasteSpecial( SwWrtShell& rSh, TransferableDataHelper& rData, ULONG& rFormatUsed ) +int SwTransferable::PasteSpecial( SwWrtShell& rSh, TransferableDataHelper& rData, sal_uLong& rFormatUsed ) { int nRet = 0; SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); @@ -2875,13 +2875,13 @@ int SwTransferable::PasteSpecial( SwWrtShell& rSh, TransferableDataHelper& rData DataFlavorExVector aFormats( rData.GetDataFlavorExVector() ); TransferableObjectDescriptor aDesc; - USHORT nDest = SwTransferable::GetSotDestination( rSh ); + sal_uInt16 nDest = SwTransferable::GetSotDestination( rSh ); SwTransferable *pClipboard = GetSwTransferable( rData ); if( pClipboard ) { aDesc = pClipboard->aObjDesc; - USHORT nResId; + sal_uInt16 nResId; if( pClipboard->eBufferType & TRNSFR_DOCUMENT ) nResId = STR_PRIVATETEXT; else if( pClipboard->eBufferType & TRNSFR_GRAPHIC ) @@ -2921,11 +2921,11 @@ int SwTransferable::PasteSpecial( SwWrtShell& rSh, TransferableDataHelper& rData if( SwTransferable::_TestAllowedFormat( rData, SOT_FORMATSTR_ID_LINK, nDest )) pDlg->Insert( SOT_FORMATSTR_ID_LINK, SW_RES(STR_DDEFORMAT) ); - for( USHORT* pIds = aPasteSpecialIds; *pIds; ++pIds ) + for( sal_uInt16* pIds = aPasteSpecialIds; *pIds; ++pIds ) if( SwTransferable::_TestAllowedFormat( rData, *pIds, nDest )) pDlg->Insert( *pIds, aEmptyStr ); - ULONG nFormat = pDlg->GetFormat( rData.GetTransferable() ); + sal_uLong nFormat = pDlg->GetFormat( rData.GetTransferable() ); if( nFormat ) nRet = SwTransferable::PasteFormat( rSh, rData, nFormat ); @@ -2942,12 +2942,12 @@ void SwTransferable::FillClipFmtItem( const SwWrtShell& rSh, const TransferableDataHelper& rData, SvxClipboardFmtItem & rToFill ) { - USHORT nDest = SwTransferable::GetSotDestination( rSh ); + sal_uInt16 nDest = SwTransferable::GetSotDestination( rSh ); SwTransferable *pClipboard = GetSwTransferable( rData ); if( pClipboard ) { - USHORT nResId; + sal_uInt16 nResId; if( pClipboard->eBufferType & TRNSFR_DOCUMENT ) nResId = STR_PRIVATETEXT; else if( pClipboard->eBufferType & TRNSFR_GRAPHIC ) @@ -2986,7 +2986,7 @@ void SwTransferable::FillClipFmtItem( const SwWrtShell& rSh, if( SwTransferable::_TestAllowedFormat( rData, SOT_FORMATSTR_ID_LINK, nDest )) rToFill.AddClipbrdFormat( SOT_FORMATSTR_ID_LINK, SW_RES(STR_DDEFORMAT) ); - for( USHORT* pIds = aPasteSpecialIds; *pIds; ++pIds ) + for( sal_uInt16* pIds = aPasteSpecialIds; *pIds; ++pIds ) if( SwTransferable::_TestAllowedFormat( rData, *pIds, nDest )) rToFill.AddClipbrdFormat( *pIds, aEmptyStr ); } @@ -3029,7 +3029,7 @@ void SwTransferable::SetDataForDragAndDrop( const Point& rSttPos ) { eBufferType = TRNSFR_DOCUMENT; if( SwWrtShell::NO_WORD != - pWrtShell->IntelligentCut( nSelection, FALSE )) + pWrtShell->IntelligentCut( nSelection, sal_False )) eBufferType = TransferBufferType( TRNSFR_DOCUMENT_WORD | eBufferType); } @@ -3083,7 +3083,7 @@ void SwTransferable::SetDataForDragAndDrop( const Point& rSttPos ) //ObjectDescriptor wurde bereits aus der alten DocShell gefuellt. //Jetzt noch anpassen. Dadurch kann im GetData die erste Anfrage //auch noch mit delayed rendering beantwortet werden. - aObjDesc.mbCanLink = FALSE; + aObjDesc.mbCanLink = sal_False; aObjDesc.maDragStartPos = rSttPos; aObjDesc.maSize = OutputDevice::LogicToLogic( Size( OLESIZE ), MAP_TWIP, MAP_100TH_MM ); @@ -3133,9 +3133,9 @@ void SwTransferable::StartDrag( Window* pWin, const Point& rPos ) if(!pWrtShell) return; bOldIdle = pWrtShell->GetViewOptions()->IsIdle(); - bCleanUp = TRUE; + bCleanUp = sal_True; - ((SwViewOption *)pWrtShell->GetViewOptions())->SetIdle( FALSE ); + ((SwViewOption *)pWrtShell->GetViewOptions())->SetIdle( sal_False ); if( pWrtShell->IsSelFrmMode() ) pWrtShell->ShowCrsr(); @@ -3170,7 +3170,7 @@ void SwTransferable::DragFinished( sal_Int8 nAction ) { if ( !(pWrtShell->IsSelFrmMode() || pWrtShell->IsObjSelected()) ) //SmartCut, eines der Blanks mitnehmen. - pWrtShell->IntelligentCut( pWrtShell->GetSelectionType(), TRUE ); + pWrtShell->IntelligentCut( pWrtShell->GetSelectionType(), sal_True ); pWrtShell->DelRight(); } pWrtShell->EndUndo( UNDO_UI_DRAG_AND_MOVE ); @@ -3213,7 +3213,7 @@ int SwTransferable::PrivatePaste( SwWrtShell& rShell ) // (sonst wird nicht in eine TabellenSelektion gepastet!!!) ASSERT( !rShell.ActionPend(), "Paste darf nie eine Actionklammerung haben" ); if ( !pClpDocFac ) - return sal_False; // the return value of the SwFEShell::Paste also is BOOL! + return sal_False; // the return value of the SwFEShell::Paste also is sal_Bool! const int nSelection = rShell.GetSelectionType(); @@ -3239,12 +3239,12 @@ int SwTransferable::PrivatePaste( SwWrtShell& rShell ) { // den Cursor wieder positionieren Point aPt( rShell.GetCharRect().Pos() ); - rShell.SwCrsrShell::SetCrsr( aPt, TRUE ); + rShell.SwCrsrShell::SetCrsr( aPt, sal_True ); } rShell.SetRetainSelection( false ); } - BOOL bInWrd = FALSE, bEndWrd = FALSE, bSttWrd = FALSE, + sal_Bool bInWrd = sal_False, bEndWrd = sal_False, bSttWrd = sal_False, bSmart = 0 != (TRNSFR_DOCUMENT_WORD & eBufferType); if( bSmart ) { @@ -3253,7 +3253,7 @@ int SwTransferable::PrivatePaste( SwWrtShell& rShell ) // beginning and end'. In this case we definitely want these spaces to be inserted // here. // if( SCRIPTTYPE_LATIN != rShell.GetScriptType() ) -// bSmart = FALSE; +// bSmart = sal_False; // else // { bInWrd = rShell.IsInWrd(); @@ -3281,15 +3281,15 @@ int SwTransferable::PrivatePaste( SwWrtShell& rShell ) } int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt, - BOOL bMove, BOOL bIsXSelection ) + sal_Bool bMove, sal_Bool bIsXSelection ) { int cWord = 0; - BOOL bInWrd = FALSE; - BOOL bEndWrd = FALSE; - BOOL bSttWrd = FALSE; - BOOL bSttPara= FALSE; - BOOL bTblSel = FALSE; - BOOL bFrmSel = FALSE; + sal_Bool bInWrd = sal_False; + sal_Bool bEndWrd = sal_False; + sal_Bool bSttWrd = sal_False; + sal_Bool bSttPara= sal_False; + sal_Bool bTblSel = sal_False; + sal_Bool bFrmSel = sal_False; SwWrtShell& rSrcSh = *GetShell(); @@ -3308,7 +3308,7 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt, { rSh.HideCrsr(); rSh.EnterSelFrmMode( &rDragPt ); - bFrmDrag = TRUE; + bFrmDrag = sal_True; } const int nSelection = rSh.GetSelectionType(); @@ -3319,7 +3319,7 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt, SfxItemSet aSet( rSh.GetAttrPool(), RES_URL, RES_URL ); rSh.GetFlyFrmAttr( aSet ); SwFmtURL aURL( (SwFmtURL&)aSet.Get( RES_URL ) ); - aURL.SetURL( aTmp.GetURL(), FALSE ); + aURL.SetURL( aTmp.GetURL(), sal_False ); aSet.Put( aURL ); rSh.SetFlyFrmAttr( aSet ); return 1; @@ -3330,7 +3330,7 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt, rSh.LeaveSelFrmMode(); rSh.UnSelectFrm(); rSh.ShowCrsr(); - bFrmDrag = FALSE; + bFrmDrag = sal_False; } } } @@ -3351,14 +3351,14 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt, return 0; if( rSrcSh.IsTableMode() ) - bTblSel = TRUE; + bTblSel = sal_True; else if( rSrcSh.IsSelFrmMode() || rSrcSh.IsObjSelected() ) { // keine positionsgeschuetzten Objecte verschieben! if( bMove && rSrcSh.IsSelObjProtected( FLYPROTECT_POS ) ) return 0; - bFrmSel = TRUE; + bFrmSel = sal_True; } const int nSel = rSrcSh.GetSelectionType(); @@ -3380,8 +3380,8 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt, if( &rSrcSh != &rSh ) { rSh.EnterStdMode(); - rSh.SwCrsrShell::SetCrsr( rDragPt, TRUE ); - cWord = rSrcSh.IntelligentCut( nSel, FALSE ); + rSh.SwCrsrShell::SetCrsr( rDragPt, sal_True ); + cWord = rSrcSh.IntelligentCut( nSel, sal_False ); } else if( !bTblSel && !bFrmSel ) { @@ -3396,9 +3396,9 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt, // <-- rSh.SwCrsrShell::CreateCrsr(); } - rSh.SwCrsrShell::SetCrsr( rDragPt, TRUE, false ); + rSh.SwCrsrShell::SetCrsr( rDragPt, sal_True, false ); rSh.GoPrevCrsr(); - cWord = rSh.IntelligentCut( rSh.GetSelectionType(), FALSE ); + cWord = rSh.IntelligentCut( rSh.GetSelectionType(), sal_False ); rSh.GoNextCrsr(); } @@ -3415,13 +3415,13 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt, if( &rSrcSh == &rSh ) { rSh.GoPrevCrsr(); - rSh.SwCrsrShell::SetCrsr( aSttPt, TRUE ); + rSh.SwCrsrShell::SetCrsr( aSttPt, sal_True ); rSh.SelectTxtAttr( RES_TXTATR_INETFMT ); if( rSh.ChgCurrPam( rDragPt ) ) { // nicht in sich selbst kopieren/verschieben rSh.DestroyCrsr(); - rSh.EndUndo( eUndoId ); + rSh.EndUndo(); rSh.EndAction(); rSh.EndAction(); return 0; @@ -3430,14 +3430,14 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt, } else { - rSrcSh.SwCrsrShell::SetCrsr( aSttPt, TRUE ); + rSrcSh.SwCrsrShell::SetCrsr( aSttPt, sal_True ); rSrcSh.SelectTxtAttr( RES_TXTATR_INETFMT ); } // ist am Einfuege Punkt ein URL-Attribut? Dann das ersetzen, // also einfach eine Selektion aufspannen? rSh.DelINetAttrWithText(); - bDDINetAttr = TRUE; + bDDINetAttr = sal_True; } if ( rSrcSh.IsSelFrmMode() ) @@ -3446,7 +3446,7 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt, aSttPt -= aSttPt - rSrcSh.GetObjRect().Pos(); } - BOOL bRet = rSrcSh.SwFEShell::Copy( &rSh, aSttPt, rDragPt, bMove, + sal_Bool bRet = rSrcSh.SwFEShell::Copy( &rSh, aSttPt, rDragPt, bMove, !bIsXSelection ); if( !bIsXSelection ) @@ -3464,14 +3464,14 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt, //SmartCut, eines der Blank mitnehmen. rSh.SwCrsrShell::DestroyCrsr(); if ( cWord == SwWrtShell::WORD_SPACE_BEFORE ) - rSh.ExtendSelection( FALSE ); + rSh.ExtendSelection( sal_False ); else if ( cWord == SwWrtShell::WORD_SPACE_AFTER ) rSh.ExtendSelection(); rSrcSh.DelRight(); } } rSrcSh.KillPams(); - rSrcSh.Pop( FALSE ); + rSrcSh.Pop( sal_False ); /* #109590# after dragging a table selection inside one shell set cursor to the drop position. */ @@ -3529,8 +3529,8 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt, rSrcSh.LeaveSelFrmMode(); if( rSrcSh.GetDoc() != rSh.GetDoc() ) - rSrcSh.EndUndo( eUndoId ); - rSh.EndUndo( eUndoId ); + rSrcSh.EndUndo(); + rSh.EndUndo(); // Shell in den richtigen Status versetzen if( &rSrcSh != &rSh && ( rSh.IsFrmSelected() || rSh.IsObjSelected() )) @@ -3622,7 +3622,7 @@ SwTransferable* SwTransferable::GetSwTransferable( const TransferableDataHelper& SwTrnsfrDdeLink::SwTrnsfrDdeLink( SwTransferable& rTrans, SwWrtShell& rSh ) : rTrnsfr( rTrans ), pDocShell( 0 ), - bDelBookmrk( FALSE ), bInDisconnect( FALSE ) + bDelBookmrk( sal_False ), bInDisconnect( sal_False ) { // hier kommen wir nur bei Tabellen- oder Text-Selection an const int nSelection = rSh.GetSelectionType(); @@ -3635,9 +3635,9 @@ SwTrnsfrDdeLink::SwTrnsfrDdeLink( SwTransferable& rTrans, SwWrtShell& rSh ) else { // creating a temp. bookmark without undo - BOOL bUndo = rSh.DoesUndo(); - rSh.DoUndo( FALSE ); - BOOL bIsModified = rSh.IsModified(); + sal_Bool bUndo = rSh.DoesUndo(); + rSh.DoUndo( sal_False ); + sal_Bool bIsModified = rSh.IsModified(); ::sw::mark::IMark* pMark = rSh.SetBookmark( KeyCode(), @@ -3647,7 +3647,7 @@ SwTrnsfrDdeLink::SwTrnsfrDdeLink( SwTransferable& rTrans, SwWrtShell& rSh ) if(pMark) { sName = pMark->GetName(); - bDelBookmrk = TRUE; + bDelBookmrk = sal_True; if( !bIsModified ) rSh.ResetModified(); } @@ -3680,7 +3680,7 @@ SwTrnsfrDdeLink::SwTrnsfrDdeLink( SwTransferable& rTrans, SwWrtShell& rSh ) SwTrnsfrDdeLink::~SwTrnsfrDdeLink() { if( refObj.Is() ) - Disconnect( TRUE ); + Disconnect( sal_True ); } // ----------------------------------------------------------------------- @@ -3693,16 +3693,16 @@ void SwTrnsfrDdeLink::DataChanged( const String& , { if( FindDocShell() && pDocShell->GetView() ) rTrnsfr.RemoveDDELinkFormat( pDocShell->GetView()->GetEditWin() ); - Disconnect( FALSE ); + Disconnect( sal_False ); } } // ----------------------------------------------------------------------- -BOOL SwTrnsfrDdeLink::WriteData( SvStream& rStrm ) +sal_Bool SwTrnsfrDdeLink::WriteData( SvStream& rStrm ) { if( !refObj.Is() || !FindDocShell() ) - return FALSE; + return sal_False; rtl_TextEncoding eEncoding = DDE_TXT_ENCODING; const ByteString aAppNm( GetpApp()->GetAppName(), eEncoding ); @@ -3771,27 +3771,26 @@ BOOL SwTrnsfrDdeLink::WriteData( SvStream& rStrm ) // ----------------------------------------------------------------------- -void SwTrnsfrDdeLink::Disconnect( BOOL bRemoveDataAdvise ) +void SwTrnsfrDdeLink::Disconnect( sal_Bool bRemoveDataAdvise ) { //JP 29.01.96 Bug 24432: // kein DataChanged mehr entgegen nehmen, wenn man // sich schon im Disconnet befindet! // (DTOR vom Bookmark verschickt einen DataChanged!) - BOOL bOldDisconnect = bInDisconnect; - bInDisconnect = TRUE; + sal_Bool bOldDisconnect = bInDisconnect; + bInDisconnect = sal_True; // den nicht verwendeten Bookmark wieder zerstoeren (ohne Undo!)? if( bDelBookmrk && refObj.Is() && FindDocShell() ) { SwDoc* pDoc = pDocShell->GetDoc(); - BOOL bUndo = pDoc->DoesUndo(); - pDoc->DoUndo( FALSE ); + ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo()); // --> OD, CD, OS 2005-11-25 #i58448# Link aSavedOle2Link( pDoc->GetOle2Link() ); pDoc->SetOle2Link( Link() ); // <-- - BOOL bIsModified = pDoc->IsModified(); + sal_Bool bIsModified = pDoc->IsModified(); IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess(); pMarkAccess->deleteMark(pMarkAccess->findMark(sName)); @@ -3802,8 +3801,7 @@ void SwTrnsfrDdeLink::Disconnect( BOOL bRemoveDataAdvise ) pDoc->SetOle2Link( aSavedOle2Link ); // <-- - pDoc->DoUndo( bUndo ); - bDelBookmrk = FALSE; + bDelBookmrk = sal_False; } if( refObj.Is() ) @@ -3823,7 +3821,7 @@ void SwTrnsfrDdeLink::Disconnect( BOOL bRemoveDataAdvise ) // ----------------------------------------------------------------------- -BOOL SwTrnsfrDdeLink::FindDocShell() +sal_Bool SwTrnsfrDdeLink::FindDocShell() { TypeId aType( TYPE( SwDocShell ) ); SfxObjectShell* pTmpSh = SfxObjectShell::GetFirst( &aType ); @@ -3832,14 +3830,14 @@ BOOL SwTrnsfrDdeLink::FindDocShell() if( pTmpSh == pDocShell ) // die wollen wir haben { if( pDocShell->GetDoc() ) - return TRUE; + return sal_True; break; // das Doc ist nicht mehr vorhanden, also raus! } pTmpSh = SfxObjectShell::GetNext( *pTmpSh, &aType ); } pDocShell = 0; - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- |