summaryrefslogtreecommitdiff
path: root/sw/source/ui/dochdl
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2011-03-18 15:59:29 +0100
committerJan Holesovsky <kendy@suse.cz>2011-03-18 15:59:29 +0100
commit5a267de99f19bdab857429a81ffcfbb4d06f5bbd (patch)
tree1425ce2404af0e2542e1be0dca3821600f5b82a8 /sw/source/ui/dochdl
parent3bb681a344beb911d92b48469afbd0ccc51db1dd (diff)
parent99ebfb7335c333a77910b1059b7b41fb34ff0899 (diff)
Merge remote-tracking branch 'origin/integration/dev300_m101'
Conflicts: starmath/source/symbol.cxx sw/source/core/doc/docnew.cxx sw/source/core/doc/docnum.cxx sw/source/core/draw/dview.cxx sw/source/core/fields/docufld.cxx sw/source/core/layout/calcmove.cxx sw/source/filter/html/swhtml.cxx sw/source/filter/rtf/rtftbl.cxx sw/source/ui/config/modcfg.cxx sw/source/ui/dialog/docstdlg.cxx sw/source/ui/dialog/docstdlg.src sw/source/ui/fldui/flddb.cxx sw/source/ui/fldui/flddinf.cxx sw/source/ui/fldui/flddok.cxx sw/source/ui/fldui/fldfunc.cxx sw/source/ui/fldui/fldmgr.cxx sw/source/ui/fldui/fldpage.hxx sw/source/ui/fldui/fldref.cxx sw/source/ui/fldui/fldvar.cxx sw/source/ui/fldui/fldvar.hxx sw/source/ui/fldui/fldwrap.cxx sw/source/ui/fldui/xfldui.cxx sw/source/ui/inc/docstdlg.hxx sw/source/ui/shells/langhelper.cxx sw/source/ui/shells/txtattr.cxx sw/source/ui/shells/txtcrsr.cxx sw/source/ui/table/tabledlg.cxx
Diffstat (limited to 'sw/source/ui/dochdl')
-rw-r--r--sw/source/ui/dochdl/gloshdl.cxx182
-rw-r--r--sw/source/ui/dochdl/makefile.mk65
-rw-r--r--sw/source/ui/dochdl/selglos.src3
-rw-r--r--sw/source/ui/dochdl/swdtflvr.cxx392
4 files changed, 288 insertions, 354 deletions
diff --git a/sw/source/ui/dochdl/gloshdl.cxx b/sw/source/ui/dochdl/gloshdl.cxx
index e2b5afc9e020..23d54bfa0d80 100644
--- a/sw/source/ui/dochdl/gloshdl.cxx
+++ b/sw/source/ui/dochdl/gloshdl.cxx
@@ -123,7 +123,7 @@ void SwGlossaryHdl::GlossaryDlg()
Description: set the default group; if called from the dialog
the group is created temporarily for faster access
------------------------------------------------------------------------*/
-void SwGlossaryHdl::SetCurGroup(const String &rGrp, BOOL bApi, BOOL bAlwaysCreateNew )
+void SwGlossaryHdl::SetCurGroup(const String &rGrp, sal_Bool bApi, sal_Bool bAlwaysCreateNew )
{
String sGroup(rGrp);
if(STRING_NOTFOUND == sGroup.Search(GLOS_DELIM) && !FindGroupName(sGroup))
@@ -133,7 +133,7 @@ void SwGlossaryHdl::SetCurGroup(const String &rGrp, BOOL bApi, BOOL bAlwaysCreat
}
if(pCurGrp)
{
- BOOL bPathEqual = FALSE;
+ sal_Bool bPathEqual = sal_False;
if(!bAlwaysCreateNew)
{
INetURLObject aTemp( pCurGrp->GetFileName() );
@@ -141,8 +141,8 @@ void SwGlossaryHdl::SetCurGroup(const String &rGrp, BOOL bApi, BOOL bAlwaysCreat
aTemp.removeSegment();
const String sCurEntryPath = aTemp.GetMainURL(INetURLObject::NO_DECODE);
const SvStrings* pPathArr = rStatGlossaries.GetPathArray();
- USHORT nCurrentPath = USHRT_MAX;
- for(USHORT nPath = 0; nPath < pPathArr->Count(); nPath++)
+ sal_uInt16 nCurrentPath = USHRT_MAX;
+ for(sal_uInt16 nPath = 0; nPath < pPathArr->Count(); nPath++)
{
if(sCurEntryPath == *(*pPathArr)[nPath])
{
@@ -151,10 +151,10 @@ void SwGlossaryHdl::SetCurGroup(const String &rGrp, BOOL bApi, BOOL bAlwaysCreat
}
}
String sPath = sGroup.GetToken(1, GLOS_DELIM);
- USHORT nComparePath = (USHORT)sPath.ToInt32();
+ sal_uInt16 nComparePath = (sal_uInt16)sPath.ToInt32();
if(nCurrentPath == nComparePath &&
sGroup.GetToken(0, GLOS_DELIM) == sCurBase)
- bPathEqual = TRUE;
+ bPathEqual = sal_True;
}
// When path changed, the name is not reliable
@@ -169,21 +169,21 @@ void SwGlossaryHdl::SetCurGroup(const String &rGrp, BOOL bApi, BOOL bAlwaysCreat
rStatGlossaries.PutGroupDoc(pCurGrp);
pCurGrp = 0;
}
- pCurGrp = rStatGlossaries.GetGroupDoc(aCurGrp, TRUE);
+ pCurGrp = rStatGlossaries.GetGroupDoc(aCurGrp, sal_True);
}
}
-USHORT SwGlossaryHdl::GetGroupCnt() const
+sal_uInt16 SwGlossaryHdl::GetGroupCnt() const
{
return rStatGlossaries.GetGroupCnt();
}
-String SwGlossaryHdl::GetGroupName( USHORT nId, String* pTitle )
+String SwGlossaryHdl::GetGroupName( sal_uInt16 nId, String* pTitle )
{
String sRet = rStatGlossaries.GetGroupName(nId);
if(pTitle)
{
- SwTextBlocks* pGroup = rStatGlossaries.GetGroupDoc(sRet, FALSE);
+ SwTextBlocks* pGroup = rStatGlossaries.GetGroupDoc(sRet, sal_False);
if(pGroup && !pGroup->GetError())
{
*pTitle = pGroup->GetName();
@@ -200,27 +200,27 @@ String SwGlossaryHdl::GetGroupName( USHORT nId, String* pTitle )
return sRet;
}
-BOOL SwGlossaryHdl::NewGroup(String &rGrpName, const String& rTitle)
+sal_Bool SwGlossaryHdl::NewGroup(String &rGrpName, const String& rTitle)
{
if(STRING_NOTFOUND == rGrpName.Search(GLOS_DELIM))
FindGroupName(rGrpName);
return rStatGlossaries.NewGroupDoc(rGrpName, rTitle);
}
-BOOL SwGlossaryHdl::RenameGroup(const String & rOld, String& rNew, const String& rNewTitle)
+sal_Bool SwGlossaryHdl::RenameGroup(const String & rOld, String& rNew, const String& rNewTitle)
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
String sOldGroup(rOld);
if(STRING_NOTFOUND == rOld.Search(GLOS_DELIM))
FindGroupName(sOldGroup);
if(rOld == rNew)
{
- SwTextBlocks* pGroup = rStatGlossaries.GetGroupDoc(sOldGroup, FALSE);
+ SwTextBlocks* pGroup = rStatGlossaries.GetGroupDoc(sOldGroup, sal_False);
if(pGroup)
{
pGroup->SetName(rNewTitle);
rStatGlossaries.PutGroupDoc( pGroup );
- bRet = TRUE;
+ bRet = sal_True;
}
}
else
@@ -237,19 +237,19 @@ BOOL SwGlossaryHdl::RenameGroup(const String & rOld, String& rNew, const String&
return bRet;
}
-BOOL SwGlossaryHdl::CopyOrMove( const String& rSourceGroupName, String& rSourceShortName,
- const String& rDestGroupName, const String& rLongName, BOOL bMove )
+sal_Bool SwGlossaryHdl::CopyOrMove( const String& rSourceGroupName, String& rSourceShortName,
+ const String& rDestGroupName, const String& rLongName, sal_Bool bMove )
{
- SwTextBlocks* pSourceGroup = rStatGlossaries.GetGroupDoc(rSourceGroupName, FALSE);
+ SwTextBlocks* pSourceGroup = rStatGlossaries.GetGroupDoc(rSourceGroupName, sal_False);
- SwTextBlocks* pDestGroup = rStatGlossaries.GetGroupDoc(rDestGroupName, FALSE);
+ SwTextBlocks* pDestGroup = rStatGlossaries.GetGroupDoc(rDestGroupName, sal_False);
if(pDestGroup->IsReadOnly() || (bMove && pSourceGroup->IsReadOnly()) )
- return FALSE;
+ return sal_False;
//The index must be determined here because rSourceShortName maybe changed in CopyBlock
- USHORT nDeleteIdx = pSourceGroup->GetIndex( rSourceShortName );
+ sal_uInt16 nDeleteIdx = pSourceGroup->GetIndex( rSourceShortName );
OSL_ENSURE(USHRT_MAX != nDeleteIdx, "entry not found");
- ULONG nRet = pSourceGroup->CopyBlock( *pDestGroup, rSourceShortName, rLongName );
+ sal_uLong nRet = pSourceGroup->CopyBlock( *pDestGroup, rSourceShortName, rLongName );
if(!nRet && bMove)
{
// the index must be existing
@@ -263,7 +263,7 @@ BOOL SwGlossaryHdl::CopyOrMove( const String& rSourceGroupName, String& rSource
/*------------------------------------------------------------------------
Description: delete a autotext-file-group
------------------------------------------------------------------------*/
-BOOL SwGlossaryHdl::DelGroup(const String &rGrpName)
+sal_Bool SwGlossaryHdl::DelGroup(const String &rGrpName)
{
String sGroup(rGrpName);
if(STRING_NOTFOUND == sGroup.Search(GLOS_DELIM))
@@ -276,26 +276,26 @@ BOOL SwGlossaryHdl::DelGroup(const String &rGrpName)
if(aMac_Tmp == sGroup)
DELETEZ(pCurGrp);
}
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
/*------------------------------------------------------------------------
Description: ask for number of autotexts
------------------------------------------------------------------------*/
-USHORT SwGlossaryHdl::GetGlossaryCnt()
+sal_uInt16 SwGlossaryHdl::GetGlossaryCnt()
{
return pCurGrp ? pCurGrp->GetCount() : 0;
}
-String SwGlossaryHdl::GetGlossaryName( USHORT nId )
+String SwGlossaryHdl::GetGlossaryName( sal_uInt16 nId )
{
OSL_ENSURE(nId < GetGlossaryCnt(), "Textbausteinarray ueberindiziert.");
return pCurGrp->GetLongName( nId );
}
-String SwGlossaryHdl::GetGlossaryShortName(USHORT nId)
+String SwGlossaryHdl::GetGlossaryShortName(sal_uInt16 nId)
{
OSL_ENSURE(nId < GetGlossaryCnt(), "Textbausteinarray ueberindiziert.");
return pCurGrp->GetShortName( nId );
@@ -308,11 +308,11 @@ String SwGlossaryHdl::GetGlossaryShortName(const String &rName)
{
String sReturn;
SwTextBlocks *pTmp =
- pCurGrp ? pCurGrp: rStatGlossaries.GetGroupDoc( aCurGrp, FALSE );
+ pCurGrp ? pCurGrp: rStatGlossaries.GetGroupDoc( aCurGrp, sal_False );
if(pTmp)
{
- USHORT nIdx = pTmp->GetLongIndex( rName );
- if( nIdx != (USHORT) -1 )
+ sal_uInt16 nIdx = pTmp->GetLongIndex( rName );
+ if( nIdx != (sal_uInt16) -1 )
sReturn = pTmp->GetShortName( nIdx );
if( !pCurGrp )
rStatGlossaries.PutGroupDoc( pTmp );
@@ -323,79 +323,79 @@ String SwGlossaryHdl::GetGlossaryShortName(const String &rName)
/*------------------------------------------------------------------------
Description: short name for autotext already used?
------------------------------------------------------------------------*/
-BOOL SwGlossaryHdl::HasShortName(const String& rShortName) const
+sal_Bool SwGlossaryHdl::HasShortName(const String& rShortName) const
{
SwTextBlocks *pBlock = pCurGrp ? pCurGrp
: rStatGlossaries.GetGroupDoc( aCurGrp );
- BOOL bRet = pBlock->GetIndex( rShortName ) != (USHORT) -1;
+ sal_Bool bRet = pBlock->GetIndex( rShortName ) != (sal_uInt16) -1;
if( !pCurGrp )
rStatGlossaries.PutGroupDoc( pBlock );
return bRet;
}
-BOOL SwGlossaryHdl::ConvertToNew(SwTextBlocks& /*rOld*/)
+sal_Bool SwGlossaryHdl::ConvertToNew(SwTextBlocks& /*rOld*/)
{
- return TRUE;
+ return sal_True;
}
/*------------------------------------------------------------------------
Desription: Create autotext
------------------------------------------------------------------------*/
-BOOL SwGlossaryHdl::NewGlossary(const String& rName, const String& rShortName,
- BOOL bCreateGroup, BOOL bNoAttr)
+sal_Bool SwGlossaryHdl::NewGlossary(const String& rName, const String& rShortName,
+ sal_Bool bCreateGroup, sal_Bool bNoAttr)
{
SwTextBlocks *pTmp =
pCurGrp ? pCurGrp: rStatGlossaries.GetGroupDoc( aCurGrp, bCreateGroup );
//pTmp == 0 if the AutoText path setting is wrong
if(!pTmp)
- return FALSE;
+ return sal_False;
if(!ConvertToNew(*pTmp))
- return FALSE;
+ return sal_False;
String sOnlyTxt;
String* pOnlyTxt = 0;
if( bNoAttr )
{
if( !pWrtShell->GetSelectedText( sOnlyTxt, GETSELTXT_PARABRK_TO_ONLYCR ))
- return FALSE;
+ return sal_False;
pOnlyTxt = &sOnlyTxt;
}
const SvxAutoCorrCfg* pCfg = SvxAutoCorrCfg::Get();
- const USHORT nSuccess = pWrtShell->MakeGlossary( *pTmp, rName, rShortName,
+ const sal_uInt16 nSuccess = pWrtShell->MakeGlossary( *pTmp, rName, rShortName,
pCfg->IsSaveRelFile(), pOnlyTxt );
- if(nSuccess == (USHORT) -1 )
+ if(nSuccess == (sal_uInt16) -1 )
{
InfoBox(pWrtShell->GetView().GetWindow(), SW_RES(MSG_ERR_INSERT_GLOS)).Execute();
}
if( !pCurGrp )
rStatGlossaries.PutGroupDoc( pTmp );
- return BOOL( nSuccess != (USHORT) -1 );
+ return sal_Bool( nSuccess != (sal_uInt16) -1 );
}
/*------------------------------------------------------------------------
Description: Delete a autotext
------------------------------------------------------------------------*/
-BOOL SwGlossaryHdl::DelGlossary(const String &rShortName)
+sal_Bool SwGlossaryHdl::DelGlossary(const String &rShortName)
{
SwTextBlocks *pGlossary = pCurGrp ? pCurGrp
: rStatGlossaries.GetGroupDoc(aCurGrp);
//pTmp == 0 if the AutoText path setting is wrong
if(!pGlossary || !ConvertToNew(*pGlossary))
- return FALSE;
+ return sal_False;
- USHORT nIdx = pGlossary->GetIndex( rShortName );
- if( nIdx != (USHORT) -1 )
+ sal_uInt16 nIdx = pGlossary->GetIndex( rShortName );
+ if( nIdx != (sal_uInt16) -1 )
pGlossary->Delete( nIdx );
if( !pCurGrp )
rStatGlossaries.PutGroupDoc( pGlossary );
- return TRUE;
+ return sal_True;
}
/*------------------------------------------------------------------------
Description: expand short name
------------------------------------------------------------------------*/
-BOOL SwGlossaryHdl::ExpandGlossary()
+sal_Bool SwGlossaryHdl::ExpandGlossary()
{
OSL_ENSURE(pWrtShell->CanInsert(), "illegal");
SwTextBlocks *pGlossary;
@@ -429,37 +429,37 @@ BOOL SwGlossaryHdl::ExpandGlossary()
if(pWrtShell->IsSelection())
aShortName = pWrtShell->GetSelTxt();
}
- return pGlossary ? Expand( aShortName, &rStatGlossaries, pGlossary ) : FALSE;
+ return pGlossary ? Expand( aShortName, &rStatGlossaries, pGlossary ) : sal_False;
}
-BOOL SwGlossaryHdl::Expand( const String& rShortName,
+sal_Bool SwGlossaryHdl::Expand( const String& rShortName,
SwGlossaries *pGlossaries,
SwTextBlocks *pGlossary )
{
TextBlockInfoArr aFoundArr;
String aShortName( rShortName );
- BOOL bCancel = FALSE;
+ sal_Bool bCancel = sal_False;
// search for text block
//#b6633427# - don't prefer current group depending on configuration setting
const SvxAutoCorrCfg* pCfg = SvxAutoCorrCfg::Get();
- USHORT nFound = !pCfg->IsSearchInAllCategories() ? pGlossary->GetIndex( aShortName ) : -1;
+ sal_uInt16 nFound = !pCfg->IsSearchInAllCategories() ? pGlossary->GetIndex( aShortName ) : -1;
// if not found then search in all groups
- if( nFound == (USHORT) -1 )
+ if( nFound == (sal_uInt16) -1 )
{
const ::utl::TransliterationWrapper& rSCmp = GetAppCmpStrIgnore();
SwGlossaryList* pGlossaryList = ::GetGlossaryList();
- USHORT nGroupCount = pGlossaryList->GetGroupCount();
- for(USHORT i = 1; i <= nGroupCount; i++)
+ sal_uInt16 nGroupCount = pGlossaryList->GetGroupCount();
+ for(sal_uInt16 i = 1; i <= nGroupCount; i++)
{
// get group name with path-extension
String sTitle;
- String sGroupName = pGlossaryList->GetGroupName(i - 1, FALSE, &sTitle);
+ String sGroupName = pGlossaryList->GetGroupName(i - 1, sal_False, &sTitle);
if(sGroupName == pGlossary->GetName())
continue;
- USHORT nBlockCount = pGlossaryList->GetBlockCount(i -1);
+ sal_uInt16 nBlockCount = pGlossaryList->GetBlockCount(i -1);
if(nBlockCount)
{
- for(USHORT j = 0; j < nBlockCount; j++)
+ for(sal_uInt16 j = 0; j < nBlockCount; j++)
{
String sEntry;
String sLongName(pGlossaryList->GetBlockName(i - 1, j, sEntry));
@@ -490,13 +490,13 @@ BOOL SwGlossaryHdl::Expand( const String& rShortName,
AbstractSwSelGlossaryDlg* pDlg = pFact->CreateSwSelGlossaryDlg( 0, aShortName, DLG_SEL_GLOS );
OSL_ENSURE(pDlg, "Dialogdiet fail!");
- for(USHORT i = 0; i < aFoundArr.Count(); ++i)
+ for(sal_uInt16 i = 0; i < aFoundArr.Count(); ++i)
{
TextBlockInfo_Impl* pData = aFoundArr.GetObject(i);
pDlg->InsertGlos(pData->sTitle, pData->sLongName);
}
pDlg->SelectEntryPos(0);
- const USHORT nRet = RET_OK == pDlg->Execute()?
+ const sal_uInt16 nRet = RET_OK == pDlg->Execute()?
pDlg->GetSelectedIdx():
LISTBOX_ENTRY_NOTFOUND;
delete pDlg;
@@ -508,21 +508,21 @@ BOOL SwGlossaryHdl::Expand( const String& rShortName,
}
else
{
- nFound = (USHORT) -1;
- bCancel = TRUE;
+ nFound = (sal_uInt16) -1;
+ bCancel = sal_True;
}
}
}
}
// not found
- if( nFound == (USHORT) -1 )
+ if( nFound == (sal_uInt16) -1 )
{
if( !bCancel )
{
pGlossaries->PutGroupDoc(pGlossary);
- const USHORT nMaxLen = 50;
+ const sal_uInt16 nMaxLen = 50;
if(pWrtShell->IsSelection() && aShortName.Len() > nMaxLen)
{
aShortName.Erase(nMaxLen);
@@ -533,7 +533,7 @@ BOOL SwGlossaryHdl::Expand( const String& rShortName,
InfoBox( pWrtShell->GetView().GetWindow(), aTmp ).Execute();
}
- return FALSE;
+ return sal_False;
}
else
{
@@ -554,7 +554,7 @@ BOOL SwGlossaryHdl::Expand( const String& rShortName,
pWrtShell->StartAllAction();
// cache all InputFields
- SwInputFieldList aFldLst( pWrtShell, TRUE );
+ SwInputFieldList aFldLst( pWrtShell, sal_True );
pWrtShell->InsertGlossary(*pGlossary, aShortName);
pWrtShell->EndAllAction();
@@ -569,13 +569,13 @@ BOOL SwGlossaryHdl::Expand( const String& rShortName,
pWrtShell->UpdateInputFlds( &aFldLst );
}
pGlossaries->PutGroupDoc(pGlossary);
- return TRUE;
+ return sal_True;
}
/*------------------------------------------------------------------------
Description: add autotext
------------------------------------------------------------------------*/
-BOOL SwGlossaryHdl::InsertGlossary(const String &rName)
+sal_Bool SwGlossaryHdl::InsertGlossary(const String &rName)
{
OSL_ENSURE(pWrtShell->CanInsert(), "illegal");
@@ -583,7 +583,7 @@ BOOL SwGlossaryHdl::InsertGlossary(const String &rName)
pCurGrp? pCurGrp: rStatGlossaries.GetGroupDoc(aCurGrp);
if (!pGlos)
- return FALSE;
+ return sal_False;
SvxMacro aStartMacro(aEmptyStr, aEmptyStr, STARBASIC);
SvxMacro aEndMacro(aEmptyStr, aEmptyStr, STARBASIC);
@@ -600,7 +600,7 @@ BOOL SwGlossaryHdl::InsertGlossary(const String &rName)
pWrtShell->StartAllAction();
// cache all InputFields
- SwInputFieldList aFldLst( pWrtShell, TRUE );
+ SwInputFieldList aFldLst( pWrtShell, sal_True );
pWrtShell->InsertGlossary(*pGlos, rName);
pWrtShell->EndAllAction();
@@ -615,7 +615,7 @@ BOOL SwGlossaryHdl::InsertGlossary(const String &rName)
if(!pCurGrp)
rStatGlossaries.PutGroupDoc(pGlos);
- return TRUE;
+ return sal_True;
}
/*------------------------------------------------------------------------
@@ -634,7 +634,7 @@ void SwGlossaryHdl::SetMacros(const String& rShortName,
aMacroTbl.Insert( SW_EVENT_START_INS_GLOSSARY, new SvxMacro(*pStart));
if( pEnd )
aMacroTbl.Insert( SW_EVENT_END_INS_GLOSSARY, new SvxMacro(*pEnd));
- USHORT nIdx = pGlos->GetIndex( rShortName );
+ sal_uInt16 nIdx = pGlos->GetIndex( rShortName );
if( !pGlos->SetMacroTable( nIdx, aMacroTbl ) && pGlos->GetError() )
ErrorHandler::HandleError( pGlos->GetError() );
@@ -650,7 +650,7 @@ void SwGlossaryHdl::GetMacros( const String &rShortName,
SwTextBlocks *pGlos = pGlossary ? pGlossary
: pCurGrp ? pCurGrp
: rStatGlossaries.GetGroupDoc(aCurGrp);
- USHORT nIndex = pGlos->GetIndex( rShortName );
+ sal_uInt16 nIndex = pGlos->GetIndex( rShortName );
if( nIndex != USHRT_MAX )
{
SvxMacroTableDtor aMacroTbl;
@@ -692,20 +692,20 @@ SwGlossaryHdl::~SwGlossaryHdl()
/*------------------------------------------------------------------------
Description: rename an autotext
------------------------------------------------------------------------*/
-BOOL SwGlossaryHdl::Rename(const String& rOldShort, const String& rNewShortName,
+sal_Bool SwGlossaryHdl::Rename(const String& rOldShort, const String& rNewShortName,
const String& rNewName )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
SwTextBlocks *pGlossary = pCurGrp ? pCurGrp
: rStatGlossaries.GetGroupDoc(aCurGrp);
if(pGlossary)
{
if(!ConvertToNew(*pGlossary))
- return FALSE;
+ return sal_False;
- USHORT nIdx = pGlossary->GetIndex( rOldShort );
- USHORT nOldLongIdx = pGlossary->GetLongIndex( rNewName );
- USHORT nOldIdx = pGlossary->GetIndex( rNewShortName );
+ sal_uInt16 nIdx = pGlossary->GetIndex( rOldShort );
+ sal_uInt16 nOldLongIdx = pGlossary->GetLongIndex( rNewName );
+ sal_uInt16 nOldIdx = pGlossary->GetIndex( rNewShortName );
if( nIdx != USHRT_MAX &&
(nOldLongIdx == USHRT_MAX || nOldLongIdx == nIdx )&&
@@ -723,7 +723,7 @@ BOOL SwGlossaryHdl::Rename(const String& rOldShort, const String& rNewShortName,
}
-BOOL SwGlossaryHdl::IsReadOnly( const String* pGrpNm ) const
+sal_Bool SwGlossaryHdl::IsReadOnly( const String* pGrpNm ) const
{
SwTextBlocks *pGlossary = 0;
@@ -734,18 +734,18 @@ BOOL SwGlossaryHdl::IsReadOnly( const String* pGrpNm ) const
else
pGlossary = rStatGlossaries.GetGroupDoc(aCurGrp);
- BOOL bRet = pGlossary ? pGlossary->IsReadOnly() : TRUE;
+ sal_Bool bRet = pGlossary ? pGlossary->IsReadOnly() : sal_True;
if( pGrpNm || !pCurGrp )
delete pGlossary;
return bRet;
}
-BOOL SwGlossaryHdl::IsOld() const
+sal_Bool SwGlossaryHdl::IsOld() const
{
SwTextBlocks *pGlossary = pCurGrp ? pCurGrp
: rStatGlossaries.GetGroupDoc(aCurGrp);
- BOOL bRet = pGlossary ? pGlossary->IsOld() : FALSE;
+ sal_Bool bRet = pGlossary ? pGlossary->IsOld() : sal_False;
if( !pCurGrp )
delete pGlossary;
return bRet;
@@ -754,12 +754,12 @@ BOOL SwGlossaryHdl::IsOld() const
/*--------------------------------------------------
find group without path index
--------------------------------------------------*/
-BOOL SwGlossaryHdl::FindGroupName(String & rGroup)
+sal_Bool SwGlossaryHdl::FindGroupName(String & rGroup)
{
return rStatGlossaries.FindGroupName(rGroup);
}
-BOOL SwGlossaryHdl::CopyToClipboard(SwWrtShell& rSh, const String& rShortName)
+sal_Bool SwGlossaryHdl::CopyToClipboard(SwWrtShell& rSh, const String& rShortName)
{
SwTextBlocks *pGlossary = pCurGrp ? pCurGrp
: rStatGlossaries.GetGroupDoc(aCurGrp);
@@ -774,16 +774,16 @@ BOOL SwGlossaryHdl::CopyToClipboard(SwWrtShell& rSh, const String& rShortName)
return 0 != nRet;
}
-BOOL SwGlossaryHdl::ImportGlossaries( const String& rName )
+sal_Bool SwGlossaryHdl::ImportGlossaries( const String& rName )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( rName.Len() )
{
const SfxFilter* pFilter = 0;
- SfxMedium* pMed = new SfxMedium( rName, STREAM_READ, TRUE, 0, 0 );
+ SfxMedium* pMed = new SfxMedium( rName, STREAM_READ, sal_True, 0, 0 );
SfxFilterMatcher aMatcher( String::CreateFromAscii("swriter") );
- pMed->UseInteractionHandler( TRUE );
- if( !aMatcher.GuessFilter( *pMed, &pFilter, FALSE ) )
+ pMed->UseInteractionHandler( sal_True );
+ if( !aMatcher.GuessFilter( *pMed, &pFilter, sal_False ) )
{
SwTextBlocks *pGlossary;
pMed->SetFilter( pFilter );
diff --git a/sw/source/ui/dochdl/makefile.mk b/sw/source/ui/dochdl/makefile.mk
deleted file mode 100644
index 5728eaa3c3c4..000000000000
--- a/sw/source/ui/dochdl/makefile.mk
+++ /dev/null
@@ -1,65 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-
-PRJNAME=sw
-TARGET=dochdl
-LIBTARGET=no
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : $(PRJ)$/inc$/swpre.mk
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/inc$/sw.mk
-
-# --- Files --------------------------------------------------------
-
-SRS1NAME=$(TARGET)
-SRC1FILES = \
- dochdl.src \
- selglos.src
-
-SLOFILES = \
- $(EXCEPTIONSFILES)
-
-EXCEPTIONSFILES = \
- $(SLO)$/gloshdl.obj \
- $(SLO)$/selglos.obj \
- $(SLO)$/swdtflvr.obj
-
-# $(SLO)$/dataex.obj \
-
-LIB1TARGET = $(SLB)$/$(TARGET).lib
-
-LIB1OBJFILES = \
- $(SLO)$/gloshdl.obj \
- $(SLO)$/swdtflvr.obj
-
-# --- Tagets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/sw/source/ui/dochdl/selglos.src b/sw/source/ui/dochdl/selglos.src
index ba0ba695c6fe..960c7855d41c 100644
--- a/sw/source/ui/dochdl/selglos.src
+++ b/sw/source/ui/dochdl/selglos.src
@@ -33,7 +33,7 @@
// #define DLG_SEL_GLOS 256
ModalDialog DLG_SEL_GLOS
{
- HelpID = FN_EXPAND_GLOSSARY ;
+ HelpID = CMD_FN_EXPAND_GLOSSARY ;
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 220 , 100 ) ;
@@ -66,6 +66,7 @@ ModalDialog DLG_SEL_GLOS
};
ListBox LB_GLOS
{
+ HelpID = "sw:ListBox:DLG_SEL_GLOS:LB_GLOS";
Border = TRUE ;
Pos = MAP_APPFONT ( 12 , 14 ) ;
Size = MAP_APPFONT ( 140 , 74 ) ;
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()