summaryrefslogtreecommitdiff
path: root/sw/source/ui/dochdl/swdtflvr.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/ui/dochdl/swdtflvr.cxx')
-rw-r--r--sw/source/ui/dochdl/swdtflvr.cxx392
1 files changed, 195 insertions, 197 deletions
diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx
index b13edbfa26cc..e10f4b61751b 100644
--- a/sw/source/ui/dochdl/swdtflvr.cxx
+++ b/sw/source/ui/dochdl/swdtflvr.cxx
@@ -89,6 +89,7 @@
#include <shellio.hxx>
#include <ddefld.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pagedesc.hxx>
#include <IMark.hxx>
#include <docary.hxx>
@@ -133,15 +134,14 @@
// #109590#
#include <swcrsr.hxx>
#include <SwRewriter.hxx>
-#include <undobj.hxx>
#include <globals.hrc>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <swserv.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
@@ -188,11 +188,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;
@@ -206,9 +206,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
@@ -219,7 +219,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 );
@@ -229,7 +229,7 @@ public:
}
~SwTrnsfrActionAndUndo()
{
- pSh->EndUndo( eUndoId );
+ pSh->EndUndo();
pSh->EndAllAction();
}
};
@@ -271,7 +271,7 @@ SwTransferable::~SwTransferable()
// the DDELink still needs the WrtShell!
if( refDdeLink.Is() )
{
- ((SwTrnsfrDdeLink*)&refDdeLink)->Disconnect( TRUE );
+ ((SwTrnsfrDdeLink*)&refDdeLink)->Disconnect( sal_True );
refDdeLink.Clear();
}
@@ -432,14 +432,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(); // never update fields - leave text as it is
pWrtShell->Copy( pTmpDoc );
// in CORE a new one was created (OLE-Objekte copied!)
+ aDocShellRef = pTmpDoc->GetTmpDocShell();
if( aDocShellRef.Is() )
SwTransferable::InitOle( aDocShellRef, *pTmpDoc );
- pTmpDoc->SetRefForDocShell( 0 );
+ pTmpDoc->SetTmpDocShell( (SfxObjectShell*)NULL );
if( nSelectionType & nsSelectionType::SEL_TXT && !pWrtShell->HasMark() )
{
@@ -447,7 +447,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 ) )
@@ -661,7 +661,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 );
@@ -676,7 +676,7 @@ sal_Bool SwTransferable::WriteObject( SotStorageStreamRef& xStream,
delete pSrcStm;
}
- bRet = TRUE;
+ bRet = sal_True;
xWorkStore->dispose();
xWorkStore = uno::Reference < embed::XStorage >();
@@ -719,7 +719,7 @@ sal_Bool SwTransferable::WriteObject( SotStorageStreamRef& xStream,
xWrt->SetAsciiOptions( aAOpt );
// no start char for clipboard
- xWrt->bUCS2_WithStartChar = FALSE;
+ xWrt->bUCS2_WithStartChar = sal_False;
}
break;
}
@@ -727,9 +727,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 )) )
{
@@ -744,7 +744,7 @@ sal_Bool SwTransferable::WriteObject( SotStorageStreamRef& xStream,
int SwTransferable::Cut()
{
- int nRet = Copy( TRUE );
+ int nRet = Copy( sal_True );
if( nRet )
DeleteSelection();
return nRet;
@@ -763,7 +763,7 @@ void SwTransferable::DeleteSelection()
pWrtShell->EndUndo( UNDO_DELETE );
}
-int SwTransferable::PrepareForCopy( BOOL bIsCut )
+int SwTransferable::PrepareForCopy( sal_Bool bIsCut )
{
int nRet = 1;
if(!pWrtShell)
@@ -821,7 +821,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;
@@ -834,7 +834,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 );
@@ -857,16 +856,17 @@ int SwTransferable::PrepareForCopy( BOOL bIsCut )
}
// a new one was created in CORE (OLE-Objekte copied!)
+ 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);
}
@@ -934,7 +934,7 @@ int SwTransferable::PrepareForCopy( BOOL bIsCut )
//ObjectDescriptor was already filly from the old DocShell.
//Now adjust it. Thus in GetData the first query can still
//be answered with delayed rendering.
- aObjDesc.mbCanLink = FALSE;
+ aObjDesc.mbCanLink = sal_False;
Size aSz( OLESIZE );
aObjDesc.maSize = OutputDevice::LogicToLogic( aSz, MAP_TWIP, MAP_100TH_MM );
@@ -968,7 +968,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 )
@@ -982,7 +982,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() );
@@ -1002,7 +1002,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);
@@ -1012,15 +1012,15 @@ int SwTransferable::CopyGlossary( SwTextBlocks& rGlossary,
SwCntntNode* pCNd = rNds.GoNext( &aNodeIdx ); // go to 1st ContentNode
SwPaM aPam( *pCNd );
- pCDoc->SetRefForDocShell( boost::addressof(aDocShellRef) );
pCDoc->LockExpFlds(); // never update fields - leave text as it is
pCDoc->InsertGlossary( rGlossary, rStr, aPam, 0 );
// a new one was created in CORE (OLE-Objects copied!)
+ aDocShellRef = pCDoc->GetTmpDocShell();
if( aDocShellRef.Is() )
SwTransferable::InitOle( aDocShellRef, *pCDoc );
- pCDoc->SetRefForDocShell( 0 );
+ pCDoc->SetTmpDocShell( (SfxObjectShell*)NULL );
eBufferType = TRNSFR_DOCUMENT;
@@ -1033,7 +1033,7 @@ int SwTransferable::CopyGlossary( SwTextBlocks& rGlossary,
//ObjectDescriptor was already filled from the old DocShell.
//Now adjust it. Thus in GetData the first query can still
//be answered with delayed rendering.
- aObjDesc.mbCanLink = FALSE;
+ aObjDesc.mbCanLink = sal_False;
Size aSz( OLESIZE );
aObjDesc.maSize = OutputDevice::LogicToLogic( aSz, MAP_TWIP, MAP_100TH_MM );
@@ -1050,7 +1050,7 @@ static inline uno::Reference < XTransferable > * lcl_getTransferPointer ( uno::R
return &xRef;
}
-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!
@@ -1065,8 +1065,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 ||
@@ -1074,9 +1074,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, /* ?? */
@@ -1093,9 +1093,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 ) )
{
@@ -1103,7 +1103,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 ||
@@ -1132,18 +1132,18 @@ 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();
@@ -1166,11 +1166,11 @@ int SwTransferable::PasteData( TransferableDataHelper& rData,
case EXCHG_DEST_DOC_URLBUTTON:
case EXCHG_DEST_DOC_GROUPOBJ:
// select frames/objects
- SwTransferable::SetSelInShell( rSh, TRUE, pPt );
+ SwTransferable::SetSelInShell( rSh, sal_True, pPt );
break;
default:
- SwTransferable::SetSelInShell( rSh, FALSE, pPt );
+ SwTransferable::SetSelInShell( rSh, sal_False, pPt );
break;
}
}
@@ -1185,21 +1185,21 @@ int SwTransferable::PasteData( TransferableDataHelper& rData,
// - at ReRead of a graphic/DDEData
// - at D&D, for the right selection was taken care of
// in Drop-Handler
- 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 )
// #i34830#
pAction = new SwTrnsfrActionAndUndo( &rSh, UNDO_PASTE_CLIPBOARD, NULL,
- TRUE );
+ sal_True );
}
SwTransferable *pTrans=0, *pTunneledTrans=GetSwTransferable( rData );
@@ -1225,10 +1225,10 @@ int SwTransferable::PasteData( TransferableDataHelper& rData,
}
// in Drag&Drop MessageBoxes must not be showed
- 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 );
// delete selections
switch( nClearedAction )
@@ -1348,7 +1348,7 @@ int SwTransferable::PasteData( TransferableDataHelper& rData,
case SOT_FORMATSTR_ID_NETSCAPE_IMAGE:
nRet = SwTransferable::_PasteTargetURL( rData, rSh,
SW_PASTESDR_INSERT,
- pPt, TRUE );
+ pPt, sal_True );
break;
default:
@@ -1371,7 +1371,7 @@ int SwTransferable::PasteData( TransferableDataHelper& rData,
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;
@@ -1486,10 +1486,10 @@ int SwTransferable::PasteData( TransferableDataHelper& rData,
return nRet;
}
-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 )
@@ -1504,7 +1504,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();
@@ -1557,9 +1557,9 @@ USHORT SwTransferable::GetSotDestination( const SwWrtShell& rSh,
}
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;
@@ -1600,9 +1600,9 @@ int SwTransferable::_PasteFileContent( TransferableDataHelper& rData,
{
pStream = aMSE40ClpObj.IsValid( *xStrm );
pRead = ReadHTML;
- pRead->SetReadUTF8( TRUE );
+ pRead->SetReadUTF8( sal_True );
- BOOL bNoComments =
+ sal_Bool bNoComments =
( nFmt == SOT_FORMATSTR_ID_HTML_NO_COMMENT );
pRead->SetIgnoreHTMLComments( bNoComments );
}
@@ -1614,7 +1614,7 @@ int SwTransferable::_PasteFileContent( TransferableDataHelper& rData,
else if( !pRead )
{
pRead = ReadHTML;
- pRead->SetReadUTF8( TRUE );
+ pRead->SetReadUTF8( sal_True );
}
}
}
@@ -1651,7 +1651,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;
@@ -1774,7 +1774,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;
// insert replacement image ( if there is one ) into the object helper
if ( nGrFormat )
@@ -1850,7 +1850,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 );
@@ -1860,8 +1860,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;
@@ -1884,7 +1884,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;
@@ -1893,7 +1893,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 );
@@ -1906,7 +1906,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;
@@ -1928,7 +1928,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 );
@@ -1937,7 +1937,7 @@ int SwTransferable::_PasteTargetURL( TransferableDataHelper& rData,
return nRet;
}
-void SwTransferable::SetSelInShell( SwWrtShell& rSh, BOOL bSelectFrm,
+void SwTransferable::SetSelInShell( SwWrtShell& rSh, sal_Bool bSelectFrm,
const Point* pPt )
{
if( bSelectFrm )
@@ -1950,7 +1950,7 @@ void SwTransferable::SetSelInShell( SwWrtShell& rSh, BOOL bSelectFrm,
{
rSh.HideCrsr();
rSh.EnterSelFrmMode( pPt );
- bFrmDrag = TRUE;
+ bFrmDrag = sal_True;
}
}
}
@@ -1961,20 +1961,20 @@ 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 )
{
// data from Clipboardformat
String aApp, aTopic, aItem;
@@ -1997,7 +1997,7 @@ int SwTransferable::_PasteDDE( TransferableDataHelper& rData,
sfx2::MakeLnkName( aCmd, &aApp, aTopic, aItem );
// do we want to read in a graphic now?
- ULONG nFormat;
+ sal_uLong nFormat;
if( !rData.HasFormat( FORMAT_RTF ) &&
!rData.HasFormat( SOT_FORMATSTR_ID_HTML ) &&
!rData.HasFormat( FORMAT_STRING ) &&
@@ -2019,10 +2019,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 {
@@ -2038,7 +2038,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() ) )
@@ -2046,10 +2046,10 @@ int SwTransferable::_PasteDDE( TransferableDataHelper& rData,
}
}
if( j == nSize )
- bAlreadyThere = FALSE;
+ bAlreadyThere = sal_False;
else
{
- bAlreadyThere = TRUE;
+ bAlreadyThere = sal_True;
i++;
}
}
@@ -2116,7 +2116,7 @@ int SwTransferable::_PasteDDE( TransferableDataHelper& rData,
rWrtShell.Insert( aSwDDEField );
}
- } while( FALSE );
+ } while( sal_False );
}
else
pDDETyp = 0; // remove FieldTypes again
@@ -2136,8 +2136,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;
@@ -2149,20 +2149,20 @@ 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;
}
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 )
{
@@ -2179,7 +2179,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;
@@ -2194,7 +2194,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;
}
}
@@ -2218,7 +2218,7 @@ int SwTransferable::_PasteGrf( TransferableDataHelper& rData, SwWrtShell& rSh,
{
// then set as hyperlink after the graphic
nFmt = SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK;
- nRet = TRUE;
+ nRet = sal_True;
}
}
@@ -2231,7 +2231,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;
@@ -2240,7 +2240,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 );
@@ -2254,7 +2254,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 );
}
@@ -2265,7 +2265,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;
@@ -2284,14 +2284,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 )
{
// or should the file be an ImageMap-File?
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() &&
@@ -2338,7 +2338,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;
@@ -2362,7 +2362,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 );
@@ -2376,15 +2376,15 @@ int SwTransferable::_PasteAsHyperlink( TransferableDataHelper& rData,
sDesc.Len() ? sDesc : sFile );
}
}
- nRet = TRUE;
+ nRet = sal_True;
}
return nRet;
}
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 );
@@ -2409,7 +2409,7 @@ int SwTransferable::_PasteFileName( TransferableDataHelper& rData,
}
else
{
- BOOL bIsURLFile = SwTransferable::_CheckForURLOrLNKFile( rData, sFile, &sDesc );
+ sal_Bool bIsURLFile = SwTransferable::_CheckForURLOrLNKFile( rData, sFile, &sDesc );
//Own FileFormat? --> insert, not for StarWriter/Web
String sFileURL = URIHelper::SmartRel2Abs(INetURLObject(), sFile, Link(), false );
@@ -2449,7 +2449,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 );
@@ -2463,7 +2463,7 @@ int SwTransferable::_PasteFileName( TransferableDataHelper& rData,
sDesc.Len() ? sDesc : sFile );
}
}
- nRet = TRUE;
+ nRet = sal_True;
}
}
}
@@ -2472,14 +2472,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
@@ -2514,14 +2514,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 )
{
@@ -2574,30 +2574,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;
}
@@ -2612,17 +2612,17 @@ int SwTransferable::_PasteFileList( TransferableDataHelper& rData,
return nRet;
}
-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
{
@@ -2639,7 +2639,7 @@ BOOL SwTransferable::_CheckForURLOrLNKFile( TransferableDataHelper& rData,
return bIsURLFile;
}
-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
@@ -2650,12 +2650,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 ))
@@ -2666,7 +2666,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 ||
@@ -2685,15 +2685,15 @@ 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;
}
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(
@@ -2710,7 +2710,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,
@@ -2734,7 +2734,7 @@ int SwTransferable::PasteUnformatted( SwWrtShell& rSh, TransferableDataHelper& r
return SwTransferable::PasteFormat( rSh, rData, SOT_FORMAT_STRING );
}
-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();
@@ -2743,13 +2743,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 )
@@ -2789,11 +2789,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 );
@@ -2809,12 +2809,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 )
@@ -2853,7 +2853,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 );
}
@@ -2894,7 +2894,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);
}
@@ -2947,7 +2947,7 @@ void SwTransferable::SetDataForDragAndDrop( const Point& rSttPos )
//ObjectDescriptor was already filled from the old DocShell.
//Now adjust it. Thus in GetData the first query can still
//be answered with delayed rendering.
- aObjDesc.mbCanLink = FALSE;
+ aObjDesc.mbCanLink = sal_False;
aObjDesc.maDragStartPos = rSttPos;
aObjDesc.maSize = OutputDevice::LogicToLogic( Size( OLESIZE ),
MAP_TWIP, MAP_100TH_MM );
@@ -2997,9 +2997,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();
@@ -3034,7 +3034,7 @@ void SwTransferable::DragFinished( sal_Int8 nAction )
{
if ( !(pWrtShell->IsSelFrmMode() || pWrtShell->IsObjSelected()) )
//SmartCut, take one of the blanks along
- pWrtShell->IntelligentCut( pWrtShell->GetSelectionType(), TRUE );
+ pWrtShell->IntelligentCut( pWrtShell->GetSelectionType(), sal_True );
pWrtShell->DelRight();
}
pWrtShell->EndUndo( UNDO_UI_DRAG_AND_MOVE );
@@ -3066,7 +3066,7 @@ int SwTransferable::PrivatePaste( SwWrtShell& rShell )
// (otherwise it's not pasted into a TableSelection!!!)
OSL_ENSURE( !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();
@@ -3090,12 +3090,12 @@ int SwTransferable::PrivatePaste( SwWrtShell& rShell )
{
// position the cursor again
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 )
{
@@ -3126,15 +3126,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();
@@ -3153,7 +3153,7 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt,
{
rSh.HideCrsr();
rSh.EnterSelFrmMode( &rDragPt );
- bFrmDrag = TRUE;
+ bFrmDrag = sal_True;
}
const int nSelection = rSh.GetSelectionType();
@@ -3164,7 +3164,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;
@@ -3175,7 +3175,7 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt,
rSh.LeaveSelFrmMode();
rSh.UnSelectFrm();
rSh.ShowCrsr();
- bFrmDrag = FALSE;
+ bFrmDrag = sal_False;
}
}
}
@@ -3196,14 +3196,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() )
{
// don't move position-protected objects!
if( bMove && rSrcSh.IsSelObjProtected( FLYPROTECT_POS ) )
return 0;
- bFrmSel = TRUE;
+ bFrmSel = sal_True;
}
const int nSel = rSrcSh.GetSelectionType();
@@ -3224,8 +3224,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 )
{
@@ -3240,9 +3240,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();
}
@@ -3259,13 +3259,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 ) )
{
// don't copy/move inside of yourself
rSh.DestroyCrsr();
- rSh.EndUndo( eUndoId );
+ rSh.EndUndo();
rSh.EndAction();
rSh.EndAction();
return 0;
@@ -3274,14 +3274,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 );
}
// is there an URL attribute at the insert point? Then replace that,
// so simply put up a selection?
rSh.DelINetAttrWithText();
- bDDINetAttr = TRUE;
+ bDDINetAttr = sal_True;
}
if ( rSrcSh.IsSelFrmMode() )
@@ -3290,7 +3290,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 )
@@ -3308,14 +3308,14 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt,
//SmartCut, take one of the blanks along.
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 );
/* after dragging a table selection inside one shell
set cursor to the drop position. */
@@ -3373,8 +3373,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();
// put the shell in the right state
if( &rSrcSh != &rSh && ( rSh.IsFrmSelected() || rSh.IsObjSelected() ))
@@ -3456,7 +3456,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 )
{
// we only end up here with table- or text selection
const int nSelection = rSh.GetSelectionType();
@@ -3469,9 +3469,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(),
@@ -3481,7 +3481,7 @@ SwTrnsfrDdeLink::SwTrnsfrDdeLink( SwTransferable& rTrans, SwWrtShell& rSh )
if(pMark)
{
sName = pMark->GetName();
- bDelBookmrk = TRUE;
+ bDelBookmrk = sal_True;
if( !bIsModified )
rSh.ResetModified();
}
@@ -3510,7 +3510,7 @@ SwTrnsfrDdeLink::SwTrnsfrDdeLink( SwTransferable& rTrans, SwWrtShell& rSh )
SwTrnsfrDdeLink::~SwTrnsfrDdeLink()
{
if( refObj.Is() )
- Disconnect( TRUE );
+ Disconnect( sal_True );
}
void SwTrnsfrDdeLink::DataChanged( const String& ,
@@ -3521,14 +3521,14 @@ 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 );
@@ -3589,25 +3589,24 @@ BOOL SwTrnsfrDdeLink::WriteData( SvStream& rStrm )
return true;
}
-void SwTrnsfrDdeLink::Disconnect( BOOL bRemoveDataAdvise )
+void SwTrnsfrDdeLink::Disconnect( sal_Bool bRemoveDataAdvise )
{
// don't accept DataChanged anymore, when already in Disconnect!
// (DTOR from Bookmark sends a DataChanged!)
- BOOL bOldDisconnect = bInDisconnect;
- bInDisconnect = TRUE;
+ sal_Bool bOldDisconnect = bInDisconnect;
+ bInDisconnect = sal_True;
// destroy the unused bookmark again (without Undo!)?
if( bDelBookmrk && refObj.Is() && FindDocShell() )
{
SwDoc* pDoc = pDocShell->GetDoc();
- BOOL bUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
// #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));
@@ -3617,8 +3616,7 @@ void SwTrnsfrDdeLink::Disconnect( BOOL bRemoveDataAdvise )
// #i58448#
pDoc->SetOle2Link( aSavedOle2Link );
- pDoc->DoUndo( bUndo );
- bDelBookmrk = FALSE;
+ bDelBookmrk = sal_False;
}
if( refObj.Is() )
@@ -3636,7 +3634,7 @@ void SwTrnsfrDdeLink::Disconnect( BOOL bRemoveDataAdvise )
bInDisconnect = bOldDisconnect;
}
-BOOL SwTrnsfrDdeLink::FindDocShell()
+sal_Bool SwTrnsfrDdeLink::FindDocShell()
{
TypeId aType( TYPE( SwDocShell ) );
SfxObjectShell* pTmpSh = SfxObjectShell::GetFirst( &aType );
@@ -3645,14 +3643,14 @@ BOOL SwTrnsfrDdeLink::FindDocShell()
if( pTmpSh == pDocShell ) // that's what we want to have
{
if( pDocShell->GetDoc() )
- return TRUE;
+ return sal_True;
break; // the Doc is not there anymore, so leave!
}
pTmpSh = SfxObjectShell::GetNext( *pTmpSh, &aType );
}
pDocShell = 0;
- return FALSE;
+ return sal_False;
}
void SwTrnsfrDdeLink::Closed()