summaryrefslogtreecommitdiff
path: root/sc/source/ui/docshell
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2011-03-10 16:55:21 -0500
committerKohei Yoshida <kyoshida@novell.com>2011-03-10 20:21:13 -0500
commit12343c15568dcc2c9209d8ca41fda2263122448f (patch)
tree3212a89c6cd8ea2e0aee7103aa9669bbb8a6f307 /sc/source/ui/docshell
parent99745dbcbb25b61437914c9782475d0b67a4b0bd (diff)
parentce6308e4fad2281241bf4ca78280eba29f744d43 (diff)
Merge commit 'ooo/DEV300_m101' into integration/dev300_m101
Diffstat (limited to 'sc/source/ui/docshell')
-rw-r--r--sc/source/ui/docshell/arealink.cxx53
-rw-r--r--sc/source/ui/docshell/autostyl.cxx24
-rw-r--r--sc/source/ui/docshell/dbdocfun.cxx306
-rw-r--r--sc/source/ui/docshell/dbdocimp.cxx100
-rw-r--r--sc/source/ui/docshell/docfunc.cxx849
-rw-r--r--sc/source/ui/docshell/docsh.cxx439
-rw-r--r--sc/source/ui/docshell/docsh2.cxx16
-rw-r--r--sc/source/ui/docshell/docsh3.cxx168
-rw-r--r--sc/source/ui/docshell/docsh4.cxx311
-rw-r--r--sc/source/ui/docshell/docsh5.cxx174
-rw-r--r--sc/source/ui/docshell/docsh6.cxx70
-rw-r--r--sc/source/ui/docshell/docsh8.cxx92
-rw-r--r--sc/source/ui/docshell/editable.cxx44
-rw-r--r--sc/source/ui/docshell/externalrefmgr.cxx6
-rw-r--r--sc/source/ui/docshell/impex.cxx304
-rw-r--r--sc/source/ui/docshell/olinefun.cxx226
-rw-r--r--sc/source/ui/docshell/pagedata.cxx14
-rw-r--r--sc/source/ui/docshell/pntlock.cxx6
-rw-r--r--sc/source/ui/docshell/servobj.cxx36
-rw-r--r--sc/source/ui/docshell/sizedev.cxx6
-rw-r--r--sc/source/ui/docshell/tablink.cxx105
-rw-r--r--sc/source/ui/docshell/tpstat.cxx4
22 files changed, 1682 insertions, 1671 deletions
diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx
index ddef0eb95bc5..1d51186f0c7a 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -77,7 +77,7 @@ TYPEINIT1(ScAreaLink,::sfx2::SvBaseLink);
ScAreaLink::ScAreaLink( SfxObjectShell* pShell, const String& rFile,
const String& rFilter, const String& rOpt,
const String& rArea, const ScRange& rDest,
- ULONG nRefresh ) :
+ sal_uLong nRefresh ) :
::sfx2::SvBaseLink(sfx2::LINKUPDATE_ONCALL,FORMAT_FILE),
ScRefreshTimer ( nRefresh ),
pImpl ( new AreaLink_Impl() ),
@@ -86,9 +86,9 @@ ScAreaLink::ScAreaLink( SfxObjectShell* pShell, const String& rFile,
aOptions (rOpt),
aSourceArea (rArea),
aDestArea (rDest),
- bAddUndo (TRUE),
- bInCreate (FALSE),
- bDoInsert (TRUE)
+ bAddUndo (sal_True),
+ bInCreate (false),
+ bDoInsert (sal_True)
{
DBG_ASSERT(pShell->ISA(ScDocShell), "ScAreaLink mit falscher ObjectShell");
pImpl->m_pDocSh = static_cast< ScDocShell* >( pShell );
@@ -159,19 +159,19 @@ void ScAreaLink::Closed()
// Verknuepfung loeschen: Undo
ScDocument* pDoc = pImpl->m_pDocSh->GetDocument();
- BOOL bUndo (pDoc->IsUndoEnabled());
+ sal_Bool bUndo (pDoc->IsUndoEnabled());
if (bAddUndo && bUndo)
{
pImpl->m_pDocSh->GetUndoManager()->AddUndoAction( new ScUndoRemoveAreaLink( pImpl->m_pDocSh,
aFileName, aFilterName, aOptions,
aSourceArea, aDestArea, GetRefreshDelay() ) );
- bAddUndo = FALSE; // nur einmal
+ bAddUndo = false; // nur einmal
}
SCTAB nDestTab = aDestArea.aStart.Tab();
if (pDoc->IsStreamValid(nDestTab))
- pDoc->SetStreamValid(nDestTab, FALSE);
+ pDoc->SetStreamValid(nDestTab, false);
SvBaseLink::Closed();
}
@@ -195,7 +195,7 @@ void ScAreaLink::SetSource(const String& rDoc, const String& rFlt, const String&
SetName( aNewLinkName );
}
-BOOL ScAreaLink::IsEqual( const String& rFile, const String& rFilter, const String& rOpt,
+sal_Bool ScAreaLink::IsEqual( const String& rFile, const String& rFilter, const String& rOpt,
const String& rSource, const ScRange& rDest ) const
{
return aFileName == rFile && aFilterName == rFilter && aOptions == rOpt &&
@@ -203,11 +203,11 @@ BOOL ScAreaLink::IsEqual( const String& rFile, const String& rFilter, const Stri
}
// find a range with name >rAreaName< in >pSrcDoc<, return it in >rRange<
-BOOL ScAreaLink::FindExtRange( ScRange& rRange, ScDocument* pSrcDoc, const String& rAreaName )
+sal_Bool ScAreaLink::FindExtRange( ScRange& rRange, ScDocument* pSrcDoc, const String& rAreaName )
{
bool bFound = false;
ScRangeName* pNames = pSrcDoc->GetRangeName();
- USHORT nPos;
+ sal_uInt16 nPos;
if (pNames) // benannte Bereiche
{
const ScRangeData* p = pNames->findByName(rAreaName);
@@ -239,25 +239,25 @@ BOOL ScAreaLink::FindExtRange( ScRange& rRange, ScDocument* pSrcDoc, const Strin
// ausfuehren:
-BOOL ScAreaLink::Refresh( const String& rNewFile, const String& rNewFilter,
- const String& rNewArea, ULONG nNewRefresh )
+sal_Bool ScAreaLink::Refresh( const String& rNewFile, const String& rNewFilter,
+ const String& rNewArea, sal_uLong nNewRefresh )
{
// Dokument laden - wie TabLink
if (!rNewFile.Len() || !rNewFilter.Len())
- return FALSE;
+ return false;
String aNewUrl( ScGlobal::GetAbsDocName( rNewFile, pImpl->m_pDocSh ) );
- BOOL bNewUrlName = (aNewUrl != aFileName);
+ sal_Bool bNewUrlName = (aNewUrl != aFileName);
const SfxFilter* pFilter = pImpl->m_pDocSh->GetFactory().GetFilterContainer()->GetFilter4FilterName(rNewFilter);
if (!pFilter)
- return FALSE;
+ return false;
ScDocument* pDoc = pImpl->m_pDocSh->GetDocument();
- BOOL bUndo (pDoc->IsUndoEnabled());
- pDoc->SetInLinkUpdate( TRUE );
+ sal_Bool bUndo (pDoc->IsUndoEnabled());
+ pDoc->SetInLinkUpdate( sal_True );
// wenn neuer Filter ausgewaehlt wurde, Optionen vergessen
if ( rNewFilter != aFilterName )
@@ -268,8 +268,9 @@ BOOL ScAreaLink::Refresh( const String& rNewFile, const String& rNewFilter,
if ( aOptions.Len() )
pSet->Put( SfxStringItem( SID_FILE_FILTEROPTIONS, aOptions ) );
- SfxMedium* pMed = new SfxMedium(aNewUrl, STREAM_STD_READ, FALSE, pFilter);
+ SfxMedium* pMed = new SfxMedium(aNewUrl, STREAM_STD_READ, false, pFilter);
+ // aRef->DoClose() will be closed explicitly, but it is still more safe to use SfxObjectShellLock here
ScDocShell* pSrcShell = new ScDocShell(SFX_CREATE_MODE_INTERNAL);
SfxObjectShellRef aRef = pSrcShell;
pSrcShell->DoLoad(pMed);
@@ -325,7 +326,7 @@ BOOL ScAreaLink::Refresh( const String& rNewFile, const String& rNewFilter,
}
//! check CanFitBlock only if bDoInsert is set?
- BOOL bCanDo = ValidColRow( aNewRange.aEnd.Col(), aNewRange.aEnd.Row() ) &&
+ sal_Bool bCanDo = ValidColRow( aNewRange.aEnd.Col(), aNewRange.aEnd.Row() ) &&
pDoc->CanFitBlock( aOldRange, aNewRange );
if (bCanDo)
{
@@ -351,16 +352,16 @@ BOOL ScAreaLink::Refresh( const String& rNewFile, const String& rNewFilter,
{
pUndoDoc->InitUndo( pDoc, 0, pDoc->GetTableCount()-1 );
pDoc->CopyToDocument( 0,0,0,MAXCOL,MAXROW,MAXTAB,
- IDF_FORMULA, FALSE, pUndoDoc ); // alle Formeln
+ IDF_FORMULA, false, pUndoDoc ); // alle Formeln
}
else
pUndoDoc->InitUndo( pDoc, nDestTab, nDestTab ); // nur Zieltabelle
- pDoc->CopyToDocument( aOldRange, IDF_ALL & ~IDF_NOTE, FALSE, pUndoDoc );
+ pDoc->CopyToDocument( aOldRange, IDF_ALL & ~IDF_NOTE, false, pUndoDoc );
}
else // ohne Einfuegen
{
pUndoDoc->InitUndo( pDoc, nDestTab, nDestTab ); // nur Zieltabelle
- pDoc->CopyToDocument( aMaxRange, IDF_ALL & ~IDF_NOTE, FALSE, pUndoDoc );
+ pDoc->CopyToDocument( aMaxRange, IDF_ALL & ~IDF_NOTE, false, pUndoDoc );
}
}
@@ -409,7 +410,7 @@ BOOL ScAreaLink::Refresh( const String& rNewFile, const String& rNewFilter,
ScMarkData aDestMark;
aDestMark.SelectOneTable( nDestTab );
aDestMark.SetMarkArea( aNewTokenRange );
- pDoc->CopyFromClip( aNewTokenRange, aDestMark, IDF_ALL, NULL, &aClipDoc, FALSE );
+ pDoc->CopyFromClip( aNewTokenRange, aDestMark, IDF_ALL, NULL, &aClipDoc, false );
aNewTokenRange.aStart.SetRow( aNewTokenRange.aEnd.Row() + 2 );
}
}
@@ -426,7 +427,7 @@ BOOL ScAreaLink::Refresh( const String& rNewFile, const String& rNewFilter,
{
pRedoDoc = new ScDocument( SCDOCMODE_UNDO );
pRedoDoc->InitUndo( pDoc, nDestTab, nDestTab );
- pDoc->CopyToDocument( aNewRange, IDF_ALL & ~IDF_NOTE, FALSE, pRedoDoc );
+ pDoc->CopyToDocument( aNewRange, IDF_ALL & ~IDF_NOTE, false, pRedoDoc );
pImpl->m_pDocSh->GetUndoManager()->AddUndoAction(
new ScUndoUpdateAreaLink( pImpl->m_pDocSh,
@@ -469,7 +470,7 @@ BOOL ScAreaLink::Refresh( const String& rNewFile, const String& rNewFilter,
}
else
{
- // CanFitBlock FALSE -> Probleme mit zusammengefassten Zellen
+ // CanFitBlock sal_False -> Probleme mit zusammengefassten Zellen
// oder Tabellengrenze erreicht!
//! Zellschutz ???
@@ -484,7 +485,7 @@ BOOL ScAreaLink::Refresh( const String& rNewFile, const String& rNewFilter,
aRef->DoClose();
- pDoc->SetInLinkUpdate( FALSE );
+ pDoc->SetInLinkUpdate( false );
if (bCanDo)
{
diff --git a/sc/source/ui/docshell/autostyl.cxx b/sc/source/ui/docshell/autostyl.cxx
index cc00106a4a2e..bfb7c8f3c9a1 100644
--- a/sc/source/ui/docshell/autostyl.cxx
+++ b/sc/source/ui/docshell/autostyl.cxx
@@ -42,26 +42,26 @@ struct ScAutoStyleInitData
{
ScRange aRange;
String aStyle1;
- ULONG nTimeout;
+ sal_uLong nTimeout;
String aStyle2;
- ScAutoStyleInitData( const ScRange& rR, const String& rSt1, ULONG nT, const String& rSt2 ) :
+ ScAutoStyleInitData( const ScRange& rR, const String& rSt1, sal_uLong nT, const String& rSt2 ) :
aRange(rR), aStyle1(rSt1), nTimeout(nT), aStyle2(rSt2) {}
};
struct ScAutoStyleData
{
- ULONG nTimeout;
+ sal_uLong nTimeout;
ScRange aRange;
String aStyle;
- ScAutoStyleData( ULONG nT, const ScRange& rR, const String& rT ) :
+ ScAutoStyleData( sal_uLong nT, const ScRange& rR, const String& rT ) :
nTimeout(nT), aRange(rR), aStyle(rT) {}
};
-inline ULONG TimeNow() // Sekunden
+inline sal_uLong TimeNow() // Sekunden
{
- return (ULONG) time(0);
+ return (sal_uLong) time(0);
}
ScAutoStyleList::ScAutoStyleList(ScDocShell* pShell) :
@@ -79,7 +79,7 @@ ScAutoStyleList::~ScAutoStyleList()
// initial short delay (asynchronous call)
void ScAutoStyleList::AddInitial( const ScRange& rRange, const String& rStyle1,
- ULONG nTimeout, const String& rStyle2 )
+ sal_uLong nTimeout, const String& rStyle2 )
{
aInitials.push_back(new ScAutoStyleInitData( rRange, rStyle1, nTimeout, rStyle2 ));
aInitTimer.Start();
@@ -103,10 +103,10 @@ IMPL_LINK( ScAutoStyleList, InitHdl, Timer*, EMPTYARG )
return 0;
}
-void ScAutoStyleList::AddEntry( ULONG nTimeout, const ScRange& rRange, const String& rStyle )
+void ScAutoStyleList::AddEntry( sal_uLong nTimeout, const ScRange& rRange, const String& rStyle )
{
aTimer.Stop();
- ULONG nNow = TimeNow();
+ sal_uLong nNow = TimeNow();
aEntries.erase(std::remove_if(aEntries.begin(),aEntries.end(),
boost::bind(&ScAutoStyleData::aRange,_1) == rRange));
@@ -131,7 +131,7 @@ void ScAutoStyleList::AddEntry( ULONG nTimeout, const ScRange& rRange, const Str
StartTimer(nNow);
}
-void ScAutoStyleList::AdjustEntries( ULONG nDiff ) // Millisekunden
+void ScAutoStyleList::AdjustEntries( sal_uLong nDiff ) // Millisekunden
{
boost::ptr_vector<ScAutoStyleData>::iterator iter;
for (iter = aEntries.begin(); iter != aEntries.end(); ++iter)
@@ -171,7 +171,7 @@ void ScAutoStyleList::ExecuteAllNow()
aEntries.clear();
}
-void ScAutoStyleList::StartTimer( ULONG nNow ) // Sekunden
+void ScAutoStyleList::StartTimer( sal_uLong nNow ) // Sekunden
{
// ersten Eintrag mit Timeout != 0 suchen
boost::ptr_vector<ScAutoStyleData>::iterator iter = std::find_if(aEntries.begin(),aEntries.end(),
@@ -188,7 +188,7 @@ void ScAutoStyleList::StartTimer( ULONG nNow ) // Sekunden
IMPL_LINK( ScAutoStyleList, TimerHdl, Timer*, EMPTYARG )
{
- ULONG nNow = TimeNow();
+ sal_uLong nNow = TimeNow();
AdjustEntries(aTimer.GetTimeout()); // eingestellte Wartezeit
ExecuteEntries();
StartTimer(nNow);
diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx
index 96228b2256f3..7ff1efa3cb78 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -61,14 +61,14 @@
// -----------------------------------------------------------------
-BOOL ScDBDocFunc::AddDBRange( const String& rName, const ScRange& rRange, BOOL /* bApi */ )
+sal_Bool ScDBDocFunc::AddDBRange( const String& rName, const ScRange& rRange, sal_Bool /* bApi */ )
{
ScDocShellModificator aModificator( rDocShell );
ScDocument* pDoc = rDocShell.GetDocument();
ScDBCollection* pDocColl = pDoc->GetDBCollection();
- BOOL bUndo (pDoc->IsUndoEnabled());
+ sal_Bool bUndo (pDoc->IsUndoEnabled());
ScDBCollection* pUndoColl = NULL;
if (bUndo)
@@ -81,19 +81,19 @@ BOOL ScDBDocFunc::AddDBRange( const String& rName, const ScRange& rRange, BOOL /
// #i55926# While loading XML, formula cells only have a single string token,
// so CompileDBFormula would never find any name (index) tokens, and would
// unnecessarily loop through all cells.
- BOOL bCompile = !pDoc->IsImportingXML();
+ sal_Bool bCompile = !pDoc->IsImportingXML();
if ( bCompile )
- pDoc->CompileDBFormula( TRUE ); // CreateFormulaString
- BOOL bOk = pDocColl->Insert( pNew );
+ pDoc->CompileDBFormula( sal_True ); // CreateFormulaString
+ sal_Bool bOk = pDocColl->Insert( pNew );
if ( bCompile )
- pDoc->CompileDBFormula( FALSE ); // CompileFormulaString
+ pDoc->CompileDBFormula( false ); // CompileFormulaString
if (!bOk)
{
delete pNew;
delete pUndoColl;
- return FALSE;
+ return false;
}
if (bUndo)
@@ -105,17 +105,17 @@ BOOL ScDBDocFunc::AddDBRange( const String& rName, const ScRange& rRange, BOOL /
aModificator.SetDocumentModified();
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_DBAREAS_CHANGED ) );
- return TRUE;
+ return sal_True;
}
-BOOL ScDBDocFunc::DeleteDBRange( const String& rName, BOOL /* bApi */ )
+sal_Bool ScDBDocFunc::DeleteDBRange( const String& rName, sal_Bool /* bApi */ )
{
- BOOL bDone = FALSE;
+ sal_Bool bDone = false;
ScDocument* pDoc = rDocShell.GetDocument();
ScDBCollection* pDocColl = pDoc->GetDBCollection();
- BOOL bUndo (pDoc->IsUndoEnabled());
+ sal_Bool bUndo (pDoc->IsUndoEnabled());
- USHORT nPos = 0;
+ sal_uInt16 nPos = 0;
if (pDocColl->SearchName( rName, nPos ))
{
ScDocShellModificator aModificator( rDocShell );
@@ -124,9 +124,9 @@ BOOL ScDBDocFunc::DeleteDBRange( const String& rName, BOOL /* bApi */ )
if (bUndo)
pUndoColl = new ScDBCollection( *pDocColl );
- pDoc->CompileDBFormula( TRUE ); // CreateFormulaString
+ pDoc->CompileDBFormula( sal_True ); // CreateFormulaString
pDocColl->AtFree( nPos );
- pDoc->CompileDBFormula( FALSE ); // CompileFormulaString
+ pDoc->CompileDBFormula( false ); // CompileFormulaString
if (bUndo)
{
@@ -137,21 +137,21 @@ BOOL ScDBDocFunc::DeleteDBRange( const String& rName, BOOL /* bApi */ )
aModificator.SetDocumentModified();
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_DBAREAS_CHANGED ) );
- bDone = TRUE;
+ bDone = sal_True;
}
return bDone;
}
-BOOL ScDBDocFunc::RenameDBRange( const String& rOld, const String& rNew, BOOL /* bApi */ )
+sal_Bool ScDBDocFunc::RenameDBRange( const String& rOld, const String& rNew, sal_Bool /* bApi */ )
{
- BOOL bDone = FALSE;
+ sal_Bool bDone = false;
ScDocument* pDoc = rDocShell.GetDocument();
ScDBCollection* pDocColl = pDoc->GetDBCollection();
- BOOL bUndo (pDoc->IsUndoEnabled());
+ sal_Bool bUndo (pDoc->IsUndoEnabled());
- USHORT nPos = 0;
- USHORT nDummy = 0;
+ sal_uInt16 nPos = 0;
+ sal_uInt16 nDummy = 0;
if ( pDocColl->SearchName( rOld, nPos ) &&
!pDocColl->SearchName( rNew, nDummy ) )
{
@@ -163,15 +163,15 @@ BOOL ScDBDocFunc::RenameDBRange( const String& rOld, const String& rNew, BOOL /*
ScDBCollection* pUndoColl = new ScDBCollection( *pDocColl );
- pDoc->CompileDBFormula( TRUE ); // CreateFormulaString
+ pDoc->CompileDBFormula( sal_True ); // CreateFormulaString
pDocColl->AtFree( nPos );
- BOOL bInserted = pDocColl->Insert( pNewData );
+ sal_Bool bInserted = pDocColl->Insert( pNewData );
if (!bInserted) // Fehler -> alten Zustand wiederherstellen
{
delete pNewData;
pDoc->SetDBCollection( pUndoColl ); // gehoert dann dem Dokument
}
- pDoc->CompileDBFormula( FALSE ); // CompileFormulaString
+ pDoc->CompileDBFormula( false ); // CompileFormulaString
if (bInserted) // Einfuegen hat geklappt
{
@@ -186,21 +186,21 @@ BOOL ScDBDocFunc::RenameDBRange( const String& rOld, const String& rNew, BOOL /*
aModificator.SetDocumentModified();
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_DBAREAS_CHANGED ) );
- bDone = TRUE;
+ bDone = sal_True;
}
}
return bDone;
}
-BOOL ScDBDocFunc::ModifyDBData( const ScDBData& rNewData, BOOL /* bApi */ )
+sal_Bool ScDBDocFunc::ModifyDBData( const ScDBData& rNewData, sal_Bool /* bApi */ )
{
- BOOL bDone = FALSE;
+ sal_Bool bDone = false;
ScDocument* pDoc = rDocShell.GetDocument();
ScDBCollection* pDocColl = pDoc->GetDBCollection();
- BOOL bUndo (pDoc->IsUndoEnabled());
+ sal_Bool bUndo (pDoc->IsUndoEnabled());
- USHORT nPos = 0;
+ sal_uInt16 nPos = 0;
if (pDocColl->SearchName( rNewData.GetName(), nPos ))
{
ScDocShellModificator aModificator( rDocShell );
@@ -210,7 +210,7 @@ BOOL ScDBDocFunc::ModifyDBData( const ScDBData& rNewData, BOOL /* bApi */ )
ScRange aOldRange, aNewRange;
pData->GetArea(aOldRange);
rNewData.GetArea(aNewRange);
- BOOL bAreaChanged = ( aOldRange != aNewRange ); // dann muss neu compiliert werden
+ sal_Bool bAreaChanged = ( aOldRange != aNewRange ); // dann muss neu compiliert werden
ScDBCollection* pUndoColl = NULL;
if (bUndo)
@@ -228,7 +228,7 @@ BOOL ScDBDocFunc::ModifyDBData( const ScDBData& rNewData, BOOL /* bApi */ )
}
aModificator.SetDocumentModified();
- bDone = TRUE;
+ bDone = sal_True;
}
return bDone;
@@ -236,45 +236,45 @@ BOOL ScDBDocFunc::ModifyDBData( const ScDBData& rNewData, BOOL /* bApi */ )
// -----------------------------------------------------------------
-BOOL ScDBDocFunc::RepeatDB( const String& rDBName, BOOL bRecord, BOOL bApi )
+sal_Bool ScDBDocFunc::RepeatDB( const String& rDBName, sal_Bool bRecord, sal_Bool bApi )
{
//! auch fuer ScDBFunc::RepeatDB benutzen!
- BOOL bDone = FALSE;
+ sal_Bool bDone = false;
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = FALSE;
+ bRecord = false;
ScDBCollection* pColl = pDoc->GetDBCollection();
- USHORT nIndex;
+ sal_uInt16 nIndex;
if ( pColl && pColl->SearchName( rDBName, nIndex ) )
{
ScDBData* pDBData = (*pColl)[nIndex];
ScQueryParam aQueryParam;
pDBData->GetQueryParam( aQueryParam );
- BOOL bQuery = aQueryParam.GetEntry(0).bDoQuery;
+ sal_Bool bQuery = aQueryParam.GetEntry(0).bDoQuery;
ScSortParam aSortParam;
pDBData->GetSortParam( aSortParam );
- BOOL bSort = aSortParam.bDoSort[0];
+ sal_Bool bSort = aSortParam.bDoSort[0];
ScSubTotalParam aSubTotalParam;
pDBData->GetSubTotalParam( aSubTotalParam );
- BOOL bSubTotal = aSubTotalParam.bGroupActive[0] && !aSubTotalParam.bRemoveOnly;
+ sal_Bool bSubTotal = aSubTotalParam.bGroupActive[0] && !aSubTotalParam.bRemoveOnly;
if ( bQuery || bSort || bSubTotal )
{
- BOOL bQuerySize = FALSE;
+ sal_Bool bQuerySize = false;
ScRange aOldQuery;
ScRange aNewQuery;
if (bQuery && !aQueryParam.bInplace)
{
ScDBData* pDest = pDoc->GetDBAtCursor( aQueryParam.nDestCol, aQueryParam.nDestRow,
- aQueryParam.nDestTab, TRUE );
+ aQueryParam.nDestTab, sal_True );
if (pDest && pDest->IsDoSize())
{
pDest->GetArea( aOldQuery );
- bQuerySize = TRUE;
+ bQuerySize = sal_True;
}
}
@@ -307,22 +307,22 @@ BOOL ScDBDocFunc::RepeatDB( const String& rDBName, BOOL bRecord, BOOL bApi )
pTable->GetColArray()->GetRange( nOutStartCol, nOutEndCol );
pTable->GetRowArray()->GetRange( nOutStartRow, nOutEndRow );
- pUndoDoc->InitUndo( pDoc, nTab, nTab, TRUE, TRUE );
+ pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_True, sal_True );
pDoc->CopyToDocument( static_cast<SCCOL>(nOutStartCol), 0,
nTab, static_cast<SCCOL>(nOutEndCol), MAXROW, nTab,
- IDF_NONE, FALSE, pUndoDoc );
+ IDF_NONE, false, pUndoDoc );
pDoc->CopyToDocument( 0, static_cast<SCROW>(nOutStartRow),
nTab, MAXCOL, static_cast<SCROW>(nOutEndRow), nTab,
- IDF_NONE, FALSE, pUndoDoc );
+ IDF_NONE, false, pUndoDoc );
}
else
- pUndoDoc->InitUndo( pDoc, nTab, nTab, FALSE, TRUE );
+ pUndoDoc->InitUndo( pDoc, nTab, nTab, false, sal_True );
// Datenbereich sichern - incl. Filter-Ergebnis
- pDoc->CopyToDocument( 0,nStartRow,nTab, MAXCOL,nEndRow,nTab, IDF_ALL, FALSE, pUndoDoc );
+ pDoc->CopyToDocument( 0,nStartRow,nTab, MAXCOL,nEndRow,nTab, IDF_ALL, false, pUndoDoc );
// alle Formeln wegen Referenzen
- pDoc->CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTabCount-1, IDF_FORMULA, FALSE, pUndoDoc );
+ pDoc->CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTabCount-1, IDF_FORMULA, false, pUndoDoc );
// DB- und andere Bereiche
ScRangeName* pDocRange = pDoc->GetRangeName();
@@ -337,23 +337,23 @@ BOOL ScDBDocFunc::RepeatDB( const String& rDBName, BOOL bRecord, BOOL bApi )
{
// Sortieren ohne SubTotals
- aSubTotalParam.bRemoveOnly = TRUE; // wird unten wieder zurueckgesetzt
- DoSubTotals( nTab, aSubTotalParam, NULL, FALSE, bApi );
+ aSubTotalParam.bRemoveOnly = sal_True; // wird unten wieder zurueckgesetzt
+ DoSubTotals( nTab, aSubTotalParam, NULL, false, bApi );
}
if (bSort)
{
pDBData->GetSortParam( aSortParam ); // Bereich kann sich geaendert haben
- Sort( nTab, aSortParam, FALSE, FALSE, bApi );
+ Sort( nTab, aSortParam, false, false, bApi );
}
if (bQuery)
{
pDBData->GetQueryParam( aQueryParam ); // Bereich kann sich geaendert haben
ScRange aAdvSource;
if (pDBData->GetAdvancedQuerySource(aAdvSource))
- Query( nTab, aQueryParam, &aAdvSource, FALSE, bApi );
+ Query( nTab, aQueryParam, &aAdvSource, false, bApi );
else
- Query( nTab, aQueryParam, NULL, FALSE, bApi );
+ Query( nTab, aQueryParam, NULL, false, bApi );
// bei nicht-inplace kann die Tabelle umgestellt worden sein
// if ( !aQueryParam.bInplace && aQueryParam.nDestTab != nTab )
@@ -362,8 +362,8 @@ BOOL ScDBDocFunc::RepeatDB( const String& rDBName, BOOL bRecord, BOOL bApi )
if (bSubTotal)
{
pDBData->GetSubTotalParam( aSubTotalParam ); // Bereich kann sich geaendert haben
- aSubTotalParam.bRemoveOnly = FALSE;
- DoSubTotals( nTab, aSubTotalParam, NULL, FALSE, bApi );
+ aSubTotalParam.bRemoveOnly = false;
+ DoSubTotals( nTab, aSubTotalParam, NULL, false, bApi );
}
if (bRecord)
@@ -379,7 +379,7 @@ BOOL ScDBDocFunc::RepeatDB( const String& rDBName, BOOL bRecord, BOOL bApi )
if (bQuerySize)
{
ScDBData* pDest = pDoc->GetDBAtCursor( aQueryParam.nDestCol, aQueryParam.nDestRow,
- aQueryParam.nDestTab, TRUE );
+ aQueryParam.nDestTab, sal_True );
if (pDest)
{
pDest->GetArea( aNewQuery );
@@ -401,7 +401,7 @@ BOOL ScDBDocFunc::RepeatDB( const String& rDBName, BOOL bRecord, BOOL bApi )
rDocShell.PostPaint( 0,0,nTab, MAXCOL,MAXROW,nTab,
PAINT_GRID | PAINT_LEFT | PAINT_TOP | PAINT_SIZE );
- bDone = TRUE;
+ bDone = sal_True;
}
else if (!bApi) // "Keine Operationen auszufuehren"
rDocShell.ErrorMessage(STR_MSSG_REPEATDB_0);
@@ -412,14 +412,14 @@ BOOL ScDBDocFunc::RepeatDB( const String& rDBName, BOOL bRecord, BOOL bApi )
// -----------------------------------------------------------------
-BOOL ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
- BOOL bRecord, BOOL bPaint, BOOL bApi )
+sal_Bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
+ sal_Bool bRecord, sal_Bool bPaint, sal_Bool bApi )
{
ScDocShellModificator aModificator( rDocShell );
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = FALSE;
+ bRecord = false;
SCTAB nSrcTab = nTab;
ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
@@ -428,15 +428,15 @@ BOOL ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
if (!pDBData)
{
OSL_FAIL( "Sort: keine DBData" );
- return FALSE;
+ return false;
}
ScDBData* pDestData = NULL;
ScRange aOldDest;
- BOOL bCopy = !rSortParam.bInplace;
+ sal_Bool bCopy = !rSortParam.bInplace;
if ( bCopy && rSortParam.nDestCol == rSortParam.nCol1 &&
rSortParam.nDestRow == rSortParam.nRow1 && rSortParam.nDestTab == nTab )
- bCopy = FALSE;
+ bCopy = false;
ScSortParam aLocalParam( rSortParam );
if ( bCopy )
{
@@ -445,12 +445,12 @@ BOOL ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
{
if (!bApi)
rDocShell.ErrorMessage(STR_PASTE_FULL);
- return FALSE;
+ return false;
}
nTab = rSortParam.nDestTab;
pDestData = pDoc->GetDBAtCursor( rSortParam.nDestCol, rSortParam.nDestRow,
- rSortParam.nDestTab, TRUE );
+ rSortParam.nDestTab, sal_True );
if (pDestData)
pDestData->GetArea(aOldDest);
}
@@ -461,7 +461,7 @@ BOOL ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
{
if (!bApi)
rDocShell.ErrorMessage(aTester.GetMessageId());
- return FALSE;
+ return false;
}
if ( aLocalParam.bIncludePattern && pDoc->HasAttrib(
@@ -472,7 +472,7 @@ BOOL ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
// Merge-Attribute wuerden beim Sortieren durcheinanderkommen
if (!bApi)
rDocShell.ErrorMessage(STR_SORT_ERR_MERGED);
- return FALSE;
+ return false;
}
@@ -480,11 +480,11 @@ BOOL ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
WaitObject aWait( rDocShell.GetActiveDialogParent() );
- BOOL bRepeatQuery = FALSE; // bestehenden Filter wiederholen?
+ sal_Bool bRepeatQuery = false; // bestehenden Filter wiederholen?
ScQueryParam aQueryParam;
pDBData->GetQueryParam( aQueryParam );
if ( aQueryParam.GetEntry(0).bDoQuery )
- bRepeatQuery = TRUE;
+ bRepeatQuery = sal_True;
if (bRepeatQuery && bCopy)
{
@@ -492,7 +492,7 @@ BOOL ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
aQueryParam.nDestCol != rSortParam.nDestCol ||
aQueryParam.nDestRow != rSortParam.nDestRow ||
aQueryParam.nDestTab != rSortParam.nDestTab ) // Query auf selben Zielbereich?
- bRepeatQuery = FALSE;
+ bRepeatQuery = false;
}
ScUndoSort* pUndoAction = 0;
@@ -503,7 +503,7 @@ BOOL ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
// Zeilenhoehen immer (wegen automatischer Anpassung)
//! auf ScBlockUndo umstellen
- pUndoDoc->InitUndo( pDoc, nTab, nTab, FALSE, TRUE );
+ pUndoDoc->InitUndo( pDoc, nTab, nTab, false, sal_True );
/* #i59745# Do not copy note captions to undo document. All existing
caption objects will be repositioned while sorting which is tracked
@@ -512,7 +512,7 @@ BOOL ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
existing captions) will be copied back into the source document. */
pDoc->CopyToDocument( aLocalParam.nCol1, aLocalParam.nRow1, nTab,
aLocalParam.nCol2, aLocalParam.nRow2, nTab,
- IDF_ALL|IDF_NOCAPTIONS, FALSE, pUndoDoc );
+ IDF_ALL|IDF_NOCAPTIONS, false, pUndoDoc );
const ScRange* pR = 0;
if (pDestData)
@@ -523,7 +523,7 @@ BOOL ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
caption objects are reinserted with drawing undo, and the cells
with the old notes (which still refer to the existing captions)
will be copied back into the source document. */
- pDoc->CopyToDocument( aOldDest, IDF_ALL|IDF_NOCAPTIONS, FALSE, pUndoDoc );
+ pDoc->CopyToDocument( aOldDest, IDF_ALL|IDF_NOCAPTIONS, false, pUndoDoc );
pR = &aOldDest;
}
@@ -531,7 +531,7 @@ BOOL ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
//! auf ScBlockUndo umstellen
// if (bRepeatQuery)
pDoc->CopyToDocument( 0, aLocalParam.nRow1, nTab, MAXCOL, aLocalParam.nRow2, nTab,
- IDF_NONE, FALSE, pUndoDoc );
+ IDF_NONE, false, pUndoDoc );
ScDBCollection* pUndoDB = NULL;
ScDBCollection* pDocDB = pDoc->GetDBCollection();
@@ -555,21 +555,21 @@ BOOL ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
rSortParam.nCol2,rSortParam.nRow2,nSrcTab );
ScAddress aDest( rSortParam.nDestCol, rSortParam.nDestRow, rSortParam.nDestTab );
- rDocShell.GetDocFunc().MoveBlock( aSource, aDest, FALSE, FALSE, FALSE, TRUE );
+ rDocShell.GetDocFunc().MoveBlock( aSource, aDest, false, false, false, sal_True );
}
// don't call ScDocument::Sort with an empty SortParam (may be empty here if bCopy is set)
if ( aLocalParam.bDoSort[0] )
pDoc->Sort( nTab, aLocalParam, bRepeatQuery );
- BOOL bSave = TRUE;
+ sal_Bool bSave = sal_True;
if (bCopy)
{
ScSortParam aOldSortParam;
pDBData->GetSortParam( aOldSortParam );
if ( aOldSortParam.bDoSort[0] && aOldSortParam.bInplace ) // Inplace-Sortierung gemerkt?
{
- bSave = FALSE;
+ bSave = false;
aOldSortParam.nDestCol = rSortParam.nDestCol;
aOldSortParam.nDestRow = rSortParam.nDestRow;
aOldSortParam.nDestTab = rSortParam.nDestTab;
@@ -616,7 +616,7 @@ BOOL ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
if (bPaint)
{
- USHORT nPaint = PAINT_GRID;
+ sal_uInt16 nPaint = PAINT_GRID;
SCCOL nStartX = aLocalParam.nCol1;
SCROW nStartY = aLocalParam.nRow1;
SCCOL nEndX = aLocalParam.nCol2;
@@ -646,25 +646,25 @@ BOOL ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
aModificator.SetDocumentModified();
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------
-BOOL ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
- const ScRange* pAdvSource, BOOL bRecord, BOOL bApi )
+sal_Bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
+ const ScRange* pAdvSource, sal_Bool bRecord, sal_Bool bApi )
{
ScDocShellModificator aModificator( rDocShell );
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = FALSE;
+ bRecord = false;
ScDBData* pDBData = pDoc->GetDBAtArea( nTab, rQueryParam.nCol1, rQueryParam.nRow1,
rQueryParam.nCol2, rQueryParam.nRow2 );
if (!pDBData)
{
OSL_FAIL( "Query: keine DBData" );
- return FALSE;
+ return false;
}
// Wechsel von Inplace auf nicht-Inplace, dann erst Inplace aufheben:
@@ -680,23 +680,23 @@ BOOL ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
SCSIZE nEC = aOldQuery.GetEntryCount();
for (SCSIZE i=0; i<nEC; i++)
- aOldQuery.GetEntry(i).bDoQuery = FALSE;
- aOldQuery.bDuplicate = TRUE;
+ aOldQuery.GetEntry(i).bDoQuery = false;
+ aOldQuery.bDuplicate = sal_True;
Query( nTab, aOldQuery, NULL, bRecord, bApi );
}
}
ScQueryParam aLocalParam( rQueryParam ); // fuer Paint / Zielbereich
- BOOL bCopy = !rQueryParam.bInplace; // kopiert wird in Table::Query
+ sal_Bool bCopy = !rQueryParam.bInplace; // kopiert wird in Table::Query
ScDBData* pDestData = NULL; // Bereich, in den kopiert wird
- BOOL bDoSize = FALSE; // Zielgroesse anpassen (einf./loeschen)
+ sal_Bool bDoSize = false; // Zielgroesse anpassen (einf./loeschen)
SCCOL nFormulaCols = 0; // nur bei bDoSize
- BOOL bKeepFmt = FALSE;
+ sal_Bool bKeepFmt = false;
ScRange aOldDest;
ScRange aDestTotal;
if ( bCopy && rQueryParam.nDestCol == rQueryParam.nCol1 &&
rQueryParam.nDestRow == rQueryParam.nRow1 && rQueryParam.nDestTab == nTab )
- bCopy = FALSE;
+ bCopy = false;
SCTAB nDestTab = nTab;
if ( bCopy )
{
@@ -706,7 +706,7 @@ BOOL ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
{
if (!bApi)
rDocShell.ErrorMessage(STR_PASTE_FULL);
- return FALSE;
+ return false;
}
ScEditableTester aTester( pDoc, nDestTab, aLocalParam.nCol1,aLocalParam.nRow1,
@@ -715,11 +715,11 @@ BOOL ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
{
if (!bApi)
rDocShell.ErrorMessage(aTester.GetMessageId());
- return FALSE;
+ return false;
}
pDestData = pDoc->GetDBAtCursor( rQueryParam.nDestCol, rQueryParam.nDestRow,
- rQueryParam.nDestTab, TRUE );
+ rQueryParam.nDestTab, sal_True );
if (pDestData)
{
pDestData->GetArea( aOldDest );
@@ -747,7 +747,7 @@ BOOL ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
{
if (!bApi)
rDocShell.ErrorMessage(STR_MSSG_DOSUBTOTALS_2); // kann keine Zeilen einfuegen
- return FALSE;
+ return false;
}
}
}
@@ -756,14 +756,14 @@ BOOL ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
WaitObject aWait( rDocShell.GetActiveDialogParent() );
- BOOL bKeepSub = FALSE; // bestehende Teilergebnisse wiederholen?
+ sal_Bool bKeepSub = false; // bestehende Teilergebnisse wiederholen?
ScSubTotalParam aSubTotalParam;
if (rQueryParam.GetEntry(0).bDoQuery) // nicht beim Aufheben
{
pDBData->GetSubTotalParam( aSubTotalParam ); // Teilergebnisse vorhanden?
if ( aSubTotalParam.bGroupActive[0] && !aSubTotalParam.bRemoveOnly )
- bKeepSub = TRUE;
+ bKeepSub = sal_True;
}
ScDocument* pUndoDoc = NULL;
@@ -775,23 +775,23 @@ BOOL ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
if (bCopy)
{
- pUndoDoc->InitUndo( pDoc, nDestTab, nDestTab, FALSE, TRUE );
+ pUndoDoc->InitUndo( pDoc, nDestTab, nDestTab, false, sal_True );
pDoc->CopyToDocument( aLocalParam.nCol1, aLocalParam.nRow1, nDestTab,
aLocalParam.nCol2, aLocalParam.nRow2, nDestTab,
- IDF_ALL, FALSE, pUndoDoc );
+ IDF_ALL, false, pUndoDoc );
// Attribute sichern, falls beim Filtern mitkopiert
if (pDestData)
{
- pDoc->CopyToDocument( aOldDest, IDF_ALL, FALSE, pUndoDoc );
+ pDoc->CopyToDocument( aOldDest, IDF_ALL, false, pUndoDoc );
pOld = &aOldDest;
}
}
else
{
- pUndoDoc->InitUndo( pDoc, nTab, nTab, FALSE, TRUE );
+ pUndoDoc->InitUndo( pDoc, nTab, nTab, false, sal_True );
pDoc->CopyToDocument( 0, rQueryParam.nRow1, nTab, MAXCOL, rQueryParam.nRow2, nTab,
- IDF_NONE, FALSE, pUndoDoc );
+ IDF_NONE, false, pUndoDoc );
}
ScDBCollection* pDocDB = pDoc->GetDBCollection();
@@ -818,8 +818,8 @@ BOOL ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
aAttribRange.aEnd.SetCol( aAttribRange.aEnd.Col() + nFormulaCols );
pAttribDoc = new ScDocument( SCDOCMODE_UNDO );
- pAttribDoc->InitUndo( pDoc, nDestTab, nDestTab, FALSE, TRUE );
- pDoc->CopyToDocument( aAttribRange, IDF_ATTRIB, FALSE, pAttribDoc );
+ pAttribDoc->InitUndo( pDoc, nDestTab, nDestTab, false, sal_True );
+ pDoc->CopyToDocument( aAttribRange, IDF_ATTRIB, false, pAttribDoc );
}
if ( bDoSize )
@@ -843,7 +843,7 @@ BOOL ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
ScRange aNewDest( aLocalParam.nCol1, aLocalParam.nRow1, nDestTab,
aLocalParam.nCol2, aLocalParam.nRow2, nDestTab );
- pDoc->FitBlock( aDestTotal, aNewDest, FALSE ); // FALSE - nicht loeschen
+ pDoc->FitBlock( aDestTotal, aNewDest, false ); // sal_False - nicht loeschen
if ( nFormulaCols > 0 )
{
@@ -854,7 +854,7 @@ BOOL ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
aLocalParam.nCol2+nFormulaCols, aLocalParam.nRow2, nDestTab );
ScRange aOldForm = aNewForm;
aOldForm.aEnd.SetRow( aOldDest.aEnd.Row() );
- pDoc->FitBlock( aOldForm, aNewForm, FALSE );
+ pDoc->FitBlock( aOldForm, aNewForm, false );
ScMarkData aMark;
aMark.SelectOneTable(nDestTab);
@@ -873,7 +873,7 @@ BOOL ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
{
ScRange aHdrRange = aAttribRange;
aHdrRange.aEnd.SetRow( aHdrRange.aStart.Row() );
- pAttribDoc->CopyToDocument( aHdrRange, IDF_ATTRIB, FALSE, pDoc );
+ pAttribDoc->CopyToDocument( aHdrRange, IDF_ATTRIB, false, pDoc );
}
// Daten
@@ -902,7 +902,7 @@ BOOL ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
// speichern: Inplace immer, sonst je nach Einstellung
// alter Inplace-Filter ist ggf. schon aufgehoben
- BOOL bSave = rQueryParam.bInplace || rQueryParam.bDestPers;
+ sal_Bool bSave = rQueryParam.bInplace || rQueryParam.bDestPers;
if (bSave) // merken
{
pDBData->SetQueryParam( rQueryParam );
@@ -979,31 +979,31 @@ BOOL ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
PAINT_GRID | PAINT_LEFT );
aModificator.SetDocumentModified();
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------
-BOOL ScDBDocFunc::DoSubTotals( SCTAB nTab, const ScSubTotalParam& rParam,
- const ScSortParam* pForceNewSort, BOOL bRecord, BOOL bApi )
+sal_Bool ScDBDocFunc::DoSubTotals( SCTAB nTab, const ScSubTotalParam& rParam,
+ const ScSortParam* pForceNewSort, sal_Bool bRecord, sal_Bool bApi )
{
//! auch fuer ScDBFunc::DoSubTotals benutzen!
// dann bleibt aussen:
// - neuen Bereich (aus DBData) markieren
// - SelectionChanged (?)
- BOOL bDo = !rParam.bRemoveOnly; // FALSE = nur loeschen
- BOOL bRet = FALSE;
+ sal_Bool bDo = !rParam.bRemoveOnly; // sal_False = nur loeschen
+ sal_Bool bRet = false;
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = FALSE;
+ bRecord = false;
ScDBData* pDBData = pDoc->GetDBAtArea( nTab, rParam.nCol1, rParam.nRow1,
rParam.nCol2, rParam.nRow2 );
if (!pDBData)
{
OSL_FAIL( "SubTotals: keine DBData" );
- return FALSE;
+ return false;
}
ScEditableTester aTester( pDoc, nTab, 0,rParam.nRow1+1, MAXCOL,MAXROW );
@@ -1011,7 +1011,7 @@ BOOL ScDBDocFunc::DoSubTotals( SCTAB nTab, const ScSubTotalParam& rParam,
{
if (!bApi)
rDocShell.ErrorMessage(aTester.GetMessageId());
- return FALSE;
+ return false;
}
if (pDoc->HasAttrib( rParam.nCol1, rParam.nRow1+1, nTab,
@@ -1019,10 +1019,10 @@ BOOL ScDBDocFunc::DoSubTotals( SCTAB nTab, const ScSubTotalParam& rParam,
{
if (!bApi)
rDocShell.ErrorMessage(STR_MSSG_INSERTCELLS_0); // nicht in zusammengefasste einfuegen
- return FALSE;
+ return false;
}
- BOOL bOk = TRUE;
+ sal_Bool bOk = true;
if (rParam.bReplace)
if (pDoc->TestRemoveSubTotals( nTab, rParam ))
{
@@ -1046,7 +1046,7 @@ BOOL ScDBDocFunc::DoSubTotals( SCTAB nTab, const ScSubTotalParam& rParam,
if (bRecord) // alte Daten sichern
{
- BOOL bOldFilter = bDo && rParam.bDoSort;
+ sal_Bool bOldFilter = bDo && rParam.bDoSort;
SCTAB nTabCount = pDoc->GetTableCount();
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
@@ -1061,20 +1061,20 @@ BOOL ScDBDocFunc::DoSubTotals( SCTAB nTab, const ScSubTotalParam& rParam,
pTable->GetColArray()->GetRange( nOutStartCol, nOutEndCol );
pTable->GetRowArray()->GetRange( nOutStartRow, nOutEndRow );
- pUndoDoc->InitUndo( pDoc, nTab, nTab, TRUE, TRUE );
- pDoc->CopyToDocument( static_cast<SCCOL>(nOutStartCol), 0, nTab, static_cast<SCCOL>(nOutEndCol), MAXROW, nTab, IDF_NONE, FALSE, pUndoDoc );
- pDoc->CopyToDocument( 0, nOutStartRow, nTab, MAXCOL, nOutEndRow, nTab, IDF_NONE, FALSE, pUndoDoc );
+ pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_True, sal_True );
+ pDoc->CopyToDocument( static_cast<SCCOL>(nOutStartCol), 0, nTab, static_cast<SCCOL>(nOutEndCol), MAXROW, nTab, IDF_NONE, false, pUndoDoc );
+ pDoc->CopyToDocument( 0, nOutStartRow, nTab, MAXCOL, nOutEndRow, nTab, IDF_NONE, false, pUndoDoc );
}
else
- pUndoDoc->InitUndo( pDoc, nTab, nTab, FALSE, bOldFilter );
+ pUndoDoc->InitUndo( pDoc, nTab, nTab, false, bOldFilter );
// Datenbereich sichern - incl. Filter-Ergebnis
pDoc->CopyToDocument( 0,rParam.nRow1+1,nTab, MAXCOL,rParam.nRow2,nTab,
- IDF_ALL, FALSE, pUndoDoc );
+ IDF_ALL, false, pUndoDoc );
// alle Formeln wegen Referenzen
pDoc->CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTabCount-1,
- IDF_FORMULA, FALSE, pUndoDoc );
+ IDF_FORMULA, false, pUndoDoc );
// DB- und andere Bereiche
ScRangeName* pDocRange = pDoc->GetRangeName();
@@ -1092,7 +1092,7 @@ BOOL ScDBDocFunc::DoSubTotals( SCTAB nTab, const ScSubTotalParam& rParam,
if (rParam.bReplace)
pDoc->RemoveSubTotals( nTab, aNewParam );
- BOOL bSuccess = TRUE;
+ sal_Bool bSuccess = sal_True;
if (bDo)
{
// Sortieren
@@ -1106,7 +1106,7 @@ BOOL ScDBDocFunc::DoSubTotals( SCTAB nTab, const ScSubTotalParam& rParam,
ScSortParam aOldSort;
pDBData->GetSortParam( aOldSort );
ScSortParam aSortParam( aNewParam, pForceNewSort ? *pForceNewSort : aOldSort );
- Sort( nTab, aSortParam, FALSE, FALSE, bApi );
+ Sort( nTab, aSortParam, false, false, bApi );
}
pDoc->InitializeNoteCaptions(nTab);
@@ -1150,7 +1150,7 @@ BOOL ScDBDocFunc::DoSubTotals( SCTAB nTab, const ScSubTotalParam& rParam,
//==================================================================
-BOOL lcl_EmptyExcept( ScDocument* pDoc, const ScRange& rRange, const ScRange& rExcept )
+sal_Bool lcl_EmptyExcept( ScDocument* pDoc, const ScRange& rRange, const ScRange& rExcept )
{
ScCellIterator aIter( pDoc, rRange );
ScBaseCell* pCell = aIter.GetFirst();
@@ -1159,23 +1159,23 @@ BOOL lcl_EmptyExcept( ScDocument* pDoc, const ScRange& rRange, const ScRange& rE
if ( !pCell->IsBlank() ) // real content?
{
if ( !rExcept.In( ScAddress( aIter.GetCol(), aIter.GetRow(), aIter.GetTab() ) ) )
- return FALSE; // cell found
+ return false; // cell found
}
pCell = aIter.GetNext();
}
- return TRUE; // nothing found - empty
+ return sal_True; // nothing found - empty
}
-BOOL ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewObj,
- BOOL bRecord, BOOL bApi, BOOL bAllowMove )
+sal_Bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewObj,
+ sal_Bool bRecord, sal_Bool bApi, sal_Bool bAllowMove )
{
ScDocShellModificator aModificator( rDocShell );
WaitObject aWait( rDocShell.GetActiveDialogParent() );
- BOOL bDone = FALSE;
- BOOL bUndoSelf = FALSE;
- USHORT nErrId = 0;
+ sal_Bool bDone = false;
+ sal_Bool bUndoSelf = false;
+ sal_uInt16 nErrId = 0;
ScDocument* pOldUndoDoc = NULL;
ScDocument* pNewUndoDoc = NULL;
@@ -1185,7 +1185,7 @@ BOOL ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = FALSE;
+ bRecord = false;
if ( !rDocShell.IsEditable() || pDoc->GetChangeTrack() )
{
// not recorded -> disallow
@@ -1226,7 +1226,7 @@ BOOL ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb
{
pOldUndoDoc = new ScDocument( SCDOCMODE_UNDO );
pOldUndoDoc->InitUndo( pDoc, nTab, nTab );
- pDoc->CopyToDocument( aRange, IDF_ALL, FALSE, pOldUndoDoc );
+ pDoc->CopyToDocument( aRange, IDF_ALL, false, pOldUndoDoc );
}
pDoc->DeleteAreaTab( aRange.aStart.Col(), aRange.aStart.Row(),
@@ -1242,7 +1242,7 @@ BOOL ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb
rDocShell.PostPaint( aRange.aStart.Col(), aRange.aStart.Row(), nTab,
aRange.aEnd.Col(), aRange.aEnd.Row(), nTab,
PAINT_GRID );
- bDone = TRUE;
+ bDone = sal_True;
}
else if ( pNewObj )
{
@@ -1254,7 +1254,7 @@ BOOL ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb
SCTAB nTab = aRange.aStart.Tab();
pOldUndoDoc = new ScDocument( SCDOCMODE_UNDO );
pOldUndoDoc->InitUndo( pDoc, nTab, nTab );
- pDoc->CopyToDocument( aRange, IDF_ALL, FALSE, pOldUndoDoc );
+ pDoc->CopyToDocument( aRange, IDF_ALL, false, pOldUndoDoc );
}
if ( pNewObj == pOldObj )
@@ -1286,7 +1286,7 @@ BOOL ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb
if ( pDoc->GetDPCollection()->GetByName(pDestObj->GetName()) )
pDestObj->SetName( String() ); // ignore the invalid name, create a new name below
- pDestObj->SetAlive(TRUE);
+ pDestObj->SetAlive(sal_True);
if ( !pDoc->GetDPCollection()->InsertNewTable(pDestObj) )
{
OSL_FAIL("cannot insert DPObject");
@@ -1321,7 +1321,7 @@ BOOL ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb
aNewOut.aStart.SetRow( aOldRange.aStart.Row() );
aNewOut.aEnd.SetRow( aNewOut.aEnd.Row()+nDiff );
if( !ValidRow( aNewOut.aStart.Row() ) || !ValidRow( aNewOut.aEnd.Row() ) )
- bOverflow = TRUE;
+ bOverflow = sal_True;
}
}
@@ -1329,7 +1329,7 @@ BOOL ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb
{
// like with STR_PROTECTIONERR, use undo to reverse everything
DBG_ASSERT( bRecord, "DataPilotUpdate: can't undo" );
- bUndoSelf = TRUE;
+ bUndoSelf = sal_True;
nErrId = STR_PIVOT_ERROR;
}
else
@@ -1343,7 +1343,7 @@ BOOL ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb
// quick solution: proceed to end, use undo action
// to reverse everything:
DBG_ASSERT( bRecord, "DataPilotUpdate: can't undo" );
- bUndoSelf = TRUE;
+ bUndoSelf = sal_True;
nErrId = aTester.GetMessageId();
}
}
@@ -1351,7 +1351,7 @@ BOOL ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb
// test if new output area is empty except for old area
if ( !bApi )
{
- BOOL bEmpty;
+ sal_Bool bEmpty;
if ( pOldObj ) // OutRange of pOldObj (pDestObj) is still old area
bEmpty = lcl_EmptyExcept( pDoc, aNewOut, pOldObj->GetOutRange() );
else
@@ -1367,7 +1367,7 @@ BOOL ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb
{
//! like above (not editable), use undo to reverse everything
DBG_ASSERT( bRecord, "DataPilotUpdate: can't undo" );
- bUndoSelf = TRUE;
+ bUndoSelf = sal_True;
}
}
}
@@ -1377,13 +1377,13 @@ BOOL ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb
SCTAB nTab = aNewOut.aStart.Tab();
pNewUndoDoc = new ScDocument( SCDOCMODE_UNDO );
pNewUndoDoc->InitUndo( pDoc, nTab, nTab );
- pDoc->CopyToDocument( aNewOut, IDF_ALL, FALSE, pNewUndoDoc );
+ pDoc->CopyToDocument( aNewOut, IDF_ALL, false, pNewUndoDoc );
}
pDestObj->Output( aNewOut.aStart );
rDocShell.PostPaintGridAll(); //! only necessary parts
- bDone = TRUE;
+ bDone = sal_True;
}
}
// else nothing (no old, no new)
@@ -1404,7 +1404,7 @@ BOOL ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb
pAction->Undo();
delete pAction;
- bDone = FALSE;
+ bDone = false;
}
else
rDocShell.GetUndoManager()->AddUndoAction( pAction );
@@ -1433,8 +1433,8 @@ BOOL ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb
// Datenbank-Import...
void ScDBDocFunc::UpdateImport( const String& rTarget, const String& rDBName,
- const String& rTableName, const String& rStatement, BOOL bNative,
- BYTE nType, const ::com::sun::star::uno::Reference<
+ const String& rTableName, const String& rStatement, sal_Bool bNative,
+ sal_uInt8 nType, const ::com::sun::star::uno::Reference<
::com::sun::star::sdbc::XResultSet >& xResultSet,
const SbaSelectionList* pSelection )
{
@@ -1444,13 +1444,13 @@ void ScDBDocFunc::UpdateImport( const String& rTarget, const String& rDBName,
ScDBCollection& rDBColl = *pDoc->GetDBCollection();
ScDBData* pData = NULL;
ScImportParam aImportParam;
- BOOL bFound = FALSE;
- USHORT nCount = rDBColl.GetCount();
- for (USHORT i=0; i<nCount && !bFound; i++)
+ sal_Bool bFound = false;
+ sal_uInt16 nCount = rDBColl.GetCount();
+ for (sal_uInt16 i=0; i<nCount && !bFound; i++)
{
pData = rDBColl[i];
if (pData->GetName() == rTarget)
- bFound = TRUE;
+ bFound = sal_True;
}
if (!bFound)
{
@@ -1466,15 +1466,15 @@ void ScDBDocFunc::UpdateImport( const String& rTarget, const String& rDBName,
pData->GetArea( nTab, nDummyCol,nDummyRow,nDummyCol,nDummyRow );
pData->GetImportParam( aImportParam );
- BOOL bSql = ( rStatement.Len() != 0 );
+ sal_Bool bSql = ( rStatement.Len() != 0 );
aImportParam.aDBName = rDBName;
aImportParam.bSql = bSql;
aImportParam.aStatement = bSql ? rStatement : rTableName;
aImportParam.bNative = bNative;
aImportParam.nType = nType;
- aImportParam.bImport = TRUE;
- BOOL bContinue = DoImport( nTab, aImportParam, xResultSet, pSelection, TRUE );
+ aImportParam.bImport = sal_True;
+ sal_Bool bContinue = DoImport( nTab, aImportParam, xResultSet, pSelection, sal_True );
// DB-Operationen wiederholen
diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx
index 92c411ea5638..fb5951338e37 100644
--- a/sc/source/ui/docshell/dbdocimp.cxx
+++ b/sc/source/ui/docshell/dbdocimp.cxx
@@ -119,15 +119,15 @@ void ScDBDocFunc::ShowInBeamer( const ScImportParam& rParam, SfxViewFrame* pFram
// -----------------------------------------------------------------
-BOOL ScDBDocFunc::DoImportUno( const ScAddress& rPos,
+sal_Bool ScDBDocFunc::DoImportUno( const ScAddress& rPos,
const uno::Sequence<beans::PropertyValue>& aArgs )
{
- BOOL bDone = FALSE;
+ sal_Bool bDone = false;
ScImportParam aImParam;
aImParam.nCol1 = aImParam.nCol2 = rPos.Col();
aImParam.nRow1 = aImParam.nRow2 = rPos.Row();
- aImParam.bImport = TRUE;
+ aImParam.bImport = sal_True;
uno::Reference<sdbc::XResultSet> xResSet;
uno::Sequence<uno::Any> aSelection;
@@ -157,7 +157,7 @@ BOOL ScDBDocFunc::DoImportUno( const ScAddress& rPos,
if ( rProp.Value >>= nType )
{
aImParam.bSql = ( nType == sdb::CommandType::COMMAND );
- aImParam.nType = sal::static_int_cast<BYTE>( ( nType == sdb::CommandType::QUERY ) ? ScDbQuery : ScDbTable );
+ aImParam.nType = sal::static_int_cast<sal_uInt8>( ( nType == sdb::CommandType::QUERY ) ? ScDbQuery : ScDbTable );
// nType is ignored if bSql is set
}
}
@@ -180,10 +180,10 @@ BOOL ScDBDocFunc::DoImportUno( const ScAddress& rPos,
aList.Insert( (void*)(sal_IntPtr)nEntry, LIST_APPEND );
}
- BOOL bAddrInsert = FALSE; //!???
+ sal_Bool bAddrInsert = false; //!???
if ( bAddrInsert )
{
- bDone = DoImport( rPos.Tab(), aImParam, xResSet, &aList, TRUE, bAddrInsert );
+ bDone = DoImport( rPos.Tab(), aImParam, xResSet, &aList, sal_True, bAddrInsert );
}
else
{
@@ -204,7 +204,7 @@ BOOL ScDBDocFunc::DoImportUno( const ScAddress& rPos,
UpdateImport( sTarget, aImParam.aDBName, aTableName, aStatement,
aImParam.bNative, aImParam.nType, xResSet, &aList );
- bDone = TRUE;
+ bDone = sal_True;
}
return bDone;
@@ -212,16 +212,16 @@ BOOL ScDBDocFunc::DoImportUno( const ScAddress& rPos,
// -----------------------------------------------------------------
-BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
+sal_Bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
const uno::Reference< sdbc::XResultSet >& xResultSet,
- const SbaSelectionList* pSelection, BOOL bRecord, BOOL bAddrInsert )
+ const SbaSelectionList* pSelection, sal_Bool bRecord, sal_Bool bAddrInsert )
{
ScDocument* pDoc = rDocShell.GetDocument();
ScChangeTrack *pChangeTrack = NULL;
ScRange aChangedRange;
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = FALSE;
+ bRecord = false;
ScDBData* pDBData = 0;
if ( !bAddrInsert )
@@ -231,7 +231,7 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
if (!pDBData)
{
OSL_FAIL( "DoImport: no DBData" );
- return FALSE;
+ return false;
}
}
@@ -240,10 +240,10 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
pWaitWin->EnterWait();
ScDocShellModificator aModificator( rDocShell );
- BOOL bSuccess = FALSE;
- BOOL bApi = FALSE; //! pass as argument
- BOOL bTruncated = FALSE; // for warning
- USHORT nErrStringId = 0;
+ sal_Bool bSuccess = false;
+ sal_Bool bApi = false; //! pass as argument
+ sal_Bool bTruncated = false; // for warning
+ sal_uInt16 nErrStringId = 0;
String aErrorMessage;
SCCOL nCol = rParam.nCol1;
@@ -252,16 +252,16 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
SCROW nEndRow = nRow;
long i;
- BOOL bDoSelection = FALSE;
- BOOL bRealSelection = FALSE; // TRUE if not everything is selected
- ULONG nListPos = 0;
- ULONG nRowsRead = 0;
- ULONG nListCount = 0;
+ sal_Bool bDoSelection = false;
+ sal_Bool bRealSelection = false; // sal_True if not everything is selected
+ sal_uLong nListPos = 0;
+ sal_uLong nRowsRead = 0;
+ sal_uLong nListCount = 0;
// -1 is special
if ( pSelection && pSelection->Count() && (long)pSelection->GetObject(0) != -1L )
{
- bDoSelection = TRUE;
+ bDoSelection = sal_True;
nListCount = pSelection->Count();
}
@@ -282,7 +282,7 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
uno::Reference<sdbc::XRowSet> xRowSet = uno::Reference<sdbc::XRowSet>(
xResultSet, uno::UNO_QUERY );
- sal_Bool bDispose = sal_False;
+ sal_Bool bDispose = false;
if ( !xRowSet.is() )
{
bDispose = sal_True;
@@ -375,32 +375,32 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
++nRow;
}
- BOOL bEnd = FALSE;
+ sal_Bool bEnd = false;
if ( !bDoSelection )
xRowSet->beforeFirst();
- USHORT nInserted = 0;
+ sal_uInt16 nInserted = 0;
while ( !bEnd )
{
// skip rows that are not selected
if ( !bDoSelection )
{
- if ( (bEnd = !xRowSet->next()) == FALSE )
+ if ( (bEnd = !xRowSet->next()) == false )
++nRowsRead;
}
else
{
if (nListPos < nListCount)
{
- ULONG nNextRow = (ULONG) pSelection->GetObject(nListPos);
+ sal_uLong nNextRow = (sal_uLong) pSelection->GetObject(nListPos);
if ( nRowsRead+1 < nNextRow )
- bRealSelection = TRUE;
+ bRealSelection = sal_True;
bEnd = !xRowSet->absolute(nRowsRead = nNextRow);
++nListPos;
}
else
{
bRealSelection = xRowSet->next();
- bEnd = TRUE; // more data available but not used
+ bEnd = sal_True; // more data available but not used
}
}
@@ -430,21 +430,21 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
if (!aProgress.SetStateText( 0, aText )) // stopped by user?
{
- bEnd = TRUE;
- bSuccess = FALSE;
+ bEnd = sal_True;
+ bSuccess = false;
nErrStringId = STR_DATABASE_ABORTED;
}
}
}
else // past the end of the spreadsheet
{
- bEnd = TRUE; // don't continue
- bTruncated = TRUE; // warning flag
+ bEnd = sal_True; // don't continue
+ bTruncated = sal_True; // warning flag
}
}
}
- bSuccess = TRUE;
+ bSuccess = sal_True;
}
if ( bDispose )
@@ -466,8 +466,8 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
// test for cell protection
//
- BOOL bKeepFormat = !bAddrInsert && pDBData->IsKeepFmt();
- BOOL bMoveCells = !bAddrInsert && pDBData->IsDoSize();
+ sal_Bool bKeepFormat = !bAddrInsert && pDBData->IsKeepFmt();
+ sal_Bool bMoveCells = !bAddrInsert && pDBData->IsDoSize();
SCCOL nFormulaCols = 0; // columns to be filled with formulas
if (bMoveCells && nEndCol == rParam.nCol2)
{
@@ -490,7 +490,7 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
if ( !aTester.IsEditable() )
{
nErrStringId = aTester.GetMessageId();
- bSuccess = FALSE;
+ bSuccess = false;
}
else if ( (pChangeTrack = pDoc->GetChangeTrack()) != NULL )
aChangedRange = ScRange(rParam.nCol1, rParam.nRow1, nTab,
@@ -506,7 +506,7 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
if (!pDoc->CanFitBlock( aOld, aNew ))
{
nErrStringId = STR_MSSG_DOSUBTOTALS_2; // can't insert cells
- bSuccess = FALSE;
+ bSuccess = false;
}
}
@@ -526,7 +526,7 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
pImportDoc->DeleteAreaTab( 0,0, MAXCOL,MAXROW, nTab, IDF_ATTRIB );
pDoc->CopyToDocument( rParam.nCol1, rParam.nRow1, nTab,
nMinEndCol, rParam.nRow1, nTab,
- IDF_ATTRIB, FALSE, pImportDoc );
+ IDF_ATTRIB, false, pImportDoc );
SCROW nDataStartRow = rParam.nRow1+1;
for (SCCOL nCopyCol=rParam.nCol1; nCopyCol<=nMinEndCol; nCopyCol++)
@@ -546,7 +546,7 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
if (pDoc->IsTabProtected(nTab))
{
ScPatternAttr aPattern(pImportDoc->GetPool());
- aPattern.GetItemSet().Put( ScProtectionAttr( FALSE,FALSE,FALSE,FALSE ) );
+ aPattern.GetItemSet().Put( ScProtectionAttr( false,false,false,false ) );
pImportDoc->ApplyPatternAreaTab( 0,0,MAXCOL,MAXROW, nTab, aPattern );
}
@@ -579,15 +579,15 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
// nFormulaCols is set only if column count is unchanged
pDoc->CopyToDocument( rParam.nCol1, rParam.nRow1, nTab,
nEndCol+nFormulaCols, nEndRow, nTab,
- nCopyFlags, FALSE, pUndoDoc );
+ nCopyFlags, false, pUndoDoc );
if ( rParam.nCol2 > nEndCol )
pDoc->CopyToDocument( nEndCol+1, rParam.nRow1, nTab,
nUndoEndCol, nUndoEndRow, nTab,
- nCopyFlags, FALSE, pUndoDoc );
+ nCopyFlags, false, pUndoDoc );
if ( rParam.nRow2 > nEndRow )
pDoc->CopyToDocument( rParam.nCol1, nEndRow+1, nTab,
nUndoEndCol+nFormulaCols, nUndoEndRow, nTab,
- nCopyFlags, FALSE, pUndoDoc );
+ nCopyFlags, false, pUndoDoc );
}
//
@@ -607,7 +607,7 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
rParam.nCol2+nFormulaCols, rParam.nRow2, nTab );
ScRange aNew( rParam.nCol1, rParam.nRow1, nTab,
nEndCol+nFormulaCols, nEndRow, nTab );
- pDoc->FitBlock( aOld, aNew, FALSE ); // Formeln nicht loeschen
+ pDoc->FitBlock( aOld, aNew, false ); // Formeln nicht loeschen
}
else if ( nEndCol < rParam.nCol2 ) // DeleteArea calls PutInOrder
pDoc->DeleteArea( nEndCol+1, rParam.nRow1, rParam.nCol2, rParam.nRow2,
@@ -617,12 +617,12 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
pDoc->DeleteAreaTab( rParam.nCol1, rParam.nRow1, nEndCol, nEndRow, nTab, IDF_CONTENTS & ~IDF_NOTE );
// remove each column from ImportDoc after copying to reduce memory usage
- BOOL bOldAutoCalc = pDoc->GetAutoCalc();
- pDoc->SetAutoCalc( FALSE ); // outside of the loop
+ sal_Bool bOldAutoCalc = pDoc->GetAutoCalc();
+ pDoc->SetAutoCalc( false ); // outside of the loop
for (SCCOL nCopyCol = rParam.nCol1; nCopyCol <= nEndCol; nCopyCol++)
{
pImportDoc->CopyToDocument( nCopyCol, rParam.nRow1, nTab, nCopyCol, nEndRow, nTab,
- IDF_ALL, FALSE, pDoc );
+ IDF_ALL, false, pDoc );
pImportDoc->DeleteAreaTab( nCopyCol, rParam.nRow1, nCopyCol, nEndRow, nTab, IDF_CONTENTS );
pImportDoc->DoColResize( nTab, nCopyCol, nCopyCol, 0 );
}
@@ -633,7 +633,7 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
if (bKeepFormat) // formats for formulas
pImportDoc->CopyToDocument( nEndCol+1, rParam.nRow1, nTab,
nEndCol+nFormulaCols, nEndRow, nTab,
- IDF_ATTRIB, FALSE, pDoc );
+ IDF_ATTRIB, false, pDoc );
// fill formulas
ScMarkData aMark;
aMark.SelectOneTable(nTab);
@@ -656,8 +656,8 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
if( !bAddrInsert ) // update database range
{
pDBData->SetImportParam( rParam );
- pDBData->SetHeader( TRUE );
- pDBData->SetByRow( TRUE );
+ pDBData->SetHeader( sal_True );
+ pDBData->SetByRow( sal_True );
pDBData->SetArea( nTab, rParam.nCol1,rParam.nRow1, nEndCol,nEndRow );
pDBData->SetImportSelection( bRealSelection );
pDoc->CompileDBFormula();
@@ -671,7 +671,7 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
if (nFormulaCols > 0) // include filled formulas for redo
pDoc->CopyToDocument( rParam.nCol1, rParam.nRow1, nTab,
nEndCol+nFormulaCols, nEndRow, nTab,
- IDF_ALL & ~IDF_NOTE, FALSE, pRedoDoc );
+ IDF_ALL & ~IDF_NOTE, false, pRedoDoc );
ScDBData* pRedoDBData = pDBData ? new ScDBData( *pDBData ) : NULL;
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 5ad00f2a8f55..ac589ccba498 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -131,7 +131,7 @@ IMPL_LINK( ScDocFunc, NotifyDrawUndo, SdrUndoAction*, pUndoAction )
SCTAB nTabCount = pDoc->GetTableCount();
for (SCTAB nTab=0; nTab<nTabCount; nTab++)
if (pDoc->IsStreamValid(nTab))
- pDoc->SetStreamValid(nTab, FALSE);
+ pDoc->SetStreamValid(nTab, false);
return 0;
}
@@ -153,17 +153,17 @@ void lcl_PaintAbove( ScDocShell& rDocShell, const ScRange& rRange )
//------------------------------------------------------------------------
-BOOL ScDocFunc::AdjustRowHeight( const ScRange& rRange, BOOL bPaint )
+sal_Bool ScDocFunc::AdjustRowHeight( const ScRange& rRange, sal_Bool bPaint )
{
ScDocument* pDoc = rDocShell.GetDocument();
if ( pDoc->IsImportingXML() )
{
// for XML import, all row heights are updated together after importing
- return FALSE;
+ return false;
}
if ( !pDoc->IsAdjustHeightEnabled() )
{
- return FALSE;
+ return false;
}
SCTAB nTab = rRange.aStart.Tab();
@@ -173,8 +173,8 @@ BOOL ScDocFunc::AdjustRowHeight( const ScRange& rRange, BOOL bPaint )
ScSizeDeviceProvider aProv( &rDocShell );
Fraction aOne(1,1);
- BOOL bChanged = pDoc->SetOptimalHeight( nStartRow, nEndRow, nTab, 0, aProv.GetDevice(),
- aProv.GetPPTX(), aProv.GetPPTY(), aOne, aOne, FALSE );
+ sal_Bool bChanged = pDoc->SetOptimalHeight( nStartRow, nEndRow, nTab, 0, aProv.GetDevice(),
+ aProv.GetPPTX(), aProv.GetPPTY(), aOne, aOne, false );
if ( bPaint && bChanged )
rDocShell.PostPaint( 0, nStartRow, nTab, MAXCOL, MAXROW, nTab,
@@ -186,13 +186,13 @@ BOOL ScDocFunc::AdjustRowHeight( const ScRange& rRange, BOOL bPaint )
//------------------------------------------------------------------------
-BOOL ScDocFunc::DetectiveAddPred(const ScAddress& rPos)
+sal_Bool ScDocFunc::DetectiveAddPred(const ScAddress& rPos)
{
ScDocShellModificator aModificator( rDocShell );
rDocShell.MakeDrawLayer();
ScDocument* pDoc = rDocShell.GetDocument();
- BOOL bUndo (pDoc->IsUndoEnabled());
+ sal_Bool bUndo (pDoc->IsUndoEnabled());
ScDrawLayer* pModel = pDoc->GetDrawLayer();
SCCOL nCol = rPos.Col();
SCROW nRow = rPos.Row();
@@ -200,7 +200,7 @@ BOOL ScDocFunc::DetectiveAddPred(const ScAddress& rPos)
if (bUndo)
pModel->BeginCalcUndo();
- BOOL bDone = ScDetectiveFunc( pDoc,nTab ).ShowPred( nCol, nRow );
+ sal_Bool bDone = ScDetectiveFunc( pDoc,nTab ).ShowPred( nCol, nRow );
SdrUndoGroup* pUndo = NULL;
if (bUndo)
pUndo = pModel->GetCalcUndo();
@@ -224,14 +224,14 @@ BOOL ScDocFunc::DetectiveAddPred(const ScAddress& rPos)
return bDone;
}
-BOOL ScDocFunc::DetectiveDelPred(const ScAddress& rPos)
+sal_Bool ScDocFunc::DetectiveDelPred(const ScAddress& rPos)
{
ScDocument* pDoc = rDocShell.GetDocument();
- BOOL bUndo(pDoc->IsUndoEnabled());
+ sal_Bool bUndo(pDoc->IsUndoEnabled());
ScDrawLayer* pModel = pDoc->GetDrawLayer();
if (!pModel)
- return FALSE;
+ return false;
ScDocShellModificator aModificator( rDocShell );
@@ -241,7 +241,7 @@ BOOL ScDocFunc::DetectiveDelPred(const ScAddress& rPos)
if (bUndo)
pModel->BeginCalcUndo();
- BOOL bDone = ScDetectiveFunc( pDoc,nTab ).DeletePred( nCol, nRow );
+ sal_Bool bDone = ScDetectiveFunc( pDoc,nTab ).DeletePred( nCol, nRow );
SdrUndoGroup* pUndo = NULL;
if (bUndo)
pUndo = pModel->GetCalcUndo();
@@ -265,14 +265,14 @@ BOOL ScDocFunc::DetectiveDelPred(const ScAddress& rPos)
return bDone;
}
-BOOL ScDocFunc::DetectiveAddSucc(const ScAddress& rPos)
+sal_Bool ScDocFunc::DetectiveAddSucc(const ScAddress& rPos)
{
ScDocShellModificator aModificator( rDocShell );
rDocShell.MakeDrawLayer();
ScDocument* pDoc = rDocShell.GetDocument();
- BOOL bUndo(pDoc->IsUndoEnabled());
+ sal_Bool bUndo(pDoc->IsUndoEnabled());
ScDrawLayer* pModel = pDoc->GetDrawLayer();
SCCOL nCol = rPos.Col();
SCROW nRow = rPos.Row();
@@ -280,7 +280,7 @@ BOOL ScDocFunc::DetectiveAddSucc(const ScAddress& rPos)
if (bUndo)
pModel->BeginCalcUndo();
- BOOL bDone = ScDetectiveFunc( pDoc,nTab ).ShowSucc( nCol, nRow );
+ sal_Bool bDone = ScDetectiveFunc( pDoc,nTab ).ShowSucc( nCol, nRow );
SdrUndoGroup* pUndo = NULL;
if (bUndo)
pUndo = pModel->GetCalcUndo();
@@ -304,14 +304,14 @@ BOOL ScDocFunc::DetectiveAddSucc(const ScAddress& rPos)
return bDone;
}
-BOOL ScDocFunc::DetectiveDelSucc(const ScAddress& rPos)
+sal_Bool ScDocFunc::DetectiveDelSucc(const ScAddress& rPos)
{
ScDocument* pDoc = rDocShell.GetDocument();
- BOOL bUndo (pDoc->IsUndoEnabled());
+ sal_Bool bUndo (pDoc->IsUndoEnabled());
ScDrawLayer* pModel = pDoc->GetDrawLayer();
if (!pModel)
- return FALSE;
+ return false;
ScDocShellModificator aModificator( rDocShell );
@@ -321,7 +321,7 @@ BOOL ScDocFunc::DetectiveDelSucc(const ScAddress& rPos)
if (bUndo)
pModel->BeginCalcUndo();
- BOOL bDone = ScDetectiveFunc( pDoc,nTab ).DeleteSucc( nCol, nRow );
+ sal_Bool bDone = ScDetectiveFunc( pDoc,nTab ).DeleteSucc( nCol, nRow );
SdrUndoGroup* pUndo = NULL;
if (bUndo)
pUndo = pModel->GetCalcUndo();
@@ -345,14 +345,14 @@ BOOL ScDocFunc::DetectiveDelSucc(const ScAddress& rPos)
return bDone;
}
-BOOL ScDocFunc::DetectiveAddError(const ScAddress& rPos)
+sal_Bool ScDocFunc::DetectiveAddError(const ScAddress& rPos)
{
ScDocShellModificator aModificator( rDocShell );
rDocShell.MakeDrawLayer();
ScDocument* pDoc = rDocShell.GetDocument();
- BOOL bUndo (pDoc->IsUndoEnabled());
+ sal_Bool bUndo (pDoc->IsUndoEnabled());
ScDrawLayer* pModel = pDoc->GetDrawLayer();
SCCOL nCol = rPos.Col();
SCROW nRow = rPos.Row();
@@ -360,7 +360,7 @@ BOOL ScDocFunc::DetectiveAddError(const ScAddress& rPos)
if (bUndo)
pModel->BeginCalcUndo();
- BOOL bDone = ScDetectiveFunc( pDoc,nTab ).ShowError( nCol, nRow );
+ sal_Bool bDone = ScDetectiveFunc( pDoc,nTab ).ShowError( nCol, nRow );
SdrUndoGroup* pUndo = NULL;
if (bUndo)
pUndo = pModel->GetCalcUndo();
@@ -384,14 +384,14 @@ BOOL ScDocFunc::DetectiveAddError(const ScAddress& rPos)
return bDone;
}
-BOOL ScDocFunc::DetectiveMarkInvalid(SCTAB nTab)
+sal_Bool ScDocFunc::DetectiveMarkInvalid(SCTAB nTab)
{
ScDocShellModificator aModificator( rDocShell );
rDocShell.MakeDrawLayer();
ScDocument* pDoc = rDocShell.GetDocument();
- BOOL bUndo (pDoc->IsUndoEnabled());
+ sal_Bool bUndo (pDoc->IsUndoEnabled());
ScDrawLayer* pModel = pDoc->GetDrawLayer();
Window* pWaitWin = rDocShell.GetActiveDialogParent();
@@ -399,8 +399,8 @@ BOOL ScDocFunc::DetectiveMarkInvalid(SCTAB nTab)
pWaitWin->EnterWait();
if (bUndo)
pModel->BeginCalcUndo();
- BOOL bOverflow;
- BOOL bDone = ScDetectiveFunc( pDoc,nTab ).MarkInvalid( bOverflow );
+ sal_Bool bOverflow;
+ sal_Bool bDone = ScDetectiveFunc( pDoc,nTab ).MarkInvalid( bOverflow );
SdrUndoGroup* pUndo = NULL;
if (bUndo)
pUndo = pModel->GetCalcUndo();
@@ -426,20 +426,20 @@ BOOL ScDocFunc::DetectiveMarkInvalid(SCTAB nTab)
return bDone;
}
-BOOL ScDocFunc::DetectiveDelAll(SCTAB nTab)
+sal_Bool ScDocFunc::DetectiveDelAll(SCTAB nTab)
{
ScDocument* pDoc = rDocShell.GetDocument();
- BOOL bUndo (pDoc->IsUndoEnabled());
+ sal_Bool bUndo (pDoc->IsUndoEnabled());
ScDrawLayer* pModel = pDoc->GetDrawLayer();
if (!pModel)
- return FALSE;
+ return false;
ScDocShellModificator aModificator( rDocShell );
if (bUndo)
pModel->BeginCalcUndo();
- BOOL bDone = ScDetectiveFunc( pDoc,nTab ).DeleteAll( SC_DET_DETECTIVE );
+ sal_Bool bDone = ScDetectiveFunc( pDoc,nTab ).DeleteAll( SC_DET_DETECTIVE );
SdrUndoGroup* pUndo = NULL;
if (bUndo)
pUndo = pModel->GetCalcUndo();
@@ -468,12 +468,12 @@ BOOL ScDocFunc::DetectiveDelAll(SCTAB nTab)
return bDone;
}
-BOOL ScDocFunc::DetectiveRefresh( BOOL bAutomatic )
+sal_Bool ScDocFunc::DetectiveRefresh( sal_Bool bAutomatic )
{
- BOOL bDone = FALSE;
+ sal_Bool bDone = false;
ScDocument* pDoc = rDocShell.GetDocument();
- BOOL bUndo (pDoc->IsUndoEnabled());
+ sal_Bool bUndo (pDoc->IsUndoEnabled());
ScDetOpList* pList = pDoc->GetDetOpList();
if ( pList && pList->Count() )
{
@@ -490,8 +490,8 @@ BOOL ScDocFunc::DetectiveRefresh( BOOL bAutomatic )
// Wiederholen
- USHORT nCount = pList->Count();
- for (USHORT i=0; i<nCount; i++)
+ sal_uInt16 nCount = pList->Count();
+ for (sal_uInt16 i=0; i<nCount; i++)
{
ScDetOpData* pData = (*pList)[i];
if (pData)
@@ -536,7 +536,7 @@ BOOL ScDocFunc::DetectiveRefresh( BOOL bAutomatic )
}
}
rDocShell.SetDrawModified();
- bDone = TRUE;
+ bDone = sal_True;
}
return bDone;
}
@@ -582,38 +582,38 @@ void ScDocFunc::DetectiveCollectAllSuccs(const ScRangeList& rSrcRanges, vector<S
//------------------------------------------------------------------------
-BOOL ScDocFunc::DeleteContents( const ScMarkData& rMark, USHORT nFlags,
- BOOL bRecord, BOOL bApi )
+sal_Bool ScDocFunc::DeleteContents( const ScMarkData& rMark, sal_uInt16 nFlags,
+ sal_Bool bRecord, sal_Bool bApi )
{
ScDocShellModificator aModificator( rDocShell );
if ( !rMark.IsMarked() && !rMark.IsMultiMarked() )
{
OSL_FAIL("ScDocFunc::DeleteContents ohne Markierung");
- return FALSE;
+ return false;
}
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = FALSE;
+ bRecord = false;
ScEditableTester aTester( pDoc, rMark );
if (!aTester.IsEditable())
{
if (!bApi)
rDocShell.ErrorMessage(aTester.GetMessageId());
- return FALSE;
+ return false;
}
ScRange aMarkRange;
- BOOL bSimple = FALSE;
+ sal_Bool bSimple = false;
ScMarkData aMultiMark = rMark;
- aMultiMark.SetMarking(FALSE); // fuer MarkToMulti
+ aMultiMark.SetMarking(false); // fuer MarkToMulti
ScDocument* pUndoDoc = NULL;
- BOOL bMulti = !bSimple && aMultiMark.IsMultiMarked();
+ sal_Bool bMulti = !bSimple && aMultiMark.IsMultiMarked();
if (!bSimple)
{
aMultiMark.MarkToMulti();
@@ -622,22 +622,22 @@ BOOL ScDocFunc::DeleteContents( const ScMarkData& rMark, USHORT nFlags,
ScRange aExtendedRange(aMarkRange);
if (!bSimple)
{
- if ( pDoc->ExtendMerge( aExtendedRange, TRUE ) )
- bMulti = FALSE;
+ if ( pDoc->ExtendMerge( aExtendedRange, sal_True ) )
+ bMulti = false;
}
// keine Objekte auf geschuetzten Tabellen
- BOOL bObjects = FALSE;
+ sal_Bool bObjects = false;
if ( nFlags & IDF_OBJECTS )
{
- bObjects = TRUE;
+ bObjects = sal_True;
SCTAB nTabCount = pDoc->GetTableCount();
for (SCTAB nTab=0; nTab<nTabCount; nTab++)
if (aMultiMark.GetTableSelect(nTab) && pDoc->IsTabProtected(nTab))
- bObjects = FALSE;
+ bObjects = false;
}
- USHORT nExtFlags = 0; // extra flags are needed only if attributes are deleted
+ sal_uInt16 nExtFlags = 0; // extra flags are needed only if attributes are deleted
if ( nFlags & IDF_ATTRIB )
rDocShell.UpdatePaintExt( nExtFlags, aMarkRange );
@@ -668,7 +668,7 @@ BOOL ScDocFunc::DeleteContents( const ScMarkData& rMark, USHORT nFlags,
// bei "Format/Standard" alle Attribute kopieren, weil CopyToDocument
// nur mit IDF_HARDATTR zu langsam ist:
- USHORT nUndoDocFlags = nFlags;
+ sal_uInt16 nUndoDocFlags = nFlags;
if (nFlags & IDF_ATTRIB)
nUndoDocFlags |= IDF_ATTRIB;
if (nFlags & IDF_EDITATTR) // Edit-Engine-Attribute
@@ -703,31 +703,31 @@ BOOL ScDocFunc::DeleteContents( const ScMarkData& rMark, USHORT nFlags,
aModificator.SetDocumentModified();
- return TRUE;
+ return sal_True;
}
//------------------------------------------------------------------------
-BOOL ScDocFunc::TransliterateText( const ScMarkData& rMark, sal_Int32 nType,
- BOOL bRecord, BOOL bApi )
+sal_Bool ScDocFunc::TransliterateText( const ScMarkData& rMark, sal_Int32 nType,
+ sal_Bool bRecord, sal_Bool bApi )
{
ScDocShellModificator aModificator( rDocShell );
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = FALSE;
+ bRecord = false;
ScEditableTester aTester( pDoc, rMark );
if (!aTester.IsEditable())
{
if (!bApi)
rDocShell.ErrorMessage(aTester.GetMessageId());
- return FALSE;
+ return false;
}
ScRange aMarkRange;
ScMarkData aMultiMark = rMark;
- aMultiMark.SetMarking(FALSE); // for MarkToMulti
+ aMultiMark.SetMarking(false); // for MarkToMulti
aMultiMark.MarkToMulti();
aMultiMark.GetMultiMarkArea( aMarkRange );
@@ -745,7 +745,7 @@ BOOL ScDocFunc::TransliterateText( const ScMarkData& rMark, sal_Int32 nType,
ScRange aCopyRange = aMarkRange;
aCopyRange.aStart.SetTab(0);
aCopyRange.aEnd.SetTab(nTabCount-1);
- pDoc->CopyToDocument( aCopyRange, IDF_CONTENTS, TRUE, pUndoDoc, &aMultiMark );
+ pDoc->CopyToDocument( aCopyRange, IDF_CONTENTS, sal_True, pUndoDoc, &aMultiMark );
rDocShell.GetUndoManager()->AddUndoAction(
new ScUndoTransliterate( &rDocShell, aMultiMark, pUndoDoc, nType ) );
@@ -758,31 +758,31 @@ BOOL ScDocFunc::TransliterateText( const ScMarkData& rMark, sal_Int32 nType,
aModificator.SetDocumentModified();
- return TRUE;
+ return sal_True;
}
//------------------------------------------------------------------------
-BOOL ScDocFunc::SetNormalString( const ScAddress& rPos, const String& rText, BOOL bApi )
+sal_Bool ScDocFunc::SetNormalString( const ScAddress& rPos, const String& rText, sal_Bool bApi )
{
ScDocShellModificator aModificator( rDocShell );
ScDocument* pDoc = rDocShell.GetDocument();
- BOOL bUndo(pDoc->IsUndoEnabled());
+ sal_Bool bUndo(pDoc->IsUndoEnabled());
ScEditableTester aTester( pDoc, rPos.Tab(), rPos.Col(),rPos.Row(), rPos.Col(),rPos.Row() );
if (!aTester.IsEditable())
{
if (!bApi)
rDocShell.ErrorMessage(aTester.GetMessageId());
- return FALSE;
+ return false;
}
SCTAB* pTabs = NULL;
ScBaseCell** ppOldCells = NULL;
- BOOL* pHasFormat = NULL;
- ULONG* pOldFormats = NULL;
+ sal_Bool* pHasFormat = NULL;
+ sal_uLong* pOldFormats = NULL;
ScBaseCell* pDocCell = pDoc->GetCell( rPos );
- BOOL bEditDeleted = (pDocCell && pDocCell->GetCellType() == CELLTYPE_EDIT);
+ sal_Bool bEditDeleted = (pDocCell && pDocCell->GetCellType() == CELLTYPE_EDIT);
if (bUndo)
{
pTabs = new SCTAB[1];
@@ -790,18 +790,18 @@ BOOL ScDocFunc::SetNormalString( const ScAddress& rPos, const String& rText, BOO
ppOldCells = new ScBaseCell*[1];
ppOldCells[0] = pDocCell ? pDocCell->CloneWithoutNote( *pDoc ) : 0;
- pHasFormat = new BOOL[1];
- pOldFormats = new ULONG[1];
+ pHasFormat = new sal_Bool[1];
+ pOldFormats = new sal_uLong[1];
const SfxPoolItem* pItem;
const ScPatternAttr* pPattern = pDoc->GetPattern( rPos.Col(),rPos.Row(),rPos.Tab() );
if ( SFX_ITEM_SET == pPattern->GetItemSet().GetItemState(
- ATTR_VALUE_FORMAT,FALSE,&pItem) )
+ ATTR_VALUE_FORMAT,false,&pItem) )
{
- pHasFormat[0] = TRUE;
+ pHasFormat[0] = sal_True;
pOldFormats[0] = ((const SfxUInt32Item*)pItem)->GetValue();
}
else
- pHasFormat[0] = FALSE;
+ pHasFormat[0] = false;
}
pDoc->SetString( rPos.Col(), rPos.Row(), rPos.Tab(), rText );
@@ -823,15 +823,15 @@ BOOL ScDocFunc::SetNormalString( const ScAddress& rPos, const String& rText, BOO
if (bApi)
NotifyInputHandler( rPos );
- return TRUE;
+ return sal_True;
}
-BOOL ScDocFunc::PutCell( const ScAddress& rPos, ScBaseCell* pNewCell, BOOL bApi )
+sal_Bool ScDocFunc::PutCell( const ScAddress& rPos, ScBaseCell* pNewCell, sal_Bool bApi )
{
ScDocShellModificator aModificator( rDocShell );
ScDocument* pDoc = rDocShell.GetDocument();
- BOOL bUndo (pDoc->IsUndoEnabled());
- BOOL bXMLLoading(pDoc->IsImportingXML());
+ sal_Bool bUndo (pDoc->IsUndoEnabled());
+ sal_Bool bXMLLoading(pDoc->IsImportingXML());
// #i925#; it is not neccessary to test whether the cell is editable on loading a XML document
if (!bXMLLoading)
@@ -842,14 +842,14 @@ BOOL ScDocFunc::PutCell( const ScAddress& rPos, ScBaseCell* pNewCell, BOOL bApi
if (!bApi)
rDocShell.ErrorMessage(aTester.GetMessageId());
pNewCell->Delete();
- return FALSE;
+ return false;
}
}
- BOOL bEditCell = ( pNewCell->GetCellType() == CELLTYPE_EDIT );
+ sal_Bool bEditCell = ( pNewCell->GetCellType() == CELLTYPE_EDIT );
ScBaseCell* pDocCell = pDoc->GetCell( rPos );
- BOOL bEditDeleted = (pDocCell && pDocCell->GetCellType() == CELLTYPE_EDIT);
- BOOL bHeight = ( bEditDeleted || bEditCell ||
+ sal_Bool bEditDeleted = (pDocCell && pDocCell->GetCellType() == CELLTYPE_EDIT);
+ sal_Bool bHeight = ( bEditDeleted || bEditCell ||
pDoc->HasAttrib( ScRange(rPos), HASATTR_NEEDHEIGHT ) );
ScBaseCell* pUndoCell = (bUndo && pDocCell) ? pDocCell->CloneWithoutNote( *pDoc, rPos ) : 0;
@@ -877,16 +877,16 @@ BOOL ScDocFunc::PutCell( const ScAddress& rPos, ScBaseCell* pNewCell, BOOL bApi
if (bApi && !bXMLLoading)
NotifyInputHandler( rPos );
- return TRUE;
+ return sal_True;
}
-void ScDocFunc::NotifyInputHandler( const ScAddress& /* rPos */ )
+void ScDocFunc::NotifyInputHandler( const ScAddress& rPos )
{
ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
if ( pViewSh && pViewSh->GetViewData()->GetDocShell() == &rDocShell )
{
ScInputHandler* pInputHdl = SC_MOD()->GetInputHdl();
- if ( pInputHdl )
+ if ( pInputHdl && pInputHdl->GetCursorPos() == rPos )
{
sal_Bool bIsEditMode(pInputHdl->IsEditMode());
@@ -894,30 +894,30 @@ void ScDocFunc::NotifyInputHandler( const ScAddress& /* rPos */ )
// (the cell shows the same like the InputWindow)
if (bIsEditMode)
pInputHdl->SetModified();
- pViewSh->UpdateInputHandler(FALSE, !bIsEditMode);
+ pViewSh->UpdateInputHandler(false, !bIsEditMode);
}
}
}
struct ScMyRememberItem
{
- USHORT nIndex;
+ sal_uInt16 nIndex;
SfxItemSet aItemSet;
- ScMyRememberItem(const SfxItemSet& rItemSet, USHORT nTempIndex) :
+ ScMyRememberItem(const SfxItemSet& rItemSet, sal_uInt16 nTempIndex) :
nIndex(nTempIndex), aItemSet(rItemSet) {}
};
typedef ::std::list<ScMyRememberItem*> ScMyRememberItemList;
-BOOL ScDocFunc::PutData( const ScAddress& rPos, ScEditEngineDefaulter& rEngine, BOOL bInterpret, BOOL bApi )
+sal_Bool ScDocFunc::PutData( const ScAddress& rPos, ScEditEngineDefaulter& rEngine, sal_Bool bInterpret, sal_Bool bApi )
{
// PutData ruft PutCell oder SetNormalString
- BOOL bRet = FALSE;
+ sal_Bool bRet = false;
ScDocument* pDoc = rDocShell.GetDocument();
ScEditAttrTester aTester( &rEngine );
- BOOL bEditCell = aTester.NeedsObject();
+ sal_Bool bEditCell = aTester.NeedsObject();
if ( bEditCell )
{
// #i61702# With bLoseContent set, the content of rEngine isn't restored
@@ -927,7 +927,7 @@ BOOL ScDocFunc::PutData( const ScAddress& rPos, ScEditEngineDefaulter& rEngine,
sal_Bool bUpdateMode(rEngine.GetUpdateMode());
if (bUpdateMode)
- rEngine.SetUpdateMode(sal_False);
+ rEngine.SetUpdateMode(false);
ScMyRememberItemList aRememberItems;
ScMyRememberItem* pRememberItem = NULL;
@@ -936,8 +936,8 @@ BOOL ScDocFunc::PutData( const ScAddress& rPos, ScEditEngineDefaulter& rEngine,
// not only alignment, so the object doesn't contain the cell attributes as
// paragraph attributes. Before remove the attributes store they in a list to
// set they back to the EditEngine.
- USHORT nCount = rEngine.GetParagraphCount();
- for (USHORT i=0; i<nCount; i++)
+ sal_uInt16 nCount = rEngine.GetParagraphCount();
+ for (sal_uInt16 i=0; i<nCount; i++)
{
const SfxItemSet& rOld = rEngine.GetParaAttribs( i );
if ( rOld.Count() )
@@ -994,9 +994,9 @@ BOOL ScDocFunc::PutData( const ScAddress& rPos, ScEditEngineDefaulter& rEngine,
if ( aPattern.GetItemSet().Count() > 0 )
{
ScMarkData aMark;
- aMark.SelectTable( rPos.Tab(), TRUE );
+ aMark.SelectTable( rPos.Tab(), sal_True );
aMark.SetMarkArea( ScRange( rPos ) );
- ApplyAttributes( aMark, aPattern, TRUE, bApi );
+ ApplyAttributes( aMark, aPattern, sal_True, bApi );
}
}
@@ -1015,7 +1015,7 @@ ScTokenArray* lcl_ScDocFunc_CreateTokenArrayXML( const String& rText, const Stri
ScBaseCell* ScDocFunc::InterpretEnglishString( const ScAddress& rPos,
- const String& rText, const String& rFormulaNmsp, const formula::FormulaGrammar::Grammar eGrammar )
+ const String& rText, const String& rFormulaNmsp, const formula::FormulaGrammar::Grammar eGrammar, short* pRetFormatType )
{
ScDocument* pDoc = rDocShell.GetDocument();
ScBaseCell* pNewCell = NULL;
@@ -1049,7 +1049,12 @@ ScBaseCell* ScDocFunc::InterpretEnglishString( const ScAddress& rPos,
sal_uInt32 nEnglish = pFormatter->GetStandardIndex(LANGUAGE_ENGLISH_US);
double fVal;
if ( pFormatter->IsNumberFormat( rText, nEnglish, fVal ) )
+ {
pNewCell = new ScValueCell( fVal );
+ // return the format type from the English format, so a localized format can be created
+ if ( pRetFormatType )
+ *pRetFormatType = pFormatter->GetType( nEnglish );
+ }
else if ( rText.Len() )
pNewCell = ScBaseCell::CreateTextCell( rText, pDoc );
@@ -1061,8 +1066,8 @@ ScBaseCell* ScDocFunc::InterpretEnglishString( const ScAddress& rPos,
}
-BOOL ScDocFunc::SetCellText( const ScAddress& rPos, const String& rText,
- BOOL bInterpret, BOOL bEnglish, BOOL bApi,
+sal_Bool ScDocFunc::SetCellText( const ScAddress& rPos, const String& rText,
+ sal_Bool bInterpret, sal_Bool bEnglish, sal_Bool bApi,
const String& rFormulaNmsp, const formula::FormulaGrammar::Grammar eGrammar )
{
// SetCellText ruft PutCell oder SetNormalString
@@ -1110,7 +1115,7 @@ bool ScDocFunc::ShowNote( const ScAddress& rPos, bool bShow )
rDocShell.GetUndoManager()->AddUndoAction( new ScUndoShowHideNote( rDocShell, rPos, bShow ) );
if (rDoc.IsStreamValid(rPos.Tab()))
- rDoc.SetStreamValid(rPos.Tab(), FALSE);
+ rDoc.SetStreamValid(rPos.Tab(), false);
rDocShell.SetDocumentModified();
@@ -1119,7 +1124,7 @@ bool ScDocFunc::ShowNote( const ScAddress& rPos, bool bShow )
//------------------------------------------------------------------------
-bool ScDocFunc::SetNoteText( const ScAddress& rPos, const String& rText, BOOL bApi )
+bool ScDocFunc::SetNoteText( const ScAddress& rPos, const String& rText, sal_Bool bApi )
{
ScDocShellModificator aModificator( rDocShell );
@@ -1141,7 +1146,7 @@ bool ScDocFunc::SetNoteText( const ScAddress& rPos, const String& rText, BOOL bA
//! Undo !!!
if (pDoc->IsStreamValid(rPos.Tab()))
- pDoc->SetStreamValid(rPos.Tab(), FALSE);
+ pDoc->SetStreamValid(rPos.Tab(), false);
rDocShell.PostPaintCell( rPos );
aModificator.SetDocumentModified();
@@ -1151,7 +1156,7 @@ bool ScDocFunc::SetNoteText( const ScAddress& rPos, const String& rText, BOOL bA
//------------------------------------------------------------------------
-bool ScDocFunc::ReplaceNote( const ScAddress& rPos, const String& rNoteText, const String* pAuthor, const String* pDate, BOOL bApi )
+bool ScDocFunc::ReplaceNote( const ScAddress& rPos, const String& rNoteText, const String* pAuthor, const String* pDate, sal_Bool bApi )
{
bool bDone = false;
@@ -1161,7 +1166,7 @@ bool ScDocFunc::ReplaceNote( const ScAddress& rPos, const String& rNoteText, con
if (aTester.IsEditable())
{
ScDrawLayer* pDrawLayer = rDoc.GetDrawLayer();
- SfxUndoManager* pUndoMgr = (pDrawLayer && rDoc.IsUndoEnabled()) ? rDocShell.GetUndoManager() : 0;
+ ::svl::IUndoManager* pUndoMgr = (pDrawLayer && rDoc.IsUndoEnabled()) ? rDocShell.GetUndoManager() : 0;
ScNoteData aOldData;
ScPostIt* pOldNote = rDoc.ReleaseNote( rPos );
@@ -1198,7 +1203,7 @@ bool ScDocFunc::ReplaceNote( const ScAddress& rPos, const String& rNoteText, con
rDocShell.PostPaintCell( rPos );
if (rDoc.IsStreamValid(rPos.Tab()))
- rDoc.SetStreamValid(rPos.Tab(), FALSE);
+ rDoc.SetStreamValid(rPos.Tab(), false);
aModificator.SetDocumentModified();
bDone = true;
@@ -1213,23 +1218,23 @@ bool ScDocFunc::ReplaceNote( const ScAddress& rPos, const String& rNoteText, con
//------------------------------------------------------------------------
-BOOL ScDocFunc::ApplyAttributes( const ScMarkData& rMark, const ScPatternAttr& rPattern,
- BOOL bRecord, BOOL bApi )
+sal_Bool ScDocFunc::ApplyAttributes( const ScMarkData& rMark, const ScPatternAttr& rPattern,
+ sal_Bool bRecord, sal_Bool bApi )
{
ScDocument* pDoc = rDocShell.GetDocument();
if ( bRecord && !pDoc->IsUndoEnabled() )
- bRecord = FALSE;
+ bRecord = false;
- BOOL bImportingXML = pDoc->IsImportingXML();
+ sal_Bool bImportingXML = pDoc->IsImportingXML();
// Cell formats can still be set if the range isn't editable only because of matrix formulas.
// #i62483# When loading XML, the check can be skipped altogether.
- BOOL bOnlyNotBecauseOfMatrix;
+ sal_Bool bOnlyNotBecauseOfMatrix;
if ( !bImportingXML && !pDoc->IsSelectionEditable( rMark, &bOnlyNotBecauseOfMatrix )
&& !bOnlyNotBecauseOfMatrix )
{
if (!bApi)
rDocShell.ErrorMessage(STR_PROTECTIONERR);
- return FALSE;
+ return false;
}
ScDocShellModificator aModificator( rDocShell );
@@ -1237,7 +1242,7 @@ BOOL ScDocFunc::ApplyAttributes( const ScMarkData& rMark, const ScPatternAttr& r
//! Umrandung
ScRange aMultiRange;
- BOOL bMulti = rMark.IsMultiMarked();
+ sal_Bool bMulti = rMark.IsMultiMarked();
if ( bMulti )
rMark.GetMultiMarkArea( aMultiRange );
else
@@ -1258,7 +1263,7 @@ BOOL ScDocFunc::ApplyAttributes( const ScMarkData& rMark, const ScPatternAttr& r
}
// While loading XML it is not neccessary to ask HasAttrib. It needs too much time.
- USHORT nExtFlags = 0;
+ sal_uInt16 nExtFlags = 0;
if ( !bImportingXML )
rDocShell.UpdatePaintExt( nExtFlags, aMultiRange ); // content before the change
pDoc->ApplySelectionPattern( rPattern, rMark );
@@ -1272,38 +1277,38 @@ BOOL ScDocFunc::ApplyAttributes( const ScMarkData& rMark, const ScPatternAttr& r
aModificator.SetDocumentModified();
- return TRUE;
+ return sal_True;
}
-BOOL ScDocFunc::ApplyStyle( const ScMarkData& rMark, const String& rStyleName,
- BOOL bRecord, BOOL bApi )
+sal_Bool ScDocFunc::ApplyStyle( const ScMarkData& rMark, const String& rStyleName,
+ sal_Bool bRecord, sal_Bool bApi )
{
ScDocument* pDoc = rDocShell.GetDocument();
if ( bRecord && !pDoc->IsUndoEnabled() )
- bRecord = FALSE;
+ bRecord = false;
- BOOL bImportingXML = pDoc->IsImportingXML();
+ sal_Bool bImportingXML = pDoc->IsImportingXML();
// Cell formats can still be set if the range isn't editable only because of matrix formulas.
// #i62483# When loading XML, the check can be skipped altogether.
- BOOL bOnlyNotBecauseOfMatrix;
+ sal_Bool bOnlyNotBecauseOfMatrix;
if ( !bImportingXML && !pDoc->IsSelectionEditable( rMark, &bOnlyNotBecauseOfMatrix )
&& !bOnlyNotBecauseOfMatrix )
{
if (!bApi)
rDocShell.ErrorMessage(STR_PROTECTIONERR);
- return FALSE;
+ return false;
}
ScStyleSheet* pStyleSheet = (ScStyleSheet*) pDoc->GetStyleSheetPool()->Find(
rStyleName, SFX_STYLE_FAMILY_PARA );
if (!pStyleSheet)
- return FALSE;
+ return false;
ScDocShellModificator aModificator( rDocShell );
ScRange aMultiRange;
- BOOL bMulti = rMark.IsMultiMarked();
+ sal_Bool bMulti = rMark.IsMultiMarked();
if ( bMulti )
rMark.GetMultiMarkArea( aMultiRange );
else
@@ -1332,7 +1337,7 @@ BOOL ScDocFunc::ApplyStyle( const ScMarkData& rMark, const String& rStyleName,
pDoc->ApplySelectionStyle( (ScStyleSheet&)*pStyleSheet, rMark );
- USHORT nExtFlags = 0;
+ sal_uInt16 nExtFlags = 0;
if (!AdjustRowHeight( aMultiRange ))
rDocShell.PostPaint( aMultiRange, PAINT_GRID, nExtFlags );
else if (nExtFlags & SC_PF_LINES)
@@ -1340,13 +1345,13 @@ BOOL ScDocFunc::ApplyStyle( const ScMarkData& rMark, const String& rStyleName,
aModificator.SetDocumentModified();
- return TRUE;
+ return sal_True;
}
//------------------------------------------------------------------------
-BOOL ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark, InsCellCmd eCmd,
- BOOL bRecord, BOOL bApi, BOOL bPartOfPaste )
+sal_Bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark, InsCellCmd eCmd,
+ sal_Bool bRecord, sal_Bool bApi, sal_Bool bPartOfPaste )
{
ScDocShellModificator aModificator( rDocShell );
@@ -1360,7 +1365,7 @@ BOOL ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
if ( !ValidRow(nStartRow) || !ValidRow(nEndRow) )
{
OSL_FAIL("invalid row in InsertCells");
- return FALSE;
+ return false;
}
ScDocument* pDoc = rDocShell.GetDocument();
@@ -1369,8 +1374,8 @@ BOOL ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
SCROW nPaintStartY = nStartRow;
SCCOL nPaintEndX = nEndCol;
SCROW nPaintEndY = nEndRow;
- USHORT nPaintFlags = PAINT_GRID;
- BOOL bSuccess;
+ sal_uInt16 nPaintFlags = PAINT_GRID;
+ sal_Bool bSuccess;
SCTAB i;
ScTabViewShell* pViewSh = rDocShell.GetBestViewShell(); //preserve current cursor position
@@ -1383,7 +1388,7 @@ BOOL ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
}
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = FALSE;
+ bRecord = false;
ScMarkData aMark;
if (pTabMark)
@@ -1398,7 +1403,7 @@ BOOL ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
nCount++;
if( nCount == nEndTab+1 )
{
- aMark.SelectTable( i, TRUE );
+ aMark.SelectTable( i, sal_True );
break;
}
}
@@ -1410,7 +1415,7 @@ BOOL ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
if( aMark.GetTableSelect( i ) )
{
for( SCTAB j = i+1; j<nTabCount && pDoc->IsScenario(j); j++ )
- aFullMark.SelectTable( j, TRUE );
+ aFullMark.SelectTable( j, sal_True );
}
SCTAB nSelCount = aMark.GetSelectCount();
@@ -1450,7 +1455,7 @@ BOOL ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
if ( eCmd == INS_CELLSRIGHT )
nMergeTestEndX = MAXCOL;
- BOOL bNeedRefresh = FALSE;
+ sal_Bool bNeedRefresh = false;
SCCOL nEditTestEndX = (eCmd==INS_INSCOLS) ? MAXCOL : nMergeTestEndX;
SCROW nEditTestEndY = (eCmd==INS_INSROWS) ? MAXROW : nMergeTestEndY;
@@ -1459,7 +1464,7 @@ BOOL ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
{
if (!bApi)
rDocShell.ErrorMessage(aTester.GetMessageId());
- return FALSE;
+ return false;
}
WaitObject aWait( rDocShell.GetActiveDialogParent() ); // wichtig wegen TrackFormulas bei UpdateReference
@@ -1469,7 +1474,7 @@ BOOL ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
if ( bRecord )
{
pRefUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pRefUndoDoc->InitUndo( pDoc, 0, nTabCount-1, FALSE, FALSE );
+ pRefUndoDoc->InitUndo( pDoc, 0, nTabCount-1, false, false );
// pRefUndoDoc is filled in InsertCol / InsertRow
@@ -1480,7 +1485,7 @@ BOOL ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
// #i8302 : we unmerge overwhelming ranges, before insertion all the actions are put in the same ListAction
// the patch comes from mloiseleur and maoyg
- BOOL bInsertMerge = FALSE;
+ sal_Bool bInsertMerge = false;
std::vector<ScRange> qIncreaseRange;
String aUndo = ScGlobal::GetRscString( STR_UNDO_INSERTCELLS );
if (bRecord)
@@ -1493,7 +1498,7 @@ BOOL ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
if( pDoc->HasAttrib( nMergeTestStartX, nMergeTestStartY, i, nMergeTestEndX, nMergeTestEndY, i, HASATTR_MERGED | HASATTR_OVERLAPPED ) )
{
if (eCmd==INS_CELLSRIGHT)
- bNeedRefresh = TRUE;
+ bNeedRefresh = sal_True;
SCCOL nMergeStartX = nMergeTestStartX;
SCROW nMergeStartY = nMergeTestStartY;
@@ -1509,7 +1514,7 @@ BOOL ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
if (!bApi)
rDocShell.ErrorMessage(STR_MSSG_INSERTCELLS_0);
rDocShell.GetUndoManager()->LeaveListAction();
- return FALSE;
+ return false;
}
SCCOL nTestCol = -1;
@@ -1525,12 +1530,12 @@ BOOL ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
{
pMergeFlag = (const ScMergeAttr*) &pPattern->GetItem(ATTR_MERGE);
pMergeFlagAttr = (const ScMergeFlagAttr*) &pPattern->GetItem(ATTR_MERGE_FLAG);
- INT16 nNewFlags = pMergeFlagAttr->GetValue() & ( SC_MF_HOR | SC_MF_VER );
+ sal_Int16 nNewFlags = pMergeFlagAttr->GetValue() & ( SC_MF_HOR | SC_MF_VER );
if( ( pMergeFlag && pMergeFlag->IsMerged() ) || nNewFlags == SC_MF_HOR || nNewFlags == SC_MF_VER )
{
ScRange aRange( nTestCol, nTestRow1, i );
pDoc->ExtendOverlapped(aRange);
- pDoc->ExtendMerge(aRange, TRUE, TRUE);
+ pDoc->ExtendMerge(aRange, sal_True, sal_True);
if( nTestRow1 < nTestRow2 && nNewFlags == SC_MF_HOR )
{
@@ -1538,12 +1543,12 @@ BOOL ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
{
ScRange aTestRange( nTestCol, nTestRow, i );
pDoc->ExtendOverlapped( aTestRange );
- pDoc->ExtendMerge( aTestRange, TRUE, TRUE);
+ pDoc->ExtendMerge( aTestRange, sal_True, sal_True);
ScRange aMergeRange( aTestRange.aStart.Col(),aTestRange.aStart.Row(), i );
if( !aExtendRange.In( aMergeRange ) )
{
qIncreaseRange.push_back( aTestRange );
- bInsertMerge = TRUE;
+ bInsertMerge = sal_True;
}
}
}
@@ -1554,7 +1559,7 @@ BOOL ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
{
qIncreaseRange.push_back( aRange );
}
- bInsertMerge = TRUE;
+ bInsertMerge = sal_True;
}
}
}
@@ -1597,7 +1602,7 @@ BOOL ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
ScRange aRange( *iIter );
if( pDoc->HasAttrib( aRange, HASATTR_OVERLAPPED | HASATTR_MERGED ) )
{
- UnmergeCells( aRange, TRUE, TRUE );
+ UnmergeCells( aRange, sal_True, sal_True );
}
}
}
@@ -1607,7 +1612,7 @@ BOOL ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
if (!bApi)
rDocShell.ErrorMessage(STR_MSSG_INSERTCELLS_0);
rDocShell.GetUndoManager()->LeaveListAction();
- return FALSE;
+ return false;
}
}
}
@@ -1639,7 +1644,7 @@ BOOL ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
break;
default:
OSL_FAIL("Falscher Code beim Einfuegen");
- bSuccess = FALSE;
+ bSuccess = false;
break;
}
@@ -1702,7 +1707,7 @@ BOOL ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
aRange.aStart.Col(), aRange.aStart.Row(),
aRange.aEnd.Col(), aRange.aEnd.Row() );
aMergeOption.maTabs.insert(aRange.aStart.Tab());
- MergeCells(aMergeOption, FALSE, TRUE, TRUE);
+ MergeCells(aMergeOption, false, true, true);
}
qIncreaseRange.pop_back();
}
@@ -1715,14 +1720,14 @@ BOOL ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
if( aMark.GetTableSelect( i ) )
{
if (bNeedRefresh)
- pDoc->ExtendMerge( nMergeTestStartX, nMergeTestStartY, nMergeTestEndX, nMergeTestEndY, i, TRUE );
+ pDoc->ExtendMerge( nMergeTestStartX, nMergeTestStartY, nMergeTestEndX, nMergeTestEndY, i, sal_True );
else
pDoc->RefreshAutoFilter( nMergeTestStartX, nMergeTestStartY, nMergeTestEndX, nMergeTestEndY, i );
if ( eCmd == INS_INSROWS || eCmd == INS_INSCOLS )
pDoc->UpdatePageBreaks( i );
- USHORT nExtFlags = 0;
+ sal_uInt16 nExtFlags = 0;
rDocShell.UpdatePaintExt( nExtFlags, nPaintStartX, nPaintStartY, i, nPaintEndX, nPaintEndY, i );
SCTAB nScenarioCount = 0;
@@ -1730,7 +1735,7 @@ BOOL ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
for( SCTAB j = i+1; j<nTabCount && pDoc->IsScenario(j); j++ )
nScenarioCount ++;
- BOOL bAdjusted = ( eCmd == INS_INSROWS ) ? AdjustRowHeight(ScRange(0, nStartRow, i, MAXCOL, nEndRow, i+nScenarioCount )) :
+ sal_Bool bAdjusted = ( eCmd == INS_INSROWS ) ? AdjustRowHeight(ScRange(0, nStartRow, i, MAXCOL, nEndRow, i+nScenarioCount )) :
AdjustRowHeight(ScRange(0, nPaintStartY, i, MAXCOL, nPaintEndY, i+nScenarioCount ));
if (bAdjusted)
{
@@ -1753,20 +1758,19 @@ BOOL ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
ScCellMergeOption aMergeOption(
aRange.aStart.Col(), aRange.aStart.Row(),
aRange.aEnd.Col(), aRange.aEnd.Row() );
- MergeCells(aMergeOption, FALSE, TRUE, TRUE);
+ MergeCells(aMergeOption, false, true, true);
qIncreaseRange.pop_back();
}
if( pViewSh )
{
- pViewSh->MarkRange( rRange, FALSE );
+ pViewSh->MarkRange( rRange, false );
pViewSh->SetCursor( nCursorCol, nCursorRow );
}
}
rDocShell.GetUndoManager()->LeaveListAction();
- SfxUndoManager* pMgr = rDocShell.GetUndoManager();
- pMgr->RemoveLastUndoAction();
+ rDocShell.GetUndoManager()->RemoveLastUndoAction();
delete pRefUndoDoc;
delete pUndoData;
@@ -1780,8 +1784,8 @@ BOOL ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
return bSuccess;
}
-BOOL ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark, DelCellCmd eCmd,
- BOOL bRecord, BOOL bApi )
+sal_Bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark, DelCellCmd eCmd,
+ sal_Bool bRecord, sal_Bool bApi )
{
ScDocShellModificator aModificator( rDocShell );
@@ -1795,7 +1799,7 @@ BOOL ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
if ( !ValidRow(nStartRow) || !ValidRow(nEndRow) )
{
OSL_FAIL("invalid row in DeleteCells");
- return FALSE;
+ return false;
}
ScDocument* pDoc = rDocShell.GetDocument();
@@ -1804,11 +1808,11 @@ BOOL ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
SCROW nPaintStartY = nStartRow;
SCCOL nPaintEndX = nEndCol;
SCROW nPaintEndY = nEndRow;
- USHORT nPaintFlags = PAINT_GRID;
+ sal_uInt16 nPaintFlags = PAINT_GRID;
SCTAB i;
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = FALSE;
+ bRecord = false;
ScMarkData aMark;
if (pTabMark)
@@ -1823,7 +1827,7 @@ BOOL ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
nCount++;
if( nCount == nEndTab+1 )
{
- aMark.SelectTable( i, TRUE );
+ aMark.SelectTable( i, sal_True );
break;
}
}
@@ -1835,7 +1839,7 @@ BOOL ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
if( aMark.GetTableSelect( i ) )
{
for( SCTAB j = i+1; j<nTabCount && pDoc->IsScenario(j); j++ )
- aFullMark.SelectTable( j, TRUE );
+ aFullMark.SelectTable( j, sal_True );
}
SCTAB nSelCount = aMark.GetSelectCount();
@@ -1880,7 +1884,7 @@ BOOL ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
{
if (!bApi)
rDocShell.ErrorMessage(aTester.GetMessageId());
- return FALSE;
+ return false;
}
// Test zusammengefasste
@@ -1889,12 +1893,12 @@ BOOL ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
SCROW nMergeTestEndY = (eCmd==DEL_CELLSUP) ? MAXROW : nUndoEndY;
SCCOL nExtendStartCol = nUndoStartX;
SCROW nExtendStartRow = nUndoStartY;
- BOOL bNeedRefresh = FALSE;
+ sal_Bool bNeedRefresh = false;
//Issue 8302 want to be able to insert into the middle of merged cells
//the patch comes from maoyg
::std::vector<ScRange> qDecreaseRange;
- BOOL bDeletingMerge = FALSE;
+ sal_Bool bDeletingMerge = false;
String aUndo = ScGlobal::GetRscString( STR_UNDO_DELETECELLS );
if (bRecord)
rDocShell.GetUndoManager()->EnterListAction( aUndo, aUndo );
@@ -1918,7 +1922,7 @@ BOOL ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
if (!bApi)
rDocShell.ErrorMessage(STR_MSSG_DELETECELLS_0);
rDocShell.GetUndoManager()->LeaveListAction();
- return FALSE;
+ return false;
}
nExtendStartCol = nMergeStartX;
@@ -1936,12 +1940,12 @@ BOOL ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
{
pMergeFlag = (const ScMergeAttr*) &pPattern->GetItem( ATTR_MERGE );
pMergeFlagAttr = (const ScMergeFlagAttr*) &pPattern->GetItem( ATTR_MERGE_FLAG );
- INT16 nNewFlags = pMergeFlagAttr->GetValue() & ( SC_MF_HOR | SC_MF_VER );
+ sal_Int16 nNewFlags = pMergeFlagAttr->GetValue() & ( SC_MF_HOR | SC_MF_VER );
if( ( pMergeFlag && pMergeFlag->IsMerged() ) || nNewFlags == SC_MF_HOR || nNewFlags == SC_MF_VER )
{
ScRange aRange( nTestCol, nTestRow1, i );
pDoc->ExtendOverlapped( aRange );
- pDoc->ExtendMerge( aRange, TRUE, TRUE );
+ pDoc->ExtendMerge( aRange, sal_True, sal_True );
if( nTestRow1 < nTestRow2 && nNewFlags == SC_MF_HOR )
{
@@ -1949,12 +1953,12 @@ BOOL ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
{
ScRange aTestRange( nTestCol, nTestRow, i );
pDoc->ExtendOverlapped( aTestRange );
- pDoc->ExtendMerge( aTestRange, TRUE, TRUE);
+ pDoc->ExtendMerge( aTestRange, sal_True, sal_True);
ScRange aMergeRange( aTestRange.aStart.Col(),aTestRange.aStart.Row(), i );
if( !aExtendRange.In( aMergeRange ) )
{
qDecreaseRange.push_back( aTestRange );
- bDeletingMerge = TRUE;
+ bDeletingMerge = sal_True;
}
}
}
@@ -1965,7 +1969,7 @@ BOOL ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
{
qDecreaseRange.push_back( aRange );
}
- bDeletingMerge = TRUE;
+ bDeletingMerge = sal_True;
}
}
}
@@ -1977,7 +1981,7 @@ BOOL ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
{
nStartRow = aExtendMergeRange.aStart.Row();
nEndRow = aExtendMergeRange.aEnd.Row();
- bNeedRefresh = TRUE;
+ bNeedRefresh = sal_True;
if( eCmd == DEL_CELLSUP )
{
@@ -1997,7 +2001,7 @@ BOOL ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
if( eCmd == DEL_CELLSLEFT )
{
nEndRow = aExtendMergeRange.aEnd.Row();
- bNeedRefresh = TRUE;
+ bNeedRefresh = sal_True;
}
else
{
@@ -2013,7 +2017,7 @@ BOOL ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
ScRange aRange( *iIter );
if( pDoc->HasAttrib( aRange, HASATTR_OVERLAPPED | HASATTR_MERGED ) )
{
- UnmergeCells( aRange, TRUE, TRUE );
+ UnmergeCells( aRange, sal_True, sal_True );
}
}
}
@@ -2023,7 +2027,7 @@ BOOL ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
if (!bApi)
rDocShell.ErrorMessage(STR_MSSG_DELETECELLS_0);
rDocShell.GetUndoManager()->LeaveListAction();
- return FALSE;
+ return false;
}
}
}
@@ -2055,26 +2059,26 @@ BOOL ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
nScenarioCount ++;
pDoc->CopyToDocument( nUndoStartX, nUndoStartY, i, nUndoEndX, nUndoEndY, i+nScenarioCount,
- IDF_ALL | IDF_NOCAPTIONS, FALSE, pUndoDoc );
+ IDF_ALL | IDF_NOCAPTIONS, false, pUndoDoc );
}
}
pRefUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pRefUndoDoc->InitUndo( pDoc, 0, nTabCount-1, FALSE, FALSE );
+ pRefUndoDoc->InitUndo( pDoc, 0, nTabCount-1, false, false );
pUndoData = new ScRefUndoData( pDoc );
pDoc->BeginDrawUndo();
}
- USHORT nExtFlags = 0;
+ sal_uInt16 nExtFlags = 0;
for( i=0; i<nTabCount; i++ )
{
if( aMark.GetTableSelect( i ) )
rDocShell.UpdatePaintExt( nExtFlags, nStartCol, nStartRow, i, nEndCol, nEndRow, i );
}
- BOOL bUndoOutline = FALSE;
+ sal_Bool bUndoOutline = false;
switch (eCmd)
{
case DEL_CELLSUP:
@@ -2113,10 +2117,10 @@ BOOL ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
pRefUndoDoc->DeleteAreaTab(nUndoStartX,nUndoStartY,nUndoEndX,nUndoEndY, i, IDF_ALL);
// alle Tabellen anlegen, damit Formeln kopiert werden koennen:
- pUndoDoc->AddUndoTab( 0, nTabCount-1, FALSE, FALSE );
+ pUndoDoc->AddUndoTab( 0, nTabCount-1, false, false );
- // kopieren mit bColRowFlags=FALSE (#54194#)
- pRefUndoDoc->CopyToDocument(0,0,0,MAXCOL,MAXROW,MAXTAB,IDF_FORMULA,FALSE,pUndoDoc,NULL,FALSE);
+ // kopieren mit bColRowFlags=sal_False (#54194#)
+ pRefUndoDoc->CopyToDocument(0,0,0,MAXCOL,MAXROW,MAXTAB,IDF_FORMULA,false,pUndoDoc,NULL,false);
delete pRefUndoDoc;
SCTAB* pTabs = new SCTAB[nSelCount];
@@ -2192,7 +2196,7 @@ BOOL ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
if( !pDoc->HasAttrib( aRange, HASATTR_OVERLAPPED | HASATTR_MERGED ) )
{
ScCellMergeOption aMergeOption(aRange);
- MergeCells( aMergeOption, FALSE, TRUE, TRUE );
+ MergeCells( aMergeOption, false, true, true );
}
qDecreaseRange.pop_back();
}
@@ -2224,7 +2228,7 @@ BOOL ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
nScenarioCount ++;
ScRange aMergedRange( nExtendStartCol, nExtendStartRow, i, nMergeTestEndX, nMergeTestEndY, i+nScenarioCount );
- pDoc->ExtendMerge( aMergedRange, TRUE );
+ pDoc->ExtendMerge( aMergedRange, sal_True );
}
}
}
@@ -2260,11 +2264,11 @@ BOOL ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
- return TRUE;
+ return sal_True;
}
-BOOL ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
- BOOL bCut, BOOL bRecord, BOOL bPaint, BOOL bApi )
+sal_Bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
+ sal_Bool bCut, sal_Bool bRecord, sal_Bool bPaint, sal_Bool bApi )
{
ScDocShellModificator aModificator( rDocShell );
@@ -2281,21 +2285,21 @@ BOOL ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
if ( !ValidRow(nStartRow) || !ValidRow(nEndRow) || !ValidRow(nDestRow) )
{
OSL_FAIL("invalid row in MoveBlock");
- return FALSE;
+ return false;
}
// zugehoerige Szenarien auch anpassen - nur wenn innerhalb einer Tabelle verschoben wird!
- BOOL bScenariosAdded = FALSE;
+ sal_Bool bScenariosAdded = false;
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = FALSE;
+ bRecord = false;
SCTAB nTabCount = pDoc->GetTableCount();
if ( nDestTab == nStartTab && !pDoc->IsScenario(nEndTab) )
while ( nEndTab+1 < nTabCount && pDoc->IsScenario(nEndTab+1) )
{
++nEndTab;
- bScenariosAdded = TRUE;
+ bScenariosAdded = sal_True;
}
SCTAB nSrcTabCount = nEndTab-nStartTab+1;
@@ -2306,7 +2310,7 @@ BOOL ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
ScMarkData aSourceMark;
for (nTab=nStartTab; nTab<=nEndTab; nTab++)
- aSourceMark.SelectTable( nTab, TRUE ); // Source selektieren
+ aSourceMark.SelectTable( nTab, sal_True ); // Source selektieren
aSourceMark.SetMarkArea( rSource );
ScDocShellRef aDragShellRef;
@@ -2324,13 +2328,13 @@ BOOL ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
SCCOL nOldEndCol = nEndCol;
SCROW nOldEndRow = nEndRow;
- BOOL bClipOver = FALSE;
+ sal_Bool bClipOver = false;
for (nTab=nStartTab; nTab<=nEndTab; nTab++)
{
SCCOL nTmpEndCol = nOldEndCol;
SCROW nTmpEndRow = nOldEndRow;
if (pDoc->ExtendMerge( nStartCol, nStartRow, nTmpEndCol, nTmpEndRow, nTab ))
- bClipOver = TRUE;
+ bClipOver = sal_True;
if ( nTmpEndCol > nEndCol ) nEndCol = nTmpEndCol;
if ( nTmpEndRow > nEndRow ) nEndRow = nTmpEndRow;
}
@@ -2341,14 +2345,14 @@ BOOL ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
SCCOL nUndoEndCol = nDestCol + ( nEndCol-nStartCol ); // erweitert im Zielblock
SCROW nUndoEndRow = nDestRow + ( nEndRow-nStartRow );
- BOOL bIncludeFiltered = bCut;
+ sal_Bool bIncludeFiltered = bCut;
if ( !bIncludeFiltered )
{
// adjust sizes to include only non-filtered rows
SCCOL nClipX;
SCROW nClipY;
- pClipDoc->GetClipArea( nClipX, nClipY, FALSE );
+ pClipDoc->GetClipArea( nClipX, nClipY, false );
SCROW nUndoAdd = nUndoEndRow - nDestEndRow;
nDestEndRow = nDestRow + nClipY;
nUndoEndRow = nDestEndRow + nUndoAdd;
@@ -2359,7 +2363,7 @@ BOOL ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
if (!bApi)
rDocShell.ErrorMessage(STR_PASTE_FULL);
delete pClipDoc;
- return FALSE;
+ return false;
}
// Test auf Zellschutz
@@ -2376,7 +2380,7 @@ BOOL ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
if (!bApi)
rDocShell.ErrorMessage(aTester.GetMessageId());
delete pClipDoc;
- return FALSE;
+ return false;
}
// Test auf zusammengefasste - beim Verschieben erst nach dem Loeschen
@@ -2388,14 +2392,14 @@ BOOL ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
if (!bApi)
rDocShell.ErrorMessage(STR_MSSG_MOVEBLOCKTO_0);
delete pClipDoc;
- return FALSE;
+ return false;
}
// Are there borders in the cells? (for painting)
- USHORT nSourceExt = 0;
+ sal_uInt16 nSourceExt = 0;
rDocShell.UpdatePaintExt( nSourceExt, nStartCol,nStartRow,nStartTab, nEndCol,nEndRow,nEndTab );
- USHORT nDestExt = 0;
+ sal_uInt16 nDestExt = 0;
rDocShell.UpdatePaintExt( nDestExt, nDestCol,nDestRow,nDestTab, nDestEndCol,nDestEndRow,nDestEndTab );
//
@@ -2407,9 +2411,9 @@ BOOL ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
ScRefUndoData* pUndoData = NULL;
if (bRecord)
{
- BOOL bWholeCols = ( nStartRow == 0 && nEndRow == MAXROW );
- BOOL bWholeRows = ( nStartCol == 0 && nEndCol == MAXCOL );
- USHORT nUndoFlags = (IDF_ALL & ~IDF_OBJECTS) | IDF_NOCAPTIONS;
+ sal_Bool bWholeCols = ( nStartRow == 0 && nEndRow == MAXROW );
+ sal_Bool bWholeRows = ( nStartCol == 0 && nEndCol == MAXCOL );
+ sal_uInt16 nUndoFlags = (IDF_ALL & ~IDF_OBJECTS) | IDF_NOCAPTIONS;
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
pUndoDoc->InitUndo( pDoc, nStartTab, nEndTab, bWholeCols, bWholeRows );
@@ -2417,30 +2421,30 @@ BOOL ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
if (bCut)
{
pDoc->CopyToDocument( nStartCol, nStartRow, nStartTab, nEndCol, nEndRow, nEndTab,
- nUndoFlags, FALSE, pUndoDoc );
+ nUndoFlags, false, pUndoDoc );
pRefUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pRefUndoDoc->InitUndo( pDoc, 0, nTabCount-1, FALSE, FALSE );
+ pRefUndoDoc->InitUndo( pDoc, 0, nTabCount-1, false, false );
}
if ( nDestTab != nStartTab )
pUndoDoc->AddUndoTab( nDestTab, nDestEndTab, bWholeCols, bWholeRows );
pDoc->CopyToDocument( nDestCol, nDestRow, nDestTab,
nDestEndCol, nDestEndRow, nDestEndTab,
- nUndoFlags, FALSE, pUndoDoc );
+ nUndoFlags, false, pUndoDoc );
pUndoData = new ScRefUndoData( pDoc );
pDoc->BeginDrawUndo();
}
- BOOL bSourceHeight = FALSE; // Hoehen angepasst?
+ sal_Bool bSourceHeight = false; // Hoehen angepasst?
if (bCut)
{
ScMarkData aDelMark; // only for tables
for (nTab=nStartTab; nTab<=nEndTab; nTab++)
{
pDoc->DeleteAreaTab( nStartCol,nStartRow, nOldEndCol,nOldEndRow, nTab, IDF_ALL );
- aDelMark.SelectTable( nTab, TRUE );
+ aDelMark.SelectTable( nTab, sal_True );
}
pDoc->DeleteObjectsInArea( nStartCol,nStartRow, nOldEndCol,nOldEndRow, aDelMark );
@@ -2456,7 +2460,7 @@ BOOL ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
{
SCCOL nTmpEndCol = nEndCol;
SCROW nTmpEndRow = nEndRow;
- pDoc->ExtendMerge( nStartCol, nStartRow, nTmpEndCol, nTmpEndRow, nTab, TRUE );
+ pDoc->ExtendMerge( nStartCol, nStartRow, nTmpEndCol, nTmpEndRow, nTab, sal_True );
}
// Fehlermeldung erst nach dem Wiederherstellen des Inhalts
@@ -2467,17 +2471,17 @@ BOOL ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
delete pRefUndoDoc;
delete pUndoData;
delete pClipDoc;
- return FALSE;
+ return false;
}
- bSourceHeight = AdjustRowHeight( rSource, FALSE );
+ bSourceHeight = AdjustRowHeight( rSource, false );
}
ScRange aPasteDest( nDestCol, nDestRow, nDestTab, nDestEndCol, nDestEndRow, nDestEndTab );
ScMarkData aDestMark;
for (nTab=nDestTab; nTab<=nDestEndTab; nTab++)
- aDestMark.SelectTable( nTab, TRUE ); // Destination selektieren
+ aDestMark.SelectTable( nTab, sal_True ); // Destination selektieren
aDestMark.SetMarkArea( aPasteDest );
/* Do not copy cell notes and drawing objects here. While pasting, the
@@ -2486,16 +2490,16 @@ BOOL ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
positions (e.g. if source and destination range overlaps). Cell notes
and drawing objects are pasted below after doing all adjusting. */
pDoc->CopyFromClip( aPasteDest, aDestMark, IDF_ALL & ~(IDF_NOTE | IDF_OBJECTS),
- pRefUndoDoc, pClipDoc, TRUE, FALSE, bIncludeFiltered );
+ pRefUndoDoc, pClipDoc, sal_True, false, bIncludeFiltered );
// skipped rows and merged cells don't mix
if ( !bIncludeFiltered && pClipDoc->HasClipFilteredRows() )
- UnmergeCells( aPasteDest, FALSE, TRUE );
+ UnmergeCells( aPasteDest, false, sal_True );
VirtualDevice aVirtDev;
- BOOL bDestHeight = AdjustRowHeight(
+ sal_Bool bDestHeight = AdjustRowHeight(
ScRange( 0,nDestRow,nDestTab, MAXCOL,nDestEndRow,nDestEndTab ),
- FALSE );
+ false );
/* Paste cell notes and drawing objects after adjusting formula references
and row heights. There are no cell notes or drawing objects, if the
@@ -2506,19 +2510,19 @@ BOOL ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
touch existing cells. */
if ( pClipDoc->GetDrawLayer() )
pDoc->CopyFromClip( aPasteDest, aDestMark, IDF_NOTE | IDF_ADDNOTES | IDF_OBJECTS,
- pRefUndoDoc, pClipDoc, TRUE, FALSE, bIncludeFiltered );
+ pRefUndoDoc, pClipDoc, sal_True, false, bIncludeFiltered );
if (bRecord)
{
if (pRefUndoDoc)
{
// alle Tabellen anlegen, damit Formeln kopiert werden koennen:
- pUndoDoc->AddUndoTab( 0, nTabCount-1, FALSE, FALSE );
+ pUndoDoc->AddUndoTab( 0, nTabCount-1, false, false );
pRefUndoDoc->DeleteArea( nDestCol, nDestRow, nDestEndCol, nDestEndRow, aSourceMark, IDF_ALL );
- // kopieren mit bColRowFlags=FALSE (#54194#)
+ // kopieren mit bColRowFlags=sal_False (#54194#)
pRefUndoDoc->CopyToDocument( 0, 0, 0, MAXCOL, MAXROW, MAXTAB,
- IDF_FORMULA, FALSE, pUndoDoc, NULL, FALSE );
+ IDF_FORMULA, false, pUndoDoc, NULL, false );
delete pRefUndoDoc;
}
@@ -2536,7 +2540,7 @@ BOOL ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
{
SCCOL nTmpEndCol = nDestEndCol;
SCROW nTmpEndRow = nDestEndRow;
- pDoc->ExtendMerge( nDestCol, nDestRow, nTmpEndCol, nTmpEndRow, nTab, TRUE );
+ pDoc->ExtendMerge( nDestCol, nDestRow, nTmpEndCol, nTmpEndRow, nTab, sal_True );
if (nTmpEndCol > nDestPaintEndCol) nDestPaintEndCol = nTmpEndCol;
if (nTmpEndRow > nDestPaintEndRow) nDestPaintEndRow = nTmpEndRow;
}
@@ -2553,7 +2557,7 @@ BOOL ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
SCROW nPaintStartY = nDestRow;
SCCOL nPaintEndX = nDestPaintEndCol;
SCROW nPaintEndY = nDestPaintEndRow;
- USHORT nFlags = PAINT_GRID;
+ sal_uInt16 nFlags = PAINT_GRID;
if ( nStartRow==0 && nEndRow==MAXROW ) // Breiten mitkopiert?
{
@@ -2615,7 +2619,7 @@ BOOL ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
delete pClipDoc;
- return TRUE;
+ return sal_True;
}
//------------------------------------------------------------------------
@@ -2643,7 +2647,6 @@ script::ModuleInfo lcl_InitModuleInfo( SfxObjectShell& rDocSh, String& sModule )
void VBA_InsertModule( ScDocument& rDoc, SCTAB nTab, String& sModuleName, String& sSource )
{
- SFX_APP()->EnterBasicCall();
SfxObjectShell& rDocSh = *rDoc.GetDocumentShell();
uno::Reference< script::XLibraryContainer > xLibContainer = rDocSh.GetBasicContainer();
DBG_ASSERT( xLibContainer.is(), "No BasicContainer!" );
@@ -2687,12 +2690,10 @@ void VBA_InsertModule( ScDocument& rDoc, SCTAB nTab, String& sModuleName, String
}
}
- SFX_APP()->LeaveBasicCall();
}
void VBA_DeleteModule( ScDocShell& rDocSh, String& sModuleName )
{
- SFX_APP()->EnterBasicCall();
uno::Reference< script::XLibraryContainer > xLibContainer = rDocSh.GetBasicContainer();
DBG_ASSERT( xLibContainer.is(), "No BasicContainer!" );
@@ -2714,13 +2715,12 @@ void VBA_DeleteModule( ScDocShell& rDocSh, String& sModuleName )
xVBAModuleInfo->removeModuleInfo( sModuleName );
}
- SFX_APP()->LeaveBasicCall();
}
-BOOL ScDocFunc::InsertTable( SCTAB nTab, const String& rName, BOOL bRecord, BOOL bApi )
+sal_Bool ScDocFunc::InsertTable( SCTAB nTab, const String& rName, sal_Bool bRecord, sal_Bool bApi )
{
- BOOL bSuccess = FALSE;
+ sal_Bool bSuccess = false;
WaitObject aWait( rDocShell.GetActiveDialogParent() );
ScDocShellModificator aModificator( rDocShell );
@@ -2730,20 +2730,20 @@ BOOL ScDocFunc::InsertTable( SCTAB nTab, const String& rName, BOOL bRecord, BOOL
// Strange loop, also basic is loaded too early ( InsertTable )
// is called via the xml import for sheets in described in odf
- BOOL bInsertDocModule = false;
+ sal_Bool bInsertDocModule = false;
if( !rDocShell.GetDocument()->IsImportingXML() )
{
bInsertDocModule = pDoc ? pDoc->IsInVBAMode() : false;
}
if ( bInsertDocModule || ( bRecord && !pDoc->IsUndoEnabled() ) )
- bRecord = FALSE;
+ bRecord = false;
if (bRecord)
pDoc->BeginDrawUndo(); // InsertTab erzeugt ein SdrUndoNewPage
SCTAB nTabCount = pDoc->GetTableCount();
- BOOL bAppend = ( nTab >= nTabCount );
+ sal_Bool bAppend = ( nTab >= nTabCount );
if ( bAppend )
nTab = nTabCount; // wichtig fuer Undo
@@ -2765,7 +2765,7 @@ BOOL ScDocFunc::InsertTable( SCTAB nTab, const String& rName, BOOL bRecord, BOOL
rDocShell.PostPaintExtras();
aModificator.SetDocumentModified();
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
- bSuccess = TRUE;
+ bSuccess = sal_True;
}
else if (!bApi)
rDocShell.ErrorMessage(STR_TABINSERT_ERROR);
@@ -2773,20 +2773,20 @@ BOOL ScDocFunc::InsertTable( SCTAB nTab, const String& rName, BOOL bRecord, BOOL
return bSuccess;
}
-BOOL ScDocFunc::DeleteTable( SCTAB nTab, BOOL bRecord, BOOL /* bApi */ )
+sal_Bool ScDocFunc::DeleteTable( SCTAB nTab, sal_Bool bRecord, sal_Bool /* bApi */ )
{
WaitObject aWait( rDocShell.GetActiveDialogParent() );
ScDocShellModificator aModificator( rDocShell );
- BOOL bSuccess = FALSE;
+ sal_Bool bSuccess = false;
ScDocument* pDoc = rDocShell.GetDocument();
- BOOL bVbaEnabled = pDoc ? pDoc->IsInVBAMode() : false;
+ sal_Bool bVbaEnabled = pDoc ? pDoc->IsInVBAMode() : false;
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = FALSE;
+ bRecord = false;
if ( bVbaEnabled )
- bRecord = FALSE;
- BOOL bWasLinked = pDoc->IsLinked(nTab);
+ bRecord = false;
+ sal_Bool bWasLinked = pDoc->IsLinked(nTab);
ScDocument* pUndoDoc = NULL;
ScRefUndoData* pUndoData = NULL;
if (bRecord)
@@ -2794,13 +2794,13 @@ BOOL ScDocFunc::DeleteTable( SCTAB nTab, BOOL bRecord, BOOL /* bApi */ )
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
SCTAB nCount = pDoc->GetTableCount();
- pUndoDoc->InitUndo( pDoc, nTab, nTab, TRUE, TRUE ); // nur nTab mit Flags
+ pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_True, sal_True ); // nur nTab mit Flags
pUndoDoc->AddUndoTab( 0, nCount-1 ); // alle Tabs fuer Referenzen
- pDoc->CopyToDocument(0,0,nTab, MAXCOL,MAXROW,nTab, IDF_ALL,FALSE, pUndoDoc );
+ pDoc->CopyToDocument(0,0,nTab, MAXCOL,MAXROW,nTab, IDF_ALL,false, pUndoDoc );
String aOldName;
pDoc->GetName( nTab, aOldName );
- pUndoDoc->RenameTab( nTab, aOldName, FALSE );
+ pUndoDoc->RenameTab( nTab, aOldName, false );
if (bWasLinked)
pUndoDoc->SetLink( nTab, pDoc->GetLinkMode(nTab), pDoc->GetLinkDoc(nTab),
pDoc->GetLinkFlt(nTab), pDoc->GetLinkOpt(nTab),
@@ -2809,13 +2809,13 @@ BOOL ScDocFunc::DeleteTable( SCTAB nTab, BOOL bRecord, BOOL /* bApi */ )
if ( pDoc->IsScenario(nTab) )
{
- pUndoDoc->SetScenario( nTab, TRUE );
+ pUndoDoc->SetScenario( nTab, sal_True );
String aComment;
Color aColor;
- USHORT nScenFlags;
+ sal_uInt16 nScenFlags;
pDoc->GetScenarioData( nTab, aComment, aColor, nScenFlags );
pUndoDoc->SetScenarioData( nTab, aComment, aColor, nScenFlags );
- BOOL bActive = pDoc->IsActiveScenario( nTab );
+ sal_Bool bActive = pDoc->IsActiveScenario( nTab );
pUndoDoc->SetActiveScenario( nTab, bActive );
}
pUndoDoc->SetVisible( nTab, pDoc->IsVisible( nTab ) );
@@ -2829,7 +2829,7 @@ BOOL ScDocFunc::DeleteTable( SCTAB nTab, BOOL bRecord, BOOL /* bApi */ )
}
String sCodeName;
- BOOL bHasCodeName = pDoc->GetCodeName( nTab, sCodeName );
+ sal_Bool bHasCodeName = pDoc->GetCodeName( nTab, sCodeName );
if (pDoc->DeleteTab( nTab, pUndoDoc ))
{
if (bRecord)
@@ -2865,7 +2865,7 @@ BOOL ScDocFunc::DeleteTable( SCTAB nTab, BOOL bRecord, BOOL /* bApi */ )
pSfxApp->Broadcast( SfxSimpleHint( SC_HINT_DBAREAS_CHANGED ) );
pSfxApp->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
- bSuccess = TRUE;
+ bSuccess = sal_True;
}
else
{
@@ -2875,18 +2875,18 @@ BOOL ScDocFunc::DeleteTable( SCTAB nTab, BOOL bRecord, BOOL /* bApi */ )
return bSuccess;
}
-BOOL ScDocFunc::SetTableVisible( SCTAB nTab, BOOL bVisible, BOOL bApi )
+sal_Bool ScDocFunc::SetTableVisible( SCTAB nTab, sal_Bool bVisible, sal_Bool bApi )
{
ScDocument* pDoc = rDocShell.GetDocument();
- BOOL bUndo(pDoc->IsUndoEnabled());
+ sal_Bool bUndo(pDoc->IsUndoEnabled());
if ( pDoc->IsVisible( nTab ) == bVisible )
- return TRUE; // nichts zu tun - ok
+ return sal_True; // nichts zu tun - ok
if ( !pDoc->IsDocEditable() )
{
if (!bApi)
rDocShell.ErrorMessage(STR_PROTECTIONERR);
- return FALSE;
+ return false;
}
ScDocShellModificator aModificator( rDocShell );
@@ -2895,7 +2895,7 @@ BOOL ScDocFunc::SetTableVisible( SCTAB nTab, BOOL bVisible, BOOL bApi )
{
// nicht alle Tabellen ausblenden
- USHORT nVisCount = 0;
+ sal_uInt16 nVisCount = 0;
SCTAB nCount = pDoc->GetTableCount();
for (SCTAB i=0; i<nCount; i++)
if (pDoc->IsVisible(i))
@@ -2905,7 +2905,7 @@ BOOL ScDocFunc::SetTableVisible( SCTAB nTab, BOOL bVisible, BOOL bApi )
{
if (!bApi)
rDocShell.ErrorMessage(STR_PROTECTIONERR); //! eigene Meldung?
- return FALSE;
+ return false;
}
}
@@ -2921,15 +2921,15 @@ BOOL ScDocFunc::SetTableVisible( SCTAB nTab, BOOL bVisible, BOOL bApi )
rDocShell.PostPaint(0,0,0,MAXCOL,MAXROW,MAXTAB, PAINT_EXTRAS);
aModificator.SetDocumentModified();
- return TRUE;
+ return sal_True;
}
-BOOL ScDocFunc::SetLayoutRTL( SCTAB nTab, BOOL bRTL, BOOL /* bApi */ )
+sal_Bool ScDocFunc::SetLayoutRTL( SCTAB nTab, sal_Bool bRTL, sal_Bool /* bApi */ )
{
ScDocument* pDoc = rDocShell.GetDocument();
- BOOL bUndo(pDoc->IsUndoEnabled());
+ sal_Bool bUndo(pDoc->IsUndoEnabled());
if ( pDoc->IsLayoutRTL( nTab ) == bRTL )
- return TRUE; // nothing to do - ok
+ return sal_True; // nothing to do - ok
//! protection (sheet or document?)
@@ -2952,24 +2952,24 @@ BOOL ScDocFunc::SetLayoutRTL( SCTAB nTab, BOOL bRTL, BOOL /* bApi */ )
pBindings->Invalidate( SID_ATTR_SIZE );
}
- return TRUE;
+ return sal_True;
}
-BOOL ScDocFunc::RenameTable( SCTAB nTab, const String& rName, BOOL bRecord, BOOL bApi )
+sal_Bool ScDocFunc::RenameTable( SCTAB nTab, const String& rName, sal_Bool bRecord, sal_Bool bApi )
{
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = FALSE;
+ bRecord = false;
if ( !pDoc->IsDocEditable() )
{
if (!bApi)
rDocShell.ErrorMessage(STR_PROTECTIONERR);
- return FALSE;
+ return false;
}
ScDocShellModificator aModificator( rDocShell );
- BOOL bSuccess = FALSE;
+ sal_Bool bSuccess = false;
String sOldName;
pDoc->GetName(nTab, sOldName);
if (pDoc->RenameTab( nTab, rName ))
@@ -2983,7 +2983,7 @@ BOOL ScDocFunc::RenameTable( SCTAB nTab, const String& rName, BOOL bRecord, BOOL
aModificator.SetDocumentModified();
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
- bSuccess = TRUE;
+ bSuccess = sal_True;
}
return bSuccess;
}
@@ -3039,7 +3039,7 @@ bool ScDocFunc::SetTabBgColor(
return false;
}
- USHORT nTab;
+ sal_uInt16 nTab;
Color aNewTabBgColor;
bool bSuccess = true;
size_t nTabProtectCount = 0;
@@ -3093,9 +3093,9 @@ bool ScDocFunc::SetTabBgColor(
//! - Optimale Hoehe fuer Edit-Zellen ist unterschiedlich zwischen Drucker und Bildschirm
//! - Optimale Breite braucht Selektion, um evtl. nur selektierte Zellen zu beruecksichtigen
-USHORT lcl_GetOptimalColWidth( ScDocShell& rDocShell, SCCOL nCol, SCTAB nTab, BOOL bFormula )
+sal_uInt16 lcl_GetOptimalColWidth( ScDocShell& rDocShell, SCCOL nCol, SCTAB nTab, sal_Bool bFormula )
{
- USHORT nTwips = 0;
+ sal_uInt16 nTwips = 0;
ScSizeDeviceProvider aProv(&rDocShell);
OutputDevice* pDev = aProv.GetDevice(); // has pixel MapMode
@@ -3110,30 +3110,32 @@ USHORT lcl_GetOptimalColWidth( ScDocShell& rDocShell, SCCOL nCol, SCTAB nTab, BO
return nTwips;
}
-BOOL ScDocFunc::SetWidthOrHeight( BOOL bWidth, SCCOLROW nRangeCnt, SCCOLROW* pRanges, SCTAB nTab,
- ScSizeMode eMode, USHORT nSizeTwips,
- BOOL bRecord, BOOL bApi )
+sal_Bool ScDocFunc::SetWidthOrHeight( sal_Bool bWidth, SCCOLROW nRangeCnt, SCCOLROW* pRanges, SCTAB nTab,
+ ScSizeMode eMode, sal_uInt16 nSizeTwips,
+ sal_Bool bRecord, sal_Bool bApi )
{
+ ScDocShellModificator aModificator( rDocShell );
+
if (!nRangeCnt)
- return TRUE;
+ return sal_True;
ScDocument* pDoc = rDocShell.GetDocument();
if ( bRecord && !pDoc->IsUndoEnabled() )
- bRecord = FALSE;
+ bRecord = false;
// import into read-only document is possible
if ( !pDoc->IsChangeReadOnlyEnabled() && !rDocShell.IsEditable() )
{
if (!bApi)
rDocShell.ErrorMessage(STR_PROTECTIONERR); //! eigene Meldung?
- return FALSE;
+ return false;
}
- BOOL bSuccess = FALSE;
+ sal_Bool bSuccess = false;
SCCOLROW nStart = pRanges[0];
SCCOLROW nEnd = pRanges[2*nRangeCnt-1];
- BOOL bFormula = FALSE;
+ sal_Bool bFormula = false;
if ( eMode == SC_SIZE_OPTIMAL )
{
//! Option "Formeln anzeigen" - woher nehmen?
@@ -3150,13 +3152,13 @@ BOOL ScDocFunc::SetWidthOrHeight( BOOL bWidth, SCCOLROW nRangeCnt, SCCOLROW* pRa
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
if (bWidth)
{
- pUndoDoc->InitUndo( pDoc, nTab, nTab, TRUE, FALSE );
- pDoc->CopyToDocument( static_cast<SCCOL>(nStart), 0, nTab, static_cast<SCCOL>(nEnd), MAXROW, nTab, IDF_NONE, FALSE, pUndoDoc );
+ pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_True, false );
+ pDoc->CopyToDocument( static_cast<SCCOL>(nStart), 0, nTab, static_cast<SCCOL>(nEnd), MAXROW, nTab, IDF_NONE, false, pUndoDoc );
}
else
{
- pUndoDoc->InitUndo( pDoc, nTab, nTab, FALSE, TRUE );
- pDoc->CopyToDocument( 0, static_cast<SCROW>(nStart), nTab, MAXCOL, static_cast<SCROW>(nEnd), nTab, IDF_NONE, FALSE, pUndoDoc );
+ pUndoDoc->InitUndo( pDoc, nTab, nTab, false, sal_True );
+ pDoc->CopyToDocument( 0, static_cast<SCROW>(nStart), nTab, MAXCOL, static_cast<SCROW>(nEnd), nTab, IDF_NONE, false, pUndoDoc );
}
pUndoRanges = new SCCOLROW[ 2*nRangeCnt ];
@@ -3167,8 +3169,8 @@ BOOL ScDocFunc::SetWidthOrHeight( BOOL bWidth, SCCOLROW nRangeCnt, SCCOLROW* pRa
pUndoTab = new ScOutlineTable( *pTable );
}
- BOOL bShow = nSizeTwips > 0 || eMode != SC_SIZE_DIRECT;
- BOOL bOutline = FALSE;
+ sal_Bool bShow = nSizeTwips > 0 || eMode != SC_SIZE_DIRECT;
+ sal_Bool bOutline = false;
pDoc->InitializeNoteCaptions(nTab);
for (SCCOLROW nRangeNo=0; nRangeNo<nRangeCnt; nRangeNo++)
@@ -3180,14 +3182,14 @@ BOOL ScDocFunc::SetWidthOrHeight( BOOL bWidth, SCCOLROW nRangeCnt, SCCOLROW* pRa
{
if ( eMode==SC_SIZE_OPTIMAL || eMode==SC_SIZE_VISOPT )
{
- BOOL bAll = ( eMode==SC_SIZE_OPTIMAL );
+ sal_Bool bAll = ( eMode==SC_SIZE_OPTIMAL );
if (!bAll)
{
// fuer alle eingeblendeten CR_MANUALSIZE loeschen,
// dann SetOptimalHeight mit bShrink = FALSE
for (SCROW nRow=nStartNo; nRow<=nEndNo; nRow++)
{
- BYTE nOld = pDoc->GetRowFlags(nRow,nTab);
+ sal_uInt8 nOld = pDoc->GetRowFlags(nRow,nTab);
SCROW nLastRow = -1;
bool bHidden = pDoc->RowHidden(nRow, nTab, NULL, &nLastRow);
if ( !bHidden && ( nOld & CR_MANUALSIZE ) )
@@ -3201,9 +3203,9 @@ BOOL ScDocFunc::SetWidthOrHeight( BOOL bWidth, SCCOLROW nRangeCnt, SCCOLROW* pRa
aProv.GetPPTX(), aProv.GetPPTY(), aOne, aOne, bAll );
if (bAll)
- pDoc->ShowRows( nStartNo, nEndNo, nTab, TRUE );
+ pDoc->ShowRows( nStartNo, nEndNo, nTab, sal_True );
- // Manual-Flag wird bei bAll=TRUE schon in SetOptimalHeight gesetzt
+ // Manual-Flag wird bei bAll=sal_True schon in SetOptimalHeight gesetzt
// (an bei Extra-Height, sonst aus).
}
else if ( eMode==SC_SIZE_DIRECT || eMode==SC_SIZE_ORIGINAL )
@@ -3211,14 +3213,14 @@ BOOL ScDocFunc::SetWidthOrHeight( BOOL bWidth, SCCOLROW nRangeCnt, SCCOLROW* pRa
if (nSizeTwips)
{
pDoc->SetRowHeightRange( nStartNo, nEndNo, nTab, nSizeTwips );
- pDoc->SetManualHeight( nStartNo, nEndNo, nTab, TRUE ); // height was set manually
+ pDoc->SetManualHeight( nStartNo, nEndNo, nTab, sal_True ); // height was set manually
}
if ( eMode != SC_SIZE_ORIGINAL )
pDoc->ShowRows( nStartNo, nEndNo, nTab, nSizeTwips != 0 );
}
else if ( eMode==SC_SIZE_SHOW )
{
- pDoc->ShowRows( nStartNo, nEndNo, nTab, TRUE );
+ pDoc->ShowRows( nStartNo, nEndNo, nTab, sal_True );
}
}
else // Spaltenbreiten
@@ -3227,7 +3229,7 @@ BOOL ScDocFunc::SetWidthOrHeight( BOOL bWidth, SCCOLROW nRangeCnt, SCCOLROW* pRa
{
if ( eMode != SC_SIZE_VISOPT || !pDoc->ColHidden(nCol, nTab) )
{
- USHORT nThisSize = nSizeTwips;
+ sal_uInt16 nThisSize = nSizeTwips;
if ( eMode==SC_SIZE_OPTIMAL || eMode==SC_SIZE_VISOPT )
nThisSize = nSizeTwips +
@@ -3274,26 +3276,27 @@ BOOL ScDocFunc::SetWidthOrHeight( BOOL bWidth, SCCOLROW nRangeCnt, SCCOLROW* pRa
pDoc->UpdatePageBreaks( nTab );
rDocShell.PostPaint(0,0,nTab,MAXCOL,MAXROW,nTab,PAINT_ALL);
+ aModificator.SetDocumentModified();
return bSuccess;
}
-BOOL ScDocFunc::InsertPageBreak( BOOL bColumn, const ScAddress& rPos,
- BOOL bRecord, BOOL bSetModified, BOOL /* bApi */ )
+sal_Bool ScDocFunc::InsertPageBreak( sal_Bool bColumn, const ScAddress& rPos,
+ sal_Bool bRecord, sal_Bool bSetModified, sal_Bool /* bApi */ )
{
ScDocShellModificator aModificator( rDocShell );
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = FALSE;
+ bRecord = false;
SCTAB nTab = rPos.Tab();
SfxBindings* pBindings = rDocShell.GetViewBindings();
SCCOLROW nPos = bColumn ? static_cast<SCCOLROW>(rPos.Col()) :
static_cast<SCCOLROW>(rPos.Row());
if (nPos == 0)
- return FALSE; // erste Spalte / Zeile
+ return false; // erste Spalte / Zeile
ScBreakType nBreak = bColumn ?
pDoc->HasColBreak(static_cast<SCCOL>(nPos), nTab) :
@@ -3303,7 +3306,7 @@ BOOL ScDocFunc::InsertPageBreak( BOOL bColumn, const ScAddress& rPos,
if (bRecord)
rDocShell.GetUndoManager()->AddUndoAction(
- new ScUndoPageBreak( &rDocShell, rPos.Col(), rPos.Row(), nTab, bColumn, TRUE ) );
+ new ScUndoPageBreak( &rDocShell, rPos.Col(), rPos.Row(), nTab, bColumn, sal_True ) );
if (bColumn)
pDoc->SetColBreak(static_cast<SCCOL>(nPos), nTab, false, true);
@@ -3314,7 +3317,7 @@ BOOL ScDocFunc::InsertPageBreak( BOOL bColumn, const ScAddress& rPos,
pDoc->UpdatePageBreaks( nTab );
if (pDoc->IsStreamValid(nTab))
- pDoc->SetStreamValid(nTab, FALSE);
+ pDoc->SetStreamValid(nTab, false);
if (bColumn)
{
@@ -3340,17 +3343,17 @@ BOOL ScDocFunc::InsertPageBreak( BOOL bColumn, const ScAddress& rPos,
if (bSetModified)
aModificator.SetDocumentModified();
- return TRUE;
+ return sal_True;
}
-BOOL ScDocFunc::RemovePageBreak( BOOL bColumn, const ScAddress& rPos,
- BOOL bRecord, BOOL bSetModified, BOOL /* bApi */ )
+sal_Bool ScDocFunc::RemovePageBreak( sal_Bool bColumn, const ScAddress& rPos,
+ sal_Bool bRecord, sal_Bool bSetModified, sal_Bool /* bApi */ )
{
ScDocShellModificator aModificator( rDocShell );
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = FALSE;
+ bRecord = false;
SCTAB nTab = rPos.Tab();
SfxBindings* pBindings = rDocShell.GetViewBindings();
@@ -3368,7 +3371,7 @@ BOOL ScDocFunc::RemovePageBreak( BOOL bColumn, const ScAddress& rPos,
if (bRecord)
rDocShell.GetUndoManager()->AddUndoAction(
- new ScUndoPageBreak( &rDocShell, rPos.Col(), rPos.Row(), nTab, bColumn, FALSE ) );
+ new ScUndoPageBreak( &rDocShell, rPos.Col(), rPos.Row(), nTab, bColumn, false ) );
if (bColumn)
pDoc->RemoveColBreak(static_cast<SCCOL>(nPos), nTab, false, true);
@@ -3378,7 +3381,7 @@ BOOL ScDocFunc::RemovePageBreak( BOOL bColumn, const ScAddress& rPos,
pDoc->UpdatePageBreaks( nTab );
if (pDoc->IsStreamValid(nTab))
- pDoc->SetStreamValid(nTab, FALSE);
+ pDoc->SetStreamValid(nTab, false);
if (bColumn)
{
@@ -3404,7 +3407,7 @@ BOOL ScDocFunc::RemovePageBreak( BOOL bColumn, const ScAddress& rPos,
if (bSetModified)
aModificator.SetDocumentModified();
- return TRUE;
+ return sal_True;
}
//------------------------------------------------------------------------
@@ -3434,7 +3437,7 @@ void ScDocFunc::ProtectSheet( SCTAB nTab, const ScTableProtection& rProtect )
aModificator.SetDocumentModified();
}
-BOOL ScDocFunc::Protect( SCTAB nTab, const String& rPassword, BOOL /*bApi*/ )
+sal_Bool ScDocFunc::Protect( SCTAB nTab, const String& rPassword, sal_Bool /*bApi*/ )
{
ScDocument* pDoc = rDocShell.GetDocument();
if (nTab == TABLEID_DOC)
@@ -3488,7 +3491,7 @@ BOOL ScDocFunc::Protect( SCTAB nTab, const String& rPassword, BOOL /*bApi*/ )
return true;
}
-BOOL ScDocFunc::Unprotect( SCTAB nTab, const String& rPassword, BOOL bApi )
+sal_Bool ScDocFunc::Unprotect( SCTAB nTab, const String& rPassword, sal_Bool bApi )
{
ScDocument* pDoc = rDocShell.GetDocument();
@@ -3563,18 +3566,18 @@ BOOL ScDocFunc::Unprotect( SCTAB nTab, const String& rPassword, BOOL bApi )
//------------------------------------------------------------------------
-BOOL ScDocFunc::ClearItems( const ScMarkData& rMark, const USHORT* pWhich, BOOL bApi )
+sal_Bool ScDocFunc::ClearItems( const ScMarkData& rMark, const sal_uInt16* pWhich, sal_Bool bApi )
{
ScDocShellModificator aModificator( rDocShell );
ScDocument* pDoc = rDocShell.GetDocument();
- BOOL bUndo (pDoc->IsUndoEnabled());
+ sal_Bool bUndo (pDoc->IsUndoEnabled());
ScEditableTester aTester( pDoc, rMark );
if (!aTester.IsEditable())
{
if (!bApi)
rDocShell.ErrorMessage(aTester.GetMessageId());
- return FALSE;
+ return false;
}
// #i12940# ClearItems is called (from setPropertyToDefault) directly with uno object's cached
@@ -3583,7 +3586,7 @@ BOOL ScDocFunc::ClearItems( const ScMarkData& rMark, const USHORT* pWhich, BOOL
ScRange aMarkRange;
ScMarkData aMultiMark = rMark;
- aMultiMark.SetMarking(FALSE); // for MarkToMulti
+ aMultiMark.SetMarking(false); // for MarkToMulti
aMultiMark.MarkToMulti();
aMultiMark.GetMultiMarkArea( aMarkRange );
@@ -3594,7 +3597,7 @@ BOOL ScDocFunc::ClearItems( const ScMarkData& rMark, const USHORT* pWhich, BOOL
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
pUndoDoc->InitUndo( pDoc, nStartTab, nEndTab );
- pDoc->CopyToDocument( aMarkRange, IDF_ATTRIB, TRUE, pUndoDoc, (ScMarkData*)&aMultiMark );
+ pDoc->CopyToDocument( aMarkRange, IDF_ATTRIB, sal_True, pUndoDoc, (ScMarkData*)&aMultiMark );
rDocShell.GetUndoManager()->AddUndoAction(
new ScUndoClearItems( &rDocShell, aMultiMark, pUndoDoc, pWhich ) );
@@ -3607,21 +3610,21 @@ BOOL ScDocFunc::ClearItems( const ScMarkData& rMark, const USHORT* pWhich, BOOL
//! Bindings-Invalidate etc.?
- return TRUE;
+ return sal_True;
}
-BOOL ScDocFunc::ChangeIndent( const ScMarkData& rMark, BOOL bIncrement, BOOL bApi )
+sal_Bool ScDocFunc::ChangeIndent( const ScMarkData& rMark, sal_Bool bIncrement, sal_Bool bApi )
{
ScDocShellModificator aModificator( rDocShell );
ScDocument* pDoc = rDocShell.GetDocument();
- BOOL bUndo(pDoc->IsUndoEnabled());
+ sal_Bool bUndo(pDoc->IsUndoEnabled());
ScEditableTester aTester( pDoc, rMark );
if (!aTester.IsEditable())
{
if (!bApi)
rDocShell.ErrorMessage(aTester.GetMessageId());
- return FALSE;
+ return false;
}
ScRange aMarkRange;
@@ -3641,7 +3644,7 @@ BOOL ScDocFunc::ChangeIndent( const ScMarkData& rMark, BOOL bIncrement, BOOL bAp
ScRange aCopyRange = aMarkRange;
aCopyRange.aStart.SetTab(0);
aCopyRange.aEnd.SetTab(nTabCount-1);
- pDoc->CopyToDocument( aCopyRange, IDF_ATTRIB, TRUE, pUndoDoc, (ScMarkData*)&rMark );
+ pDoc->CopyToDocument( aCopyRange, IDF_ATTRIB, sal_True, pUndoDoc, (ScMarkData*)&rMark );
rDocShell.GetUndoManager()->AddUndoAction(
new ScUndoIndent( &rDocShell, rMark, pUndoDoc, bIncrement ) );
@@ -3667,15 +3670,15 @@ BOOL ScDocFunc::ChangeIndent( const ScMarkData& rMark, BOOL bIncrement, BOOL bAp
pBindings->Invalidate( SID_ALIGN_ANY_JUSTIFIED );
}
- return TRUE;
+ return sal_True;
}
-BOOL ScDocFunc::AutoFormat( const ScRange& rRange, const ScMarkData* pTabMark,
- USHORT nFormatNo, BOOL bRecord, BOOL bApi )
+sal_Bool ScDocFunc::AutoFormat( const ScRange& rRange, const ScMarkData* pTabMark,
+ sal_uInt16 nFormatNo, sal_Bool bRecord, sal_Bool bApi )
{
ScDocShellModificator aModificator( rDocShell );
- BOOL bSuccess = FALSE;
+ sal_Bool bSuccess = false;
ScDocument* pDoc = rDocShell.GetDocument();
SCCOL nStartCol = rRange.aStart.Col();
SCROW nStartRow = rRange.aStart.Row();
@@ -3685,14 +3688,14 @@ BOOL ScDocFunc::AutoFormat( const ScRange& rRange, const ScMarkData* pTabMark,
SCTAB nEndTab = rRange.aEnd.Tab();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = FALSE;
+ bRecord = false;
ScMarkData aMark;
if (pTabMark)
aMark = *pTabMark;
else
{
for (SCTAB nTab=nStartTab; nTab<=nEndTab; nTab++)
- aMark.SelectTable( nTab, TRUE );
+ aMark.SelectTable( nTab, sal_True );
}
ScAutoFormat* pAutoFormat = ScGlobal::GetAutoFormat();
@@ -3701,7 +3704,7 @@ BOOL ScDocFunc::AutoFormat( const ScRange& rRange, const ScMarkData* pTabMark,
{
WaitObject aWait( rDocShell.GetActiveDialogParent() );
- BOOL bSize = (*pAutoFormat)[nFormatNo]->GetIncludeWidthHeight();
+ sal_Bool bSize = (*pAutoFormat)[nFormatNo]->GetIncludeWidthHeight();
SCTAB nTabCount = pDoc->GetTableCount();
ScDocument* pUndoDoc = NULL;
@@ -3716,13 +3719,13 @@ BOOL ScDocFunc::AutoFormat( const ScRange& rRange, const ScMarkData* pTabMark,
ScRange aCopyRange = rRange;
aCopyRange.aStart.SetTab(0);
aCopyRange.aStart.SetTab(nTabCount-1);
- pDoc->CopyToDocument( aCopyRange, IDF_ATTRIB, FALSE, pUndoDoc, &aMark );
+ pDoc->CopyToDocument( aCopyRange, IDF_ATTRIB, false, pUndoDoc, &aMark );
if (bSize)
{
pDoc->CopyToDocument( nStartCol,0,0, nEndCol,MAXROW,nTabCount-1,
- IDF_NONE, FALSE, pUndoDoc, &aMark );
+ IDF_NONE, false, pUndoDoc, &aMark );
pDoc->CopyToDocument( 0,nStartRow,0, MAXCOL,nEndRow,nTabCount-1,
- IDF_NONE, FALSE, pUndoDoc, &aMark );
+ IDF_NONE, false, pUndoDoc, &aMark );
}
pDoc->BeginDrawUndo();
}
@@ -3737,8 +3740,8 @@ BOOL ScDocFunc::AutoFormat( const ScRange& rRange, const ScMarkData* pTabMark,
for (SCTAB nTab=0; nTab<nTabCount; nTab++)
if (aMark.GetTableSelect(nTab))
{
- SetWidthOrHeight( TRUE, 1,nCols, nTab, SC_SIZE_VISOPT, STD_EXTRA_WIDTH, FALSE, TRUE);
- SetWidthOrHeight( FALSE,1,nRows, nTab, SC_SIZE_VISOPT, 0, FALSE, FALSE);
+ SetWidthOrHeight( sal_True, 1,nCols, nTab, SC_SIZE_VISOPT, STD_EXTRA_WIDTH, false, sal_True);
+ SetWidthOrHeight( false,1,nRows, nTab, SC_SIZE_VISOPT, 0, false, false);
rDocShell.PostPaint( 0,0,nTab, MAXCOL,MAXROW,nTab,
PAINT_GRID | PAINT_LEFT | PAINT_TOP );
}
@@ -3748,8 +3751,8 @@ BOOL ScDocFunc::AutoFormat( const ScRange& rRange, const ScMarkData* pTabMark,
for (SCTAB nTab=0; nTab<nTabCount; nTab++)
if (aMark.GetTableSelect(nTab))
{
- BOOL bAdj = AdjustRowHeight( ScRange(nStartCol, nStartRow, nTab,
- nEndCol, nEndRow, nTab), FALSE );
+ sal_Bool bAdj = AdjustRowHeight( ScRange(nStartCol, nStartRow, nTab,
+ nEndCol, nEndRow, nTab), false );
if (bAdj)
rDocShell.PostPaint( 0,nStartRow,nTab, MAXCOL,MAXROW,nTab,
PAINT_GRID | PAINT_LEFT );
@@ -3775,13 +3778,13 @@ BOOL ScDocFunc::AutoFormat( const ScRange& rRange, const ScMarkData* pTabMark,
//------------------------------------------------------------------------
-BOOL ScDocFunc::EnterMatrix( const ScRange& rRange, const ScMarkData* pTabMark,
- const ScTokenArray* pTokenArray, const String& rString, BOOL bApi, BOOL bEnglish,
+sal_Bool ScDocFunc::EnterMatrix( const ScRange& rRange, const ScMarkData* pTabMark,
+ const ScTokenArray* pTokenArray, const String& rString, sal_Bool bApi, sal_Bool bEnglish,
const String& rFormulaNmsp, const formula::FormulaGrammar::Grammar eGrammar )
{
ScDocShellModificator aModificator( rDocShell );
- BOOL bSuccess = FALSE;
+ sal_Bool bSuccess = false;
ScDocument* pDoc = rDocShell.GetDocument();
SCCOL nStartCol = rRange.aStart.Col();
SCROW nStartRow = rRange.aStart.Row();
@@ -3790,7 +3793,7 @@ BOOL ScDocFunc::EnterMatrix( const ScRange& rRange, const ScMarkData* pTabMark,
SCROW nEndRow = rRange.aEnd.Row();
SCTAB nEndTab = rRange.aEnd.Tab();
- BOOL bUndo(pDoc->IsUndoEnabled());
+ sal_Bool bUndo(pDoc->IsUndoEnabled());
ScMarkData aMark;
if (pTabMark)
@@ -3798,7 +3801,7 @@ BOOL ScDocFunc::EnterMatrix( const ScRange& rRange, const ScMarkData* pTabMark,
else
{
for (SCTAB nTab=nStartTab; nTab<=nEndTab; nTab++)
- aMark.SelectTable( nTab, TRUE );
+ aMark.SelectTable( nTab, sal_True );
}
ScEditableTester aTester( pDoc, nStartCol,nStartRow, nEndCol,nEndRow, aMark );
@@ -3813,7 +3816,7 @@ BOOL ScDocFunc::EnterMatrix( const ScRange& rRange, const ScMarkData* pTabMark,
//! auch bei Undo selektierte Tabellen beruecksichtigen
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
pUndoDoc->InitUndo( pDoc, nStartTab, nEndTab );
- pDoc->CopyToDocument( rRange, IDF_ALL & ~IDF_NOTE, FALSE, pUndoDoc );
+ pDoc->CopyToDocument( rRange, IDF_ALL & ~IDF_NOTE, false, pUndoDoc );
}
// use TokenArray if given, string (and flags) otherwise
@@ -3854,7 +3857,7 @@ BOOL ScDocFunc::EnterMatrix( const ScRange& rRange, const ScMarkData* pTabMark,
rDocShell.PostPaint( nStartCol,nStartRow,nStartTab,nEndCol,nEndRow,nEndTab, PAINT_GRID );
aModificator.SetDocumentModified();
- bSuccess = TRUE;
+ bSuccess = sal_True;
}
else if (!bApi)
rDocShell.ErrorMessage(aTester.GetMessageId());
@@ -3864,12 +3867,12 @@ BOOL ScDocFunc::EnterMatrix( const ScRange& rRange, const ScMarkData* pTabMark,
//------------------------------------------------------------------------
-BOOL ScDocFunc::TabOp( const ScRange& rRange, const ScMarkData* pTabMark,
- const ScTabOpParam& rParam, BOOL bRecord, BOOL bApi )
+sal_Bool ScDocFunc::TabOp( const ScRange& rRange, const ScMarkData* pTabMark,
+ const ScTabOpParam& rParam, sal_Bool bRecord, sal_Bool bApi )
{
ScDocShellModificator aModificator( rDocShell );
- BOOL bSuccess = FALSE;
+ sal_Bool bSuccess = false;
ScDocument* pDoc = rDocShell.GetDocument();
SCCOL nStartCol = rRange.aStart.Col();
SCROW nStartRow = rRange.aStart.Row();
@@ -3879,7 +3882,7 @@ BOOL ScDocFunc::TabOp( const ScRange& rRange, const ScMarkData* pTabMark,
SCTAB nEndTab = rRange.aEnd.Tab();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = FALSE;
+ bRecord = false;
ScMarkData aMark;
if (pTabMark)
@@ -3887,7 +3890,7 @@ BOOL ScDocFunc::TabOp( const ScRange& rRange, const ScMarkData* pTabMark,
else
{
for (SCTAB nTab=nStartTab; nTab<=nEndTab; nTab++)
- aMark.SelectTable( nTab, TRUE );
+ aMark.SelectTable( nTab, sal_True );
}
ScEditableTester aTester( pDoc, nStartCol,nStartRow, nEndCol,nEndRow, aMark );
@@ -3900,7 +3903,7 @@ BOOL ScDocFunc::TabOp( const ScRange& rRange, const ScMarkData* pTabMark,
//! auch bei Undo selektierte Tabellen beruecksichtigen
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
pUndoDoc->InitUndo( pDoc, nStartTab, nEndTab );
- pDoc->CopyToDocument( rRange, IDF_ALL & ~IDF_NOTE, FALSE, pUndoDoc );
+ pDoc->CopyToDocument( rRange, IDF_ALL & ~IDF_NOTE, false, pUndoDoc );
rDocShell.GetUndoManager()->AddUndoAction(
new ScUndoTabOp( &rDocShell,
@@ -3915,7 +3918,7 @@ BOOL ScDocFunc::TabOp( const ScRange& rRange, const ScMarkData* pTabMark,
pDoc->InsertTableOp(rParam, nStartCol, nStartRow, nEndCol, nEndRow, aMark);
rDocShell.PostPaintGridAll();
aModificator.SetDocumentModified();
- bSuccess = TRUE;
+ bSuccess = sal_True;
}
else if (!bApi)
rDocShell.ErrorMessage(aTester.GetMessageId());
@@ -3937,12 +3940,12 @@ inline ScDirection DirFromFillDir( FillDir eDir )
return DIR_LEFT;
}
-BOOL ScDocFunc::FillSimple( const ScRange& rRange, const ScMarkData* pTabMark,
- FillDir eDir, BOOL bRecord, BOOL bApi )
+sal_Bool ScDocFunc::FillSimple( const ScRange& rRange, const ScMarkData* pTabMark,
+ FillDir eDir, sal_Bool bRecord, sal_Bool bApi )
{
ScDocShellModificator aModificator( rDocShell );
- BOOL bSuccess = FALSE;
+ sal_Bool bSuccess = false;
ScDocument* pDoc = rDocShell.GetDocument();
SCCOL nStartCol = rRange.aStart.Col();
SCROW nStartRow = rRange.aStart.Row();
@@ -3952,7 +3955,7 @@ BOOL ScDocFunc::FillSimple( const ScRange& rRange, const ScMarkData* pTabMark,
SCTAB nEndTab = rRange.aEnd.Tab();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = FALSE;
+ bRecord = false;
ScMarkData aMark;
if (pTabMark)
@@ -3960,7 +3963,7 @@ BOOL ScDocFunc::FillSimple( const ScRange& rRange, const ScMarkData* pTabMark,
else
{
for (SCTAB nTab=nStartTab; nTab<=nEndTab; nTab++)
- aMark.SelectTable( nTab, TRUE );
+ aMark.SelectTable( nTab, sal_True );
}
ScEditableTester aTester( pDoc, nStartCol,nStartRow, nEndCol,nEndRow, aMark );
@@ -4007,7 +4010,7 @@ BOOL ScDocFunc::FillSimple( const ScRange& rRange, const ScMarkData* pTabMark,
ScRange aCopyRange = aDestArea;
aCopyRange.aStart.SetTab(0);
aCopyRange.aEnd.SetTab(nTabCount-1);
- pDoc->CopyToDocument( aCopyRange, IDF_AUTOFILL, FALSE, pUndoDoc, &aMark );
+ pDoc->CopyToDocument( aCopyRange, IDF_AUTOFILL, false, pUndoDoc, &aMark );
}
pDoc->Fill( aSourceArea.aStart.Col(), aSourceArea.aStart.Row(),
@@ -4026,7 +4029,7 @@ BOOL ScDocFunc::FillSimple( const ScRange& rRange, const ScMarkData* pTabMark,
rDocShell.PostPaintGridAll();
aModificator.SetDocumentModified();
- bSuccess = TRUE;
+ bSuccess = sal_True;
}
else if (!bApi)
rDocShell.ErrorMessage(aTester.GetMessageId());
@@ -4034,14 +4037,14 @@ BOOL ScDocFunc::FillSimple( const ScRange& rRange, const ScMarkData* pTabMark,
return bSuccess;
}
-BOOL ScDocFunc::FillSeries( const ScRange& rRange, const ScMarkData* pTabMark,
+sal_Bool ScDocFunc::FillSeries( const ScRange& rRange, const ScMarkData* pTabMark,
FillDir eDir, FillCmd eCmd, FillDateCmd eDateCmd,
double fStart, double fStep, double fMax,
- BOOL bRecord, BOOL bApi )
+ sal_Bool bRecord, sal_Bool bApi )
{
ScDocShellModificator aModificator( rDocShell );
- BOOL bSuccess = FALSE;
+ sal_Bool bSuccess = false;
ScDocument* pDoc = rDocShell.GetDocument();
SCCOL nStartCol = rRange.aStart.Col();
SCROW nStartRow = rRange.aStart.Row();
@@ -4051,7 +4054,7 @@ BOOL ScDocFunc::FillSeries( const ScRange& rRange, const ScMarkData* pTabMark,
SCTAB nEndTab = rRange.aEnd.Tab();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = FALSE;
+ bRecord = false;
ScMarkData aMark;
if (pTabMark)
@@ -4059,7 +4062,7 @@ BOOL ScDocFunc::FillSeries( const ScRange& rRange, const ScMarkData* pTabMark,
else
{
for (SCTAB nTab=nStartTab; nTab<=nEndTab; nTab++)
- aMark.SelectTable( nTab, TRUE );
+ aMark.SelectTable( nTab, sal_True );
}
ScEditableTester aTester( pDoc, nStartCol,nStartRow, nEndCol,nEndRow, aMark );
@@ -4113,7 +4116,7 @@ BOOL ScDocFunc::FillSeries( const ScRange& rRange, const ScMarkData* pTabMark,
pDoc->CopyToDocument(
aDestArea.aStart.Col(), aDestArea.aStart.Row(), 0,
aDestArea.aEnd.Col(), aDestArea.aEnd.Row(), nTabCount-1,
- IDF_AUTOFILL, FALSE, pUndoDoc, &aMark );
+ IDF_AUTOFILL, false, pUndoDoc, &aMark );
}
if (aDestArea.aStart.Col() <= aDestArea.aEnd.Col() &&
@@ -4143,7 +4146,7 @@ BOOL ScDocFunc::FillSeries( const ScRange& rRange, const ScMarkData* pTabMark,
pDoc->GetRangeName()->GetSharedMaxIndex()+1 ) );
}
- bSuccess = TRUE;
+ bSuccess = sal_True;
}
else if (!bApi)
rDocShell.ErrorMessage(aTester.GetMessageId());
@@ -4151,15 +4154,15 @@ BOOL ScDocFunc::FillSeries( const ScRange& rRange, const ScMarkData* pTabMark,
return bSuccess;
}
-BOOL ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark,
- FillDir eDir, ULONG nCount, BOOL bRecord, BOOL bApi )
+sal_Bool ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark,
+ FillDir eDir, sal_uLong nCount, sal_Bool bRecord, sal_Bool bApi )
{
double fStep = 1.0;
double fMax = MAXDOUBLE;
return FillAuto( rRange, pTabMark, eDir, FILL_AUTO, FILL_DAY, nCount, fStep, fMax, bRecord, bApi );
}
-BOOL ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillDir eDir, FillCmd eCmd, FillDateCmd eDateCmd, ULONG nCount, double fStep, double fMax, BOOL bRecord, BOOL bApi )
+sal_Bool ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillDir eDir, FillCmd eCmd, FillDateCmd eDateCmd, sal_uLong nCount, double fStep, double fMax, sal_Bool bRecord, sal_Bool bApi )
{
ScDocShellModificator aModificator( rDocShell );
@@ -4172,7 +4175,7 @@ BOOL ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillDir e
SCTAB nEndTab = rRange.aEnd.Tab();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = FALSE;
+ bRecord = false;
ScMarkData aMark;
if (pTabMark)
@@ -4180,7 +4183,7 @@ BOOL ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillDir e
else
{
for (SCTAB nTab=nStartTab; nTab<=nEndTab; nTab++)
- aMark.SelectTable( nTab, TRUE );
+ aMark.SelectTable( nTab, sal_True );
}
ScRange aSourceArea = rRange;
@@ -4193,7 +4196,7 @@ BOOL ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillDir e
aDestArea.aEnd.SetRow( sal::static_int_cast<SCROW>( aSourceArea.aEnd.Row() + nCount ) );
break;
case FILL_TO_TOP:
- if (nCount > sal::static_int_cast<ULONG>( aSourceArea.aStart.Row() ))
+ if (nCount > sal::static_int_cast<sal_uLong>( aSourceArea.aStart.Row() ))
{
OSL_FAIL("FillAuto: Row < 0");
nCount = aSourceArea.aStart.Row();
@@ -4204,7 +4207,7 @@ BOOL ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillDir e
aDestArea.aEnd.SetCol( sal::static_int_cast<SCCOL>( aSourceArea.aEnd.Col() + nCount ) );
break;
case FILL_TO_LEFT:
- if (nCount > sal::static_int_cast<ULONG>( aSourceArea.aStart.Col() ))
+ if (nCount > sal::static_int_cast<sal_uLong>( aSourceArea.aStart.Col() ))
{
OSL_FAIL("FillAuto: Col < 0");
nCount = aSourceArea.aStart.Col();
@@ -4225,7 +4228,7 @@ BOOL ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillDir e
{
if (!bApi)
rDocShell.ErrorMessage(aTester.GetMessageId());
- return FALSE;
+ return false;
}
if ( pDoc->HasSelectedBlockMatrixFragment( nStartCol, nStartRow,
@@ -4233,7 +4236,7 @@ BOOL ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillDir e
{
if (!bApi)
rDocShell.ErrorMessage(STR_MATRIXFRAGMENTERR);
- return FALSE;
+ return false;
}
WaitObject aWait( rDocShell.GetActiveDialogParent() );
@@ -4254,7 +4257,7 @@ BOOL ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillDir e
pDoc->CopyToDocument(
aDestArea.aStart.Col(), aDestArea.aStart.Row(), 0,
aDestArea.aEnd.Col(), aDestArea.aEnd.Row(), nTabCount-1,
- IDF_AUTOFILL, FALSE, pUndoDoc, &aMark );
+ IDF_AUTOFILL, false, pUndoDoc, &aMark );
}
pDoc->Fill( aSourceArea.aStart.Col(), aSourceArea.aStart.Row(),
@@ -4275,12 +4278,12 @@ BOOL ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillDir e
aModificator.SetDocumentModified();
rRange = aDestArea; // Zielbereich zurueckgeben (zum Markieren)
- return TRUE;
+ return sal_True;
}
//------------------------------------------------------------------------
-BOOL ScDocFunc::MergeCells( const ScCellMergeOption& rOption, BOOL bContents, BOOL bRecord, BOOL bApi )
+sal_Bool ScDocFunc::MergeCells( const ScCellMergeOption& rOption, sal_Bool bContents, sal_Bool bRecord, sal_Bool bApi )
{
using ::std::set;
@@ -4293,7 +4296,7 @@ BOOL ScDocFunc::MergeCells( const ScCellMergeOption& rOption, BOOL bContents, BO
if ((nStartCol == nEndCol && nStartRow == nEndRow) || rOption.maTabs.empty())
{
// Nothing to do. Bail out quick.
- return TRUE;
+ return true;
}
ScDocument* pDoc = rDocShell.GetDocument();
@@ -4301,7 +4304,7 @@ BOOL ScDocFunc::MergeCells( const ScCellMergeOption& rOption, BOOL bContents, BO
SCTAB nTab1 = *itrBeg, nTab2 = *rOption.maTabs.rbegin();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = FALSE;
+ bRecord = false;
for (set<SCTAB>::const_iterator itr = itrBeg; itr != itrEnd; ++itr)
{
@@ -4310,7 +4313,7 @@ BOOL ScDocFunc::MergeCells( const ScCellMergeOption& rOption, BOOL bContents, BO
{
if (!bApi)
rDocShell.ErrorMessage(aTester.GetMessageId());
- return FALSE;
+ return false;
}
if ( pDoc->HasAttrib( nStartCol, nStartRow, *itr, nEndCol, nEndRow, *itr,
@@ -4319,7 +4322,7 @@ BOOL ScDocFunc::MergeCells( const ScCellMergeOption& rOption, BOOL bContents, BO
// "Zusammenfassen nicht verschachteln !"
if (!bApi)
rDocShell.ErrorMessage(STR_MSSG_MERGECELLS_0);
- return FALSE;
+ return false;
}
}
@@ -4349,7 +4352,7 @@ BOOL ScDocFunc::MergeCells( const ScCellMergeOption& rOption, BOOL bContents, BO
}
// note captions are collected by drawing undo
pDoc->CopyToDocument( nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab,
- IDF_ALL|IDF_NOCAPTIONS, FALSE, pUndoDoc );
+ IDF_ALL|IDF_NOCAPTIONS, false, pUndoDoc );
}
if( bHasNotes )
pDoc->BeginDrawUndo();
@@ -4394,10 +4397,10 @@ BOOL ScDocFunc::MergeCells( const ScCellMergeOption& rOption, BOOL bContents, BO
pBindings->Invalidate( FID_MERGE_TOGGLE );
}
- return TRUE;
+ return sal_True;
}
-BOOL ScDocFunc::UnmergeCells( const ScRange& rRange, BOOL bRecord, BOOL bApi )
+sal_Bool ScDocFunc::UnmergeCells( const ScRange& rRange, sal_Bool bRecord, sal_Bool bApi )
{
ScCellMergeOption aOption(rRange.aStart.Col(), rRange.aStart.Row(), rRange.aEnd.Col(), rRange.aEnd.Row());
SCTAB nTab1 = rRange.aStart.Tab(), nTab2 = rRange.aEnd.Tab();
@@ -4407,7 +4410,7 @@ BOOL ScDocFunc::UnmergeCells( const ScRange& rRange, BOOL bRecord, BOOL bApi )
return UnmergeCells(aOption, bRecord, bApi);
}
-bool ScDocFunc::UnmergeCells( const ScCellMergeOption& rOption, BOOL bRecord, BOOL bApi )
+bool ScDocFunc::UnmergeCells( const ScCellMergeOption& rOption, sal_Bool bRecord, sal_Bool bApi )
{
using ::std::set;
@@ -4419,7 +4422,7 @@ bool ScDocFunc::UnmergeCells( const ScCellMergeOption& rOption, BOOL bRecord, BO
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = FALSE;
+ bRecord = false;
ScDocument* pUndoDoc = NULL;
bool bBeep = false;
@@ -4446,7 +4449,7 @@ bool ScDocFunc::UnmergeCells( const ScCellMergeOption& rOption, BOOL bRecord, BO
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
pUndoDoc->InitUndo(pDoc, *rOption.maTabs.begin(), *rOption.maTabs.rbegin());
}
- pDoc->CopyToDocument(aExtended, IDF_ATTRIB, FALSE, pUndoDoc);
+ pDoc->CopyToDocument(aExtended, IDF_ATTRIB, false, pUndoDoc);
}
const SfxPoolItem& rDefAttr = pDoc->GetPool()->GetDefaultItem( ATTR_MERGE );
@@ -4460,7 +4463,7 @@ bool ScDocFunc::UnmergeCells( const ScCellMergeOption& rOption, BOOL bRecord, BO
aExtended.aEnd.Col(), aExtended.aEnd.Row(), nTab,
SC_MF_HOR | SC_MF_VER );
- pDoc->ExtendMerge( aRefresh, TRUE, FALSE );
+ pDoc->ExtendMerge( aRefresh, sal_True, false );
if ( !AdjustRowHeight( aExtended ) )
rDocShell.PostPaint( aExtended, PAINT_GRID );
@@ -4475,7 +4478,7 @@ bool ScDocFunc::UnmergeCells( const ScCellMergeOption& rOption, BOOL bRecord, BO
}
aModificator.SetDocumentModified();
- return TRUE;
+ return sal_True;
}
//------------------------------------------------------------------------
@@ -4491,7 +4494,7 @@ bool ScDocFunc::SetNewRangeNames( ScRangeName* pNewRanges, bool bModifyDoc )
DBG_ASSERT( pNewRanges, "pNewRanges is 0" );
ScDocument* pDoc = rDocShell.GetDocument();
- BOOL bUndo(pDoc->IsUndoEnabled());
+ sal_Bool bUndo(pDoc->IsUndoEnabled());
if (bUndo)
{
@@ -4505,13 +4508,13 @@ bool ScDocFunc::SetNewRangeNames( ScRangeName* pNewRanges, bool bModifyDoc )
// #i55926# While loading XML, formula cells only have a single string token,
// so CompileNameFormula would never find any name (index) tokens, and would
// unnecessarily loop through all cells.
- BOOL bCompile = ( !pDoc->IsImportingXML() && pDoc->GetNamedRangesLockCount() == 0 );
+ sal_Bool bCompile = ( !pDoc->IsImportingXML() && pDoc->GetNamedRangesLockCount() == 0 );
if ( bCompile )
- pDoc->CompileNameFormula( TRUE ); // CreateFormulaString
+ pDoc->CompileNameFormula( sal_True ); // CreateFormulaString
pDoc->SetRangeName( pNewRanges ); // takes ownership
if ( bCompile )
- pDoc->CompileNameFormula( FALSE ); // CompileFormulaString
+ pDoc->CompileNameFormula( false ); // CompileFormulaString
if (bModifyDoc)
{
@@ -4527,7 +4530,7 @@ bool ScDocFunc::SetNewRangeNames( ScRangeName* pNewRanges, bool bModifyDoc )
void ScDocFunc::CreateOneName( ScRangeName& rList,
SCCOL nPosX, SCROW nPosY, SCTAB nTab,
SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
- BOOL& rCancel, BOOL bApi )
+ sal_Bool& rCancel, sal_Bool bApi )
{
if (rCancel)
return;
@@ -4552,7 +4555,7 @@ void ScDocFunc::CreateOneName( ScRangeName& rList,
if (aOldStr != aContent)
{
if (bApi)
- bInsert = TRUE; // per API nicht nachfragen
+ bInsert = sal_True; // per API nicht nachfragen
else
{
String aTemplate = ScGlobal::GetRscString( STR_CREATENAME_REPLACE );
@@ -4570,7 +4573,7 @@ void ScDocFunc::CreateOneName( ScRangeName& rList,
bInsert = true;
}
else if ( nResult == RET_CANCEL )
- rCancel = TRUE;
+ rCancel = sal_True;
}
}
}
@@ -4591,14 +4594,14 @@ void ScDocFunc::CreateOneName( ScRangeName& rList,
}
}
-BOOL ScDocFunc::CreateNames( const ScRange& rRange, USHORT nFlags, BOOL bApi )
+sal_Bool ScDocFunc::CreateNames( const ScRange& rRange, sal_uInt16 nFlags, sal_Bool bApi )
{
if (!nFlags)
- return FALSE; // war nix
+ return false; // war nix
ScDocShellModificator aModificator( rDocShell );
- BOOL bDone = FALSE;
+ sal_Bool bDone = false;
SCCOL nStartCol = rRange.aStart.Col();
SCROW nStartRow = rRange.aStart.Row();
SCCOL nEndCol = rRange.aEnd.Col();
@@ -4606,26 +4609,26 @@ BOOL ScDocFunc::CreateNames( const ScRange& rRange, USHORT nFlags, BOOL bApi )
SCTAB nTab = rRange.aStart.Tab();
DBG_ASSERT(rRange.aEnd.Tab() == nTab, "CreateNames: mehrere Tabellen geht nicht");
- BOOL bValid = TRUE;
+ sal_Bool bValid = sal_True;
if ( nFlags & ( NAME_TOP | NAME_BOTTOM ) )
if ( nStartRow == nEndRow )
- bValid = FALSE;
+ bValid = false;
if ( nFlags & ( NAME_LEFT | NAME_RIGHT ) )
if ( nStartCol == nEndCol )
- bValid = FALSE;
+ bValid = false;
if (bValid)
{
ScDocument* pDoc = rDocShell.GetDocument();
ScRangeName* pNames = pDoc->GetRangeName();
if (!pNames)
- return FALSE; // soll nicht sein
+ return false; // soll nicht sein
ScRangeName aNewRanges( *pNames );
- BOOL bTop = ( ( nFlags & NAME_TOP ) != 0 );
- BOOL bLeft = ( ( nFlags & NAME_LEFT ) != 0 );
- BOOL bBottom = ( ( nFlags & NAME_BOTTOM ) != 0 );
- BOOL bRight = ( ( nFlags & NAME_RIGHT ) != 0 );
+ sal_Bool bTop = ( ( nFlags & NAME_TOP ) != 0 );
+ sal_Bool bLeft = ( ( nFlags & NAME_LEFT ) != 0 );
+ sal_Bool bBottom = ( ( nFlags & NAME_BOTTOM ) != 0 );
+ sal_Bool bRight = ( ( nFlags & NAME_RIGHT ) != 0 );
SCCOL nContX1 = nStartCol;
SCROW nContY1 = nStartRow;
@@ -4641,7 +4644,7 @@ BOOL ScDocFunc::CreateNames( const ScRange& rRange, USHORT nFlags, BOOL bApi )
if ( bRight )
--nContX2;
- BOOL bCancel = FALSE;
+ sal_Bool bCancel = false;
SCCOL i;
SCROW j;
@@ -4678,19 +4681,19 @@ BOOL ScDocFunc::CreateNames( const ScRange& rRange, USHORT nFlags, BOOL bApi )
//------------------------------------------------------------------------
-BOOL ScDocFunc::InsertNameList( const ScAddress& rStartPos, BOOL bApi )
+sal_Bool ScDocFunc::InsertNameList( const ScAddress& rStartPos, sal_Bool bApi )
{
ScDocShellModificator aModificator( rDocShell );
- BOOL bDone = FALSE;
+ sal_Bool bDone = false;
ScDocument* pDoc = rDocShell.GetDocument();
- const BOOL bRecord = pDoc->IsUndoEnabled();
+ const sal_Bool bRecord = pDoc->IsUndoEnabled();
SCTAB nTab = rStartPos.Tab();
ScDocument* pUndoDoc = NULL;
ScRangeName* pList = pDoc->GetRangeName();
- USHORT nValidCount = 0;
+ sal_uInt16 nValidCount = 0;
ScRangeName::iterator itrBeg = pList->begin(), itrEnd = pList->end();
for (ScRangeName::iterator itr = itrBeg; itr != itrEnd; ++itr)
{
@@ -4714,13 +4717,13 @@ BOOL ScDocFunc::InsertNameList( const ScAddress& rStartPos, BOOL bApi )
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
pUndoDoc->InitUndo( pDoc, nTab, nTab );
pDoc->CopyToDocument( nStartCol,nStartRow,nTab, nEndCol,nEndRow,nTab,
- IDF_ALL, FALSE, pUndoDoc );
+ IDF_ALL, false, pUndoDoc );
pDoc->BeginDrawUndo(); // wegen Hoehenanpassung
}
ScRangeData** ppSortArray = new ScRangeData* [ nValidCount ];
- USHORT j = 0;
+ sal_uInt16 j = 0;
for (ScRangeName::iterator itr = itrBeg; itr != itrEnd; ++itr)
{
ScRangeData& r = *itr;
@@ -4758,7 +4761,7 @@ BOOL ScDocFunc::InsertNameList( const ScAddress& rStartPos, BOOL bApi )
ScDocument* pRedoDoc = new ScDocument( SCDOCMODE_UNDO );
pRedoDoc->InitUndo( pDoc, nTab, nTab );
pDoc->CopyToDocument( nStartCol,nStartRow,nTab, nEndCol,nEndRow,nTab,
- IDF_ALL, FALSE, pRedoDoc );
+ IDF_ALL, false, pRedoDoc );
rDocShell.GetUndoManager()->AddUndoAction(
new ScUndoListNames( &rDocShell,
@@ -4770,7 +4773,7 @@ BOOL ScDocFunc::InsertNameList( const ScAddress& rStartPos, BOOL bApi )
rDocShell.PostPaint( nStartCol,nStartRow,nTab, nEndCol,nEndRow,nTab, PAINT_GRID );
aModificator.SetDocumentModified();
- bDone = TRUE;
+ bDone = sal_True;
}
else if (!bApi)
rDocShell.ErrorMessage(aTester.GetMessageId());
@@ -4780,16 +4783,16 @@ BOOL ScDocFunc::InsertNameList( const ScAddress& rStartPos, BOOL bApi )
//------------------------------------------------------------------------
-BOOL ScDocFunc::ResizeMatrix( const ScRange& rOldRange, const ScAddress& rNewEnd, BOOL bApi )
+sal_Bool ScDocFunc::ResizeMatrix( const ScRange& rOldRange, const ScAddress& rNewEnd, sal_Bool bApi )
{
ScDocument* pDoc = rDocShell.GetDocument();
SCCOL nStartCol = rOldRange.aStart.Col();
SCROW nStartRow = rOldRange.aStart.Row();
SCTAB nTab = rOldRange.aStart.Tab();
- BOOL bUndo(pDoc->IsUndoEnabled());
+ sal_Bool bUndo(pDoc->IsUndoEnabled());
- BOOL bRet = FALSE;
+ sal_Bool bRet = false;
String aFormula;
pDoc->GetFormula( nStartCol, nStartRow, nTab, aFormula );
@@ -4804,17 +4807,17 @@ BOOL ScDocFunc::ResizeMatrix( const ScRange& rOldRange, const ScAddress& rNewEnd
ScMarkData aMark;
aMark.SetMarkArea( rOldRange );
- aMark.SelectTable( nTab, TRUE );
+ aMark.SelectTable( nTab, sal_True );
ScRange aNewRange( rOldRange.aStart, rNewEnd );
- if ( DeleteContents( aMark, IDF_CONTENTS, TRUE, bApi ) )
+ if ( DeleteContents( aMark, IDF_CONTENTS, sal_True, bApi ) )
{
// GRAM_PODF_A1 for API compatibility.
- bRet = EnterMatrix( aNewRange, &aMark, NULL, aFormula, bApi, FALSE, EMPTY_STRING, formula::FormulaGrammar::GRAM_PODF_A1 );
+ bRet = EnterMatrix( aNewRange, &aMark, NULL, aFormula, bApi, false, EMPTY_STRING, formula::FormulaGrammar::GRAM_PODF_A1 );
if (!bRet)
{
// versuchen, alten Zustand wiederherzustellen
- EnterMatrix( rOldRange, &aMark, NULL, aFormula, bApi, FALSE, EMPTY_STRING, formula::FormulaGrammar::GRAM_PODF_A1 );
+ EnterMatrix( rOldRange, &aMark, NULL, aFormula, bApi, false, EMPTY_STRING, formula::FormulaGrammar::GRAM_PODF_A1 );
}
}
@@ -4827,15 +4830,15 @@ BOOL ScDocFunc::ResizeMatrix( const ScRange& rOldRange, const ScAddress& rNewEnd
//------------------------------------------------------------------------
-BOOL ScDocFunc::InsertAreaLink( const String& rFile, const String& rFilter,
+sal_Bool ScDocFunc::InsertAreaLink( const String& rFile, const String& rFilter,
const String& rOptions, const String& rSource,
- const ScRange& rDestRange, ULONG nRefresh,
- BOOL bFitBlock, BOOL bApi )
+ const ScRange& rDestRange, sal_uLong nRefresh,
+ sal_Bool bFitBlock, sal_Bool bApi )
{
//! auch fuer ScViewFunc::InsertAreaLink benutzen!
ScDocument* pDoc = rDocShell.GetDocument();
- BOOL bUndo (pDoc->IsUndoEnabled());
+ sal_Bool bUndo (pDoc->IsUndoEnabled());
sfx2::LinkManager* pLinkManager = pDoc->GetLinkManager();
@@ -4843,9 +4846,9 @@ BOOL ScDocFunc::InsertAreaLink( const String& rFile, const String& rFilter,
// remove them first (file format specifies only one link definition
// for a cell)
- USHORT nLinkCount = pLinkManager->GetLinks().Count();
- USHORT nRemoved = 0;
- USHORT nLinkPos = 0;
+ sal_uInt16 nLinkCount = pLinkManager->GetLinks().Count();
+ sal_uInt16 nRemoved = 0;
+ sal_uInt16 nLinkPos = 0;
while (nLinkPos<nLinkCount)
{
::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[nLinkPos];
@@ -4878,7 +4881,7 @@ BOOL ScDocFunc::InsertAreaLink( const String& rFile, const String& rFilter,
String aFilterName = rFilter;
String aNewOptions = rOptions;
if (!aFilterName.Len())
- ScDocumentLoader::GetFilterName( rFile, aFilterName, aNewOptions, TRUE, !bApi );
+ ScDocumentLoader::GetFilterName( rFile, aFilterName, aNewOptions, sal_True, !bApi );
// remove application prefix from filter name here, so the filter options
// aren't reset when the filter name is changed in ScAreaLink::DataChanged
@@ -4900,10 +4903,12 @@ BOOL ScDocFunc::InsertAreaLink( const String& rFile, const String& rFilter,
}
// Update hat sein eigenes Undo
-
- pLink->SetDoInsert(bFitBlock); // beim ersten Update ggf. nichts einfuegen
- pLink->Update(); // kein SetInCreate -> Update ausfuehren
- pLink->SetDoInsert(TRUE); // Default = TRUE
+ if (pDoc->IsExecuteLinkEnabled())
+ {
+ pLink->SetDoInsert(bFitBlock); // beim ersten Update ggf. nichts einfuegen
+ pLink->Update(); // kein SetInCreate -> Update ausfuehren
+ }
+ pLink->SetDoInsert(sal_True); // Default = sal_True
SfxBindings* pBindings = rDocShell.GetViewBindings();
if (pBindings)
@@ -4911,7 +4916,7 @@ BOOL ScDocFunc::InsertAreaLink( const String& rFile, const String& rFilter,
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) ); // Navigator
- return TRUE;
+ return sal_True;
}
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 221b5d8a439c..6ad8123c3659 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -78,7 +78,6 @@
#include <com/sun/star/ui/XAcceleratorConfiguration.hpp>
#include <basic/sbstar.hxx>
#include <basic/basmgr.hxx>
-#include <vbahelper/vbaaccesshelper.hxx>
#include "scabstdlg.hxx"
#include <sot/formats.hxx>
@@ -268,7 +267,7 @@ sal_uInt16 ScDocShell::GetHiddenInformationState( sal_uInt16 nStates )
{
SCTAB nTableCount = aDocument.GetTableCount();
SCTAB nTable = 0;
- sal_Bool bFound(sal_False);
+ sal_Bool bFound(false);
while ( nTable < nTableCount && !bFound )
{
ScCellIterator aCellIter( &aDocument, 0,0, nTable, MAXCOL,MAXROW, nTable );
@@ -287,17 +286,17 @@ sal_uInt16 ScDocShell::GetHiddenInformationState( sal_uInt16 nStates )
void ScDocShell::BeforeXMLLoading()
{
- aDocument.DisableIdle( TRUE );
+ aDocument.DisableIdle( sal_True );
// prevent unnecessary broadcasts and updates
DBG_ASSERT(pModificator == NULL, "The Modificator should not exist");
pModificator = new ScDocShellModificator( *this );
- aDocument.SetImportingXML( TRUE );
+ aDocument.SetImportingXML( sal_True );
aDocument.EnableExecuteLink( false ); // #i101304# to be safe, prevent nested loading from external references
- aDocument.EnableUndo( FALSE );
+ aDocument.EnableUndo( false );
// prevent unnecessary broadcasts and "half way listeners"
- aDocument.SetInsertingFromOtherDoc( TRUE );
+ aDocument.SetInsertingFromOtherDoc( sal_True );
if (GetCreateMode() != SFX_CREATE_MODE_ORGANIZER)
ScColumn::bDoubleAlloc = sal_True;
@@ -309,7 +308,7 @@ void ScDocShell::AfterXMLLoading(sal_Bool bRet)
{
UpdateLinks();
// don't prevent establishing of listeners anymore
- aDocument.SetInsertingFromOtherDoc( FALSE );
+ aDocument.SetInsertingFromOtherDoc( false );
if ( bRet )
{
ScChartListenerCollection* pChartListener = aDocument.GetChartListenerCollection();
@@ -336,12 +335,12 @@ void ScDocShell::AfterXMLLoading(sal_Bool bRet)
ScGlobal::UnicodeStrChr( pNameBuffer, SC_COMPILER_FILE_TAB_SEP ) )
{
rtl::OUStringBuffer aDocURLBuffer;
- BOOL bQuote = TRUE; // Dokumentenname ist immer quoted
+ sal_Bool bQuote = sal_True; // Dokumentenname ist immer quoted
++pNameBuffer;
while ( bQuote && *pNameBuffer )
{
if ( *pNameBuffer == '\'' && *(pNameBuffer-1) != '\\' )
- bQuote = FALSE;
+ bQuote = false;
else if( !(*pNameBuffer == '\\' && *(pNameBuffer+1) == '\'') )
aDocURLBuffer.append(*pNameBuffer); // falls escaped Quote: nur Quote in den Namen
++pNameBuffer;
@@ -357,7 +356,7 @@ void ScDocShell::AfterXMLLoading(sal_Bool bRet)
!aINetURLObject.HasError()) // the docname should be a valid URL
{
aName = ScGlobal::GetDocTabName( aDocument.GetLinkDoc( i ), aDocument.GetLinkTab( i ) );
- aDocument.RenameTab(i, aName, TRUE, TRUE);
+ aDocument.RenameTab(i, aName, sal_True, sal_True);
}
// else; nothing has to happen, because it is a user given name
}
@@ -383,15 +382,15 @@ void ScDocShell::AfterXMLLoading(sal_Bool bRet)
}
}
}
- ScColumn::bDoubleAlloc = sal_False;
+ ScColumn::bDoubleAlloc = false;
}
else
- aDocument.SetInsertingFromOtherDoc( FALSE );
+ aDocument.SetInsertingFromOtherDoc( false );
- aDocument.SetImportingXML( FALSE );
+ aDocument.SetImportingXML( false );
aDocument.EnableExecuteLink( true );
- aDocument.EnableUndo( TRUE );
- bIsEmpty = FALSE;
+ aDocument.EnableUndo( sal_True );
+ bIsEmpty = false;
if (pModificator)
{
@@ -403,7 +402,7 @@ void ScDocShell::AfterXMLLoading(sal_Bool bRet)
OSL_FAIL("The Modificator should exist");
}
- aDocument.DisableIdle( FALSE );
+ aDocument.DisableIdle( false );
}
namespace {
@@ -427,7 +426,7 @@ private:
}
-BOOL ScDocShell::LoadXML( SfxMedium* pLoadMedium, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStor )
+sal_Bool ScDocShell::LoadXML( SfxMedium* pLoadMedium, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStor )
{
LoadMediumGuard aLoadGuard(&aDocument);
@@ -440,21 +439,21 @@ BOOL ScDocShell::LoadXML( SfxMedium* pLoadMedium, const ::com::sun::star::uno::R
// #i62677# BeforeXMLLoading is also called from ScXMLImport::startDocument when invoked
// from an external component. The XMLFromWrapper flag is only set here, when called
// through ScDocShell.
- aDocument.SetXMLFromWrapper( TRUE );
+ aDocument.SetXMLFromWrapper( sal_True );
ScXMLImportWrapper aImport( aDocument, pLoadMedium, xStor );
- sal_Bool bRet(sal_False);
+ sal_Bool bRet(false);
ErrCode nError = ERRCODE_NONE;
if (GetCreateMode() != SFX_CREATE_MODE_ORGANIZER)
- bRet = aImport.Import(sal_False, nError);
+ bRet = aImport.Import(false, nError);
else
bRet = aImport.Import(sal_True, nError);
if ( nError )
pLoadMedium->SetError( nError, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
- aDocument.SetXMLFromWrapper( FALSE );
+ aDocument.SetXMLFromWrapper( false );
AfterXMLLoading(bRet);
//! row heights...
@@ -462,25 +461,25 @@ BOOL ScDocShell::LoadXML( SfxMedium* pLoadMedium, const ::com::sun::star::uno::R
return bRet;
}
-BOOL ScDocShell::SaveXML( SfxMedium* pSaveMedium, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStor )
+sal_Bool ScDocShell::SaveXML( SfxMedium* pSaveMedium, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStor )
{
RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "sb99857", "ScDocShell::SaveXML" );
- aDocument.DisableIdle( TRUE );
+ aDocument.DisableIdle( sal_True );
ScXMLImportWrapper aImport( aDocument, pSaveMedium, xStor );
- sal_Bool bRet(sal_False);
+ sal_Bool bRet(false);
if (GetCreateMode() != SFX_CREATE_MODE_ORGANIZER)
- bRet = aImport.Export(sal_False);
+ bRet = aImport.Export(false);
else
bRet = aImport.Export(sal_True);
- aDocument.DisableIdle( FALSE );
+ aDocument.DisableIdle( false );
return bRet;
}
-BOOL ScDocShell::Load( SfxMedium& rMedium )
+sal_Bool ScDocShell::Load( SfxMedium& rMedium )
{
RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScDocShell::Load" );
LoadMediumGuard aLoadGuard(&aDocument);
@@ -492,12 +491,12 @@ BOOL ScDocShell::Load( SfxMedium& rMedium )
GetUndoManager()->Clear();
- BOOL bRet = SfxObjectShell::Load( rMedium );
+ sal_Bool bRet = SfxObjectShell::Load( rMedium );
if( bRet )
{
if (GetMedium())
{
- SFX_ITEMSET_ARG( rMedium.GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, sal_False);
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, false);
nCanUpdate = pUpdateDocItem ? pUpdateDocItem->GetValue() : com::sun::star::document::UpdateDocMode::NO_UPDATE;
}
@@ -525,7 +524,7 @@ BOOL ScDocShell::Load( SfxMedium& rMedium )
if ( bRet )
aDocument.InvalidateTableArea();
- bIsEmpty = FALSE;
+ bIsEmpty = false;
FinishedLoading( SFX_LOADED_MAINDOCUMENT | SFX_LOADED_IMAGES );
return bRet;
}
@@ -548,7 +547,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
else if ( rHint.ISA( SfxEventHint ) )
{
- ULONG nEventId = static_cast< const SfxEventHint& >( rHint ).GetEventId();
+ sal_uLong nEventId = static_cast< const SfxEventHint& >( rHint ).GetEventId();
switch ( nEventId )
{
case SFX_EVENT_ACTIVATEDOC:
@@ -587,6 +586,13 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
xVbaEvents->processVbaEvent( WORKBOOK_AFTERSAVE, aArgs );
}
break;
+ case SFX_EVENT_CLOSEDOC:
+ {
+ // #163655# prevent event processing after model is disposed
+ aDocument.SetVbaEventProcessor( uno::Reference< script::vba::XVBAEventProcessor >() );
+ uno::Reference< lang::XEventListener >( xVbaEvents, uno::UNO_QUERY_THROW )->disposing( lang::EventObject() );
+ }
+ break;
}
}
}
@@ -596,7 +602,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
if (rHint.ISA(SfxSimpleHint)) // ohne Parameter
{
- ULONG nSlot = ((const SfxSimpleHint&)rHint).GetId();
+ sal_uLong nSlot = ((const SfxSimpleHint&)rHint).GetId();
switch ( nSlot )
{
case SFX_HINT_TITLECHANGED:
@@ -620,7 +626,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
ScRange aRange = rStlHint.GetRange();
String aName1 = rStlHint.GetStyle1();
String aName2 = rStlHint.GetStyle2();
- UINT32 nTimeout = rStlHint.GetTimeout();
+ sal_uInt32 nTimeout = rStlHint.GetTimeout();
if (!pAutoStyleList)
pAutoStyleList = new ScAutoStyleList(this);
@@ -628,7 +634,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
else if ( rHint.ISA( SfxEventHint ) )
{
- ULONG nEventId = ((SfxEventHint&)rHint).GetEventId();
+ sal_uLong nEventId = ((SfxEventHint&)rHint).GetEventId();
switch ( nEventId )
{
case SFX_EVENT_LOADFINISHED:
@@ -636,7 +642,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
// the readonly documents should not be opened in shared mode
if ( HasSharedXMLFlagSet() && !SC_MOD()->IsInSharedDocLoading() && !IsReadOnly() )
{
- if ( SwitchToShared( sal_True, sal_False ) )
+ if ( SwitchToShared( sal_True, false ) )
{
ScViewData* pViewData = GetViewData();
ScTabView* pTabView = ( pViewData ? dynamic_cast< ScTabView* >( pViewData->GetView() ) : NULL );
@@ -652,25 +658,6 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
SetReadOnlyUI( sal_True );
}
}
-
- // VBA specific initialization
- if( aDocument.IsInVBAMode() ) try
- {
- uno::Reference< frame::XModel > xModel( GetModel(), uno::UNO_SET_THROW );
-
- // create VBAGlobals object if not yet done (this also creates the "ThisExcelDoc" symbol)
- uno::Reference< lang::XMultiServiceFactory > xFactory( xModel, uno::UNO_QUERY_THROW );
- xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBAGlobals" ) ) );
-
- // create the VBA document event processor
- uno::Sequence< uno::Any > aArgs( 1 );
- aArgs[ 0 ] <<= xModel;
- xVbaEvents.set( ooo::vba::createVBAUnoAPIServiceWithArgs( this, "com.sun.star.script.vba.VBASpreadsheetEventProcessor" , aArgs ), uno::UNO_QUERY );
- aDocument.SetVbaEventProcessor( xVbaEvents );
- }
- catch( uno::Exception& )
- {
- }
}
break;
case SFX_EVENT_VIEWCREATED:
@@ -684,7 +671,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
ScGlobal::GetRscString( STR_SHARED_DOC_WARNING ) );
aBox.SetDefaultCheckBoxText();
aBox.Execute();
- BOOL bChecked = aBox.GetCheckBoxState();
+ sal_Bool bChecked = aBox.GetCheckBoxState();
if ( bChecked )
{
aAppOptions.SetShowSharedDocumentWarning( !bChecked );
@@ -841,8 +828,8 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
ScChangeViewSettings* pChangeViewSet = aDocument.GetChangeViewSettings();
if ( pChangeViewSet && pChangeViewSet->ShowChanges() )
{
- pChangeViewSet->SetShowChanges( FALSE );
- pChangeViewSet->SetShowAccepted( FALSE );
+ pChangeViewSet->SetShowChanges( false );
+ pChangeViewSet->SetShowAccepted( false );
aDocument.SetChangeViewSettings( *pChangeViewSet );
bChangedViewSettings = true;
}
@@ -853,7 +840,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
aValues[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "FilterName"));
aValues[0].Value <<= ::rtl::OUString( GetMedium()->GetFilter()->GetFilterName() );
- SFX_ITEMSET_ARG( GetMedium()->GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD, sal_False);
+ SFX_ITEMSET_ARG( GetMedium()->GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD, false);
if ( pPasswordItem && pPasswordItem->GetValue().Len() )
{
aValues.realloc( 2 );
@@ -867,8 +854,8 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
if ( bChangedViewSettings )
{
- pChangeViewSet->SetShowChanges( TRUE );
- pChangeViewSet->SetShowAccepted( TRUE );
+ pChangeViewSet->SetShowChanges( sal_True );
+ pChangeViewSet->SetShowAccepted( sal_True );
aDocument.SetChangeViewSettings( *pChangeViewSet );
}
}
@@ -963,7 +950,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
// Inhalte fuer Organizer laden
-BOOL ScDocShell::LoadFrom( SfxMedium& rMedium )
+sal_Bool ScDocShell::LoadFrom( SfxMedium& rMedium )
{
RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScDocShell::LoadFrom" );
LoadMediumGuard aLoadGuard(&aDocument);
@@ -971,11 +958,11 @@ BOOL ScDocShell::LoadFrom( SfxMedium& rMedium )
WaitObject aWait( GetActiveDialogParent() );
- BOOL bRet = FALSE;
+ sal_Bool bRet = false;
if (GetMedium())
{
- SFX_ITEMSET_ARG( rMedium.GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, sal_False);
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, false);
nCanUpdate = pUpdateDocItem ? pUpdateDocItem->GetValue() : com::sun::star::document::UpdateDocMode::NO_UPDATE;
}
@@ -1018,13 +1005,13 @@ static void lcl_parseHtmlFilterOption(const OUString& rOption, LanguageType& rLa
rDateConvert = static_cast<bool>(aTokens[1].toInt32());
}
-BOOL ScDocShell::ConvertFrom( SfxMedium& rMedium )
+sal_Bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
{
RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScDocShell::ConvertFrom" );
LoadMediumGuard aLoadGuard(&aDocument);
- BOOL bRet = FALSE; // FALSE heisst Benutzerabbruch !!
+ sal_Bool bRet = false; // sal_False heisst Benutzerabbruch !!
// bei Fehler: Fehler am Stream setzen!!
ScRefreshTimerProtector( aDocument.GetRefreshTimerControlAddress() );
@@ -1032,12 +1019,12 @@ BOOL ScDocShell::ConvertFrom( SfxMedium& rMedium )
GetUndoManager()->Clear();
// ob nach dem Import optimale Spaltenbreiten gesetzt werden sollen
- BOOL bSetColWidths = FALSE;
- BOOL bSetSimpleTextColWidths = FALSE;
+ sal_Bool bSetColWidths = false;
+ sal_Bool bSetSimpleTextColWidths = false;
ScColWidthParam aColWidthParam[MAXCOLCOUNT];
ScRange aColWidthRange;
// ob nach dem Import optimale Zeilenhoehen gesetzt werden sollen
- BOOL bSetRowHeights = FALSE;
+ sal_Bool bSetRowHeights = false;
vector<ScDocRowHeightUpdater::TabRanges> aRecalcRowRangesArray;
@@ -1048,7 +1035,7 @@ BOOL ScDocShell::ConvertFrom( SfxMedium& rMedium )
// Datei uebertragen wird.
rMedium.GetPhysicalName(); //! CreateFileStream direkt rufen, wenn verfuegbar
- SFX_ITEMSET_ARG( rMedium.GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, sal_False);
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, false);
nCanUpdate = pUpdateDocItem ? pUpdateDocItem->GetValue() : com::sun::star::document::UpdateDocMode::NO_UPDATE;
const SfxFilter* pFilter = rMedium.GetFilter();
@@ -1058,10 +1045,10 @@ BOOL ScDocShell::ConvertFrom( SfxMedium& rMedium )
aConvFilterName=aFltName; //@ #BugId 54198
- BOOL bCalc3 = ( aFltName.EqualsAscii(pFilterSc30) );
- BOOL bCalc4 = ( aFltName.EqualsAscii(pFilterSc40) );
+ sal_Bool bCalc3 = ( aFltName.EqualsAscii(pFilterSc30) );
+ sal_Bool bCalc4 = ( aFltName.EqualsAscii(pFilterSc40) );
if (!bCalc3 && !bCalc4)
- aDocument.SetInsertingFromOtherDoc( TRUE );
+ aDocument.SetInsertingFromOtherDoc( sal_True );
if (aFltName.EqualsAscii(pFilterXML))
bRet = LoadXML( &rMedium, NULL );
@@ -1077,7 +1064,7 @@ BOOL ScDocShell::ConvertFrom( SfxMedium& rMedium )
SetError(eError, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ));
}
else
- bRet = TRUE;
+ bRet = sal_True;
}
}
else if (aFltName.EqualsAscii(pFilterLotus))
@@ -1086,7 +1073,7 @@ BOOL ScDocShell::ConvertFrom( SfxMedium& rMedium )
SfxItemSet* pSet = rMedium.GetItemSet();
const SfxPoolItem* pItem;
if ( pSet && SFX_ITEM_SET ==
- pSet->GetItemState( SID_FILE_FILTEROPTIONS, TRUE, &pItem ) )
+ pSet->GetItemState( SID_FILE_FILTEROPTIONS, sal_True, &pItem ) )
{
sItStr = ((const SfxStringItem*)pItem)->GetValue();
}
@@ -1098,22 +1085,22 @@ BOOL ScDocShell::ConvertFrom( SfxMedium& rMedium )
sItStr = ScGlobal::GetCharsetString( RTL_TEXTENCODING_IBM_437 );
}
- ScColumn::bDoubleAlloc = TRUE;
+ ScColumn::bDoubleAlloc = sal_True;
FltError eError = ScFormatFilter::Get().ScImportLotus123( rMedium, &aDocument,
ScGlobal::GetCharsetValue(sItStr));
- ScColumn::bDoubleAlloc = FALSE;
+ ScColumn::bDoubleAlloc = false;
if (eError != eERR_OK)
{
if (!GetError())
SetError(eError, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ));
if( ( eError & ERRCODE_WARNING_MASK ) == ERRCODE_WARNING_MASK )
- bRet = TRUE;
+ bRet = sal_True;
}
else
- bRet = TRUE;
- bSetColWidths = TRUE;
- bSetRowHeights = TRUE;
+ bRet = sal_True;
+ bSetColWidths = sal_True;
+ bSetRowHeights = sal_True;
}
else if ( aFltName.EqualsAscii(pFilterExcel4) || aFltName.EqualsAscii(pFilterExcel5) ||
aFltName.EqualsAscii(pFilterExcel95) || aFltName.EqualsAscii(pFilterExcel97) ||
@@ -1131,9 +1118,9 @@ BOOL ScDocShell::ConvertFrom( SfxMedium& rMedium )
MakeDrawLayer(); //! im Filter
CalcOutputFactor(); // prepare update of row height
- ScColumn::bDoubleAlloc = TRUE;
+ ScColumn::bDoubleAlloc = true;
FltError eError = ScFormatFilter::Get().ScImportExcel( rMedium, &aDocument, eFormat );
- ScColumn::bDoubleAlloc = FALSE;
+ ScColumn::bDoubleAlloc = false;
aDocument.UpdateFontCharSet();
if ( aDocument.IsChartListenerCollectionNeedsUpdate() )
aDocument.UpdateChartListenerCollection(); //! fuer alle Importe?
@@ -1145,7 +1132,7 @@ BOOL ScDocShell::ConvertFrom( SfxMedium& rMedium )
{
if (!GetError())
SetError(eError, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ));
- bRet = TRUE;
+ bRet = sal_True;
}
else if (eError != eERR_OK)
{
@@ -1153,20 +1140,20 @@ BOOL ScDocShell::ConvertFrom( SfxMedium& rMedium )
SetError(eError, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ));
}
else
- bRet = TRUE;
+ bRet = true;
}
else if (aFltName.EqualsAscii(pFilterAscii))
{
SfxItemSet* pSet = rMedium.GetItemSet();
const SfxPoolItem* pItem;
ScAsciiOptions aOptions;
- BOOL bOptInit = FALSE;
+ sal_Bool bOptInit = false;
if ( pSet && SFX_ITEM_SET ==
- pSet->GetItemState( SID_FILE_FILTEROPTIONS, TRUE, &pItem ) )
+ pSet->GetItemState( SID_FILE_FILTEROPTIONS, sal_True, &pItem ) )
{
aOptions.ReadFromString( ((const SfxStringItem*)pItem)->GetValue() );
- bOptInit = TRUE;
+ bOptInit = sal_True;
}
if ( !bOptInit )
@@ -1180,7 +1167,7 @@ BOOL ScDocShell::ConvertFrom( SfxMedium& rMedium )
}
FltError eError = eERR_OK;
- BOOL bOverflow = FALSE;
+ sal_Bool bOverflow = false;
if( ! rMedium.IsStorage() )
{
@@ -1214,8 +1201,8 @@ BOOL ScDocShell::ConvertFrom( SfxMedium& rMedium )
if (!GetError())
SetError(SCWARN_IMPORT_RANGE_OVERFLOW, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ));
}
- bSetColWidths = TRUE;
- bSetSimpleTextColWidths = TRUE;
+ bSetColWidths = sal_True;
+ bSetSimpleTextColWidths = sal_True;
}
else if (aFltName.EqualsAscii(pFilterDBase))
{
@@ -1223,7 +1210,7 @@ BOOL ScDocShell::ConvertFrom( SfxMedium& rMedium )
SfxItemSet* pSet = rMedium.GetItemSet();
const SfxPoolItem* pItem;
if ( pSet && SFX_ITEM_SET ==
- pSet->GetItemState( SID_FILE_FILTEROPTIONS, TRUE, &pItem ) )
+ pSet->GetItemState( SID_FILE_FILTEROPTIONS, sal_True, &pItem ) )
{
sItStr = ((const SfxStringItem*)pItem)->GetValue();
}
@@ -1237,7 +1224,7 @@ BOOL ScDocShell::ConvertFrom( SfxMedium& rMedium )
}
ScDocRowHeightUpdater::TabRanges aRecalcRanges(0);
- ULONG eError = DBaseImport( rMedium.GetPhysicalName(),
+ sal_uLong eError = DBaseImport( rMedium.GetPhysicalName(),
ScGlobal::GetCharsetValue(sItStr), aColWidthParam, *aRecalcRanges.mpRanges );
aRecalcRowRangesArray.push_back(aRecalcRanges);
@@ -1248,11 +1235,11 @@ BOOL ScDocShell::ConvertFrom( SfxMedium& rMedium )
bRet = ( eError == SCWARN_IMPORT_RANGE_OVERFLOW );
}
else
- bRet = TRUE;
+ bRet = sal_True;
aColWidthRange.aStart.SetRow( 1 ); // Spaltenheader nicht
- bSetColWidths = TRUE;
- bSetSimpleTextColWidths = TRUE;
+ bSetColWidths = true;
+ bSetSimpleTextColWidths = true;
}
else if (aFltName.EqualsAscii(pFilterDif))
{
@@ -1264,7 +1251,7 @@ BOOL ScDocShell::ConvertFrom( SfxMedium& rMedium )
SfxItemSet* pSet = rMedium.GetItemSet();
const SfxPoolItem* pItem;
if ( pSet && SFX_ITEM_SET ==
- pSet->GetItemState( SID_FILE_FILTEROPTIONS, TRUE, &pItem ) )
+ pSet->GetItemState( SID_FILE_FILTEROPTIONS, sal_True, &pItem ) )
{
sItStr = ((const SfxStringItem*)pItem)->GetValue();
}
@@ -1285,14 +1272,14 @@ BOOL ScDocShell::ConvertFrom( SfxMedium& rMedium )
SetError(eError, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ));
if( ( eError & ERRCODE_WARNING_MASK ) == ERRCODE_WARNING_MASK )
- bRet = TRUE;
+ bRet = sal_True;
}
else
- bRet = TRUE;
+ bRet = sal_True;
}
- bSetColWidths = TRUE;
- bSetSimpleTextColWidths = TRUE;
- bSetRowHeights = TRUE;
+ bSetColWidths = sal_True;
+ bSetSimpleTextColWidths = sal_True;
+ bSetRowHeights = sal_True;
}
else if (aFltName.EqualsAscii(pFilterSylk))
{
@@ -1318,29 +1305,29 @@ BOOL ScDocShell::ConvertFrom( SfxMedium& rMedium )
if ( eError != eERR_OK && !GetError() )
SetError(eError, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ));
- bSetColWidths = TRUE;
- bSetSimpleTextColWidths = TRUE;
- bSetRowHeights = TRUE;
+ bSetColWidths = sal_True;
+ bSetSimpleTextColWidths = sal_True;
+ bSetRowHeights = sal_True;
}
else if (aFltName.EqualsAscii(pFilterQPro6))
{
- ScColumn::bDoubleAlloc = TRUE;
+ ScColumn::bDoubleAlloc = sal_True;
FltError eError = ScFormatFilter::Get().ScImportQuattroPro( rMedium, &aDocument);
- ScColumn::bDoubleAlloc = FALSE;
+ ScColumn::bDoubleAlloc = false;
if (eError != eERR_OK)
{
if (!GetError())
SetError( eError, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
if( ( eError & ERRCODE_WARNING_MASK ) == ERRCODE_WARNING_MASK )
- bRet = TRUE;
+ bRet = sal_True;
}
else
- bRet = TRUE;
+ bRet = sal_True;
// TODO: Filter should set column widths. Not doing it here, it may
// result in very narrow or wide columns, depending on content.
// Setting row heights makes cells with font size attribution or
// wrapping enabled look nicer..
- bSetRowHeights = TRUE;
+ bSetRowHeights = sal_True;
}
else if (aFltName.EqualsAscii(pFilterRtf))
{
@@ -1359,14 +1346,14 @@ BOOL ScDocShell::ConvertFrom( SfxMedium& rMedium )
SetError(eError, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ));
if( ( eError & ERRCODE_WARNING_MASK ) == ERRCODE_WARNING_MASK )
- bRet = TRUE;
+ bRet = sal_True;
}
else
- bRet = TRUE;
+ bRet = sal_True;
aDocument.StartAllListeners();
aDocument.SetDirty();
- bSetColWidths = TRUE;
- bSetRowHeights = TRUE;
+ bSetColWidths = sal_True;
+ bSetRowHeights = sal_True;
}
else
{
@@ -1380,7 +1367,7 @@ BOOL ScDocShell::ConvertFrom( SfxMedium& rMedium )
else if (aFltName.EqualsAscii(pFilterHtml) || aFltName.EqualsAscii(pFilterHtmlWebQ))
{
FltError eError = SCERR_IMPORT_UNKNOWN;
- BOOL bWebQuery = aFltName.EqualsAscii(pFilterHtmlWebQ);
+ sal_Bool bWebQuery = aFltName.EqualsAscii(pFilterHtmlWebQ);
if( !rMedium.IsStorage() )
{
SvStream* pInStream = rMedium.GetInStream();
@@ -1391,7 +1378,7 @@ BOOL ScDocShell::ConvertFrom( SfxMedium& rMedium )
SfxItemSet* pSet = rMedium.GetItemSet();
const SfxPoolItem* pItem;
if ( pSet && SFX_ITEM_SET ==
- pSet->GetItemState( SID_FILE_FILTEROPTIONS, TRUE, &pItem ) )
+ pSet->GetItemState( SID_FILE_FILTEROPTIONS, sal_True, &pItem ) )
{
String aFilterOption = (static_cast<const SfxStringItem*>(pItem))->GetValue();
lcl_parseHtmlFilterOption(aFilterOption, eLang, bDateConvert);
@@ -1410,10 +1397,10 @@ BOOL ScDocShell::ConvertFrom( SfxMedium& rMedium )
SetError(eError, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ));
if( ( eError & ERRCODE_WARNING_MASK ) == ERRCODE_WARNING_MASK )
- bRet = TRUE;
+ bRet = sal_True;
}
else
- bRet = TRUE;
+ bRet = sal_True;
aDocument.StartAllListeners();
aDocument.SetDirty();
}
@@ -1433,7 +1420,7 @@ BOOL ScDocShell::ConvertFrom( SfxMedium& rMedium )
}
if (!bCalc3)
- aDocument.SetInsertingFromOtherDoc( FALSE );
+ aDocument.SetInsertingFromOtherDoc( false );
}
else
{
@@ -1469,11 +1456,11 @@ BOOL ScDocShell::ConvertFrom( SfxMedium& rMedium )
if (!bSetSimpleTextColWidths)
aColWidthParam[nCol].mbSimpleText = false;
- USHORT nWidth = aDocument.GetOptimalColWidth(
- nCol, nTab, &aVirtDev, nPPTX, nPPTY, aZoom, aZoom, FALSE, &aMark,
+ sal_uInt16 nWidth = aDocument.GetOptimalColWidth(
+ nCol, nTab, &aVirtDev, nPPTX, nPPTY, aZoom, aZoom, false, &aMark,
&aColWidthParam[nCol] );
aDocument.SetColWidth( nCol, nTab,
- nWidth + (USHORT)ScGlobal::nLastColWidthExtra );
+ nWidth + (sal_uInt16)ScGlobal::nLastColWidthExtra );
}
}
}
@@ -1500,7 +1487,7 @@ BOOL ScDocShell::ConvertFrom( SfxMedium& rMedium )
if ( bRet )
aDocument.InvalidateTableArea();
- bIsEmpty = FALSE;
+ bIsEmpty = false;
return bRet;
}
@@ -1544,7 +1531,7 @@ ScDocShell::PrepareSaveGuard::~PrepareSaveGuard()
}
-BOOL ScDocShell::Save()
+sal_Bool ScDocShell::Save()
{
RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScDocShell::Save" );
@@ -1553,14 +1540,14 @@ BOOL ScDocShell::Save()
PrepareSaveGuard aPrepareGuard( *this);
// wait cursor is handled with progress bar
- BOOL bRet = SfxObjectShell::Save();
+ sal_Bool bRet = SfxObjectShell::Save();
if( bRet )
bRet = SaveXML( GetMedium(), NULL );
return bRet;
}
-BOOL ScDocShell::SaveAs( SfxMedium& rMedium )
+sal_Bool ScDocShell::SaveAs( SfxMedium& rMedium )
{
RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScDocShell::SaveAs" );
@@ -1582,7 +1569,7 @@ BOOL ScDocShell::SaveAs( SfxMedium& rMedium )
PrepareSaveGuard aPrepareGuard( *this);
// wait cursor is handled with progress bar
- BOOL bRet = SfxObjectShell::SaveAs( rMedium );
+ sal_Bool bRet = SfxObjectShell::SaveAs( rMedium );
if( bRet )
bRet = SaveXML( &rMedium, NULL );
@@ -1590,7 +1577,7 @@ BOOL ScDocShell::SaveAs( SfxMedium& rMedium )
}
-BOOL ScDocShell::IsInformationLost()
+sal_Bool ScDocShell::IsInformationLost()
{
//!!! bei Gelegenheit ein korrekte eigene Behandlung einbauen
@@ -1599,7 +1586,7 @@ BOOL ScDocShell::IsInformationLost()
// Xcl-like column width measured in characters of standard font.
-xub_StrLen lcl_ScDocShell_GetColWidthInChars( USHORT nWidth )
+xub_StrLen lcl_ScDocShell_GetColWidthInChars( sal_uInt16 nWidth )
{
double f = nWidth;
f *= 1328.0 / 25.0;
@@ -1612,7 +1599,7 @@ xub_StrLen lcl_ScDocShell_GetColWidthInChars( USHORT nWidth )
void lcl_ScDocShell_GetFixedWidthString( String& rStr, const ScDocument& rDoc,
- SCTAB nTab, SCCOL nCol, BOOL bValue, SvxCellHorJustify eHorJust )
+ SCTAB nTab, SCCOL nCol, sal_Bool bValue, SvxCellHorJustify eHorJust )
{
xub_StrLen nLen = lcl_ScDocShell_GetColWidthInChars(
rDoc.GetColWidth( nCol, nTab ) );
@@ -1655,7 +1642,7 @@ void lcl_ScDocShell_WriteEmptyFixedWidthString( SvStream& rStream,
const ScDocument& rDoc, SCTAB nTab, SCCOL nCol )
{
String aString;
- lcl_ScDocShell_GetFixedWidthString( aString, rDoc, nTab, nCol, FALSE,
+ lcl_ScDocShell_GetFixedWidthString( aString, rDoc, nTab, nCol, false,
SVX_HOR_JUSTIFY_STANDARD );
rStream.WriteUnicodeOrByteText( aString );
}
@@ -1666,23 +1653,26 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
sal_Unicode cDelim = rAsciiOpt.nFieldSepCode;
sal_Unicode cStrDelim = rAsciiOpt.nTextSepCode;
CharSet eCharSet = rAsciiOpt.eCharSet;
- BOOL bFixedWidth = rAsciiOpt.bFixedWidth;
- BOOL bSaveAsShown = rAsciiOpt.bSaveAsShown;
+ sal_Bool bFixedWidth = rAsciiOpt.bFixedWidth;
+ sal_Bool bSaveAsShown = rAsciiOpt.bSaveAsShown;
CharSet eOldCharSet = rStream.GetStreamCharSet();
rStream.SetStreamCharSet( eCharSet );
- USHORT nOldNumberFormatInt = rStream.GetNumberFormatInt();
+ sal_uInt16 nOldNumberFormatInt = rStream.GetNumberFormatInt();
ByteString aStrDelimEncoded; // only used if not Unicode
UniString aStrDelimDecoded; // only used if context encoding
- BOOL bContextOrNotAsciiEncoding;
+ ByteString aDelimEncoded;
+ UniString aDelimDecoded;
+ sal_Bool bContextOrNotAsciiEncoding;
if ( eCharSet == RTL_TEXTENCODING_UNICODE )
{
rStream.StartWritingUnicodeText();
- bContextOrNotAsciiEncoding = FALSE;
+ bContextOrNotAsciiEncoding = false;
}
else
{
aStrDelimEncoded = ByteString( cStrDelim, eCharSet );
+ aDelimEncoded = ByteString( cDelim, eCharSet );
rtl_TextEncodingInfo aInfo;
aInfo.StructSize = sizeof(aInfo);
if ( rtl_getTextEncodingInfo( eCharSet, &aInfo ) )
@@ -1691,10 +1681,13 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
(((aInfo.Flags & RTL_TEXTENCODING_INFO_CONTEXT) != 0) ||
((aInfo.Flags & RTL_TEXTENCODING_INFO_ASCII) == 0));
if ( bContextOrNotAsciiEncoding )
+ {
aStrDelimDecoded = String( aStrDelimEncoded, eCharSet );
+ aDelimDecoded = String( aDelimEncoded, eCharSet );
+ }
}
else
- bContextOrNotAsciiEncoding = FALSE;
+ bContextOrNotAsciiEncoding = false;
}
SCCOL nStartCol = 0;
@@ -1712,8 +1705,8 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
const ScViewOptions& rOpt = (pViewSh)
? pViewSh->GetViewData()->GetOptions()
: aDocument.GetViewOptions();
- BOOL bShowFormulas = rOpt.GetOption( VOPT_FORMULAS );
- BOOL bTabProtect = aDocument.IsTabProtected( nTab );
+ sal_Bool bShowFormulas = rOpt.GetOption( VOPT_FORMULAS );
+ sal_Bool bTabProtect = aDocument.IsTabProtected( nTab );
SCCOL nCol;
SCROW nRow;
@@ -1728,10 +1721,10 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
ScBaseCell* pCell;
while ( ( pCell = aIter.GetNext( nCol, nRow ) ) != NULL )
{
- BOOL bProgress = FALSE; // only upon line change
+ sal_Bool bProgress = false; // only upon line change
if ( nNextRow < nRow )
{ // empty rows or/and empty columns up to end of row
- bProgress = TRUE;
+ bProgress = sal_True;
for ( nEmptyCol = nNextCol; nEmptyCol < nEndCol; nEmptyCol++ )
{ // remaining columns of last row
if ( bFixedWidth )
@@ -1777,7 +1770,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
}
if ( nCol == nEndCol )
{
- bProgress = TRUE;
+ bProgress = sal_True;
nNextCol = nStartCol;
nNextRow = nRow + 1;
}
@@ -1795,26 +1788,26 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
pProtAttr->GetHideFormula() ) )
eType = CELLTYPE_NONE; // hide
}
- BOOL bString;
+ sal_Bool bString;
switch ( eType )
{
case CELLTYPE_NOTE:
case CELLTYPE_NONE:
aString.Erase();
- bString = FALSE;
+ bString = false;
break;
case CELLTYPE_FORMULA :
{
- USHORT nErrCode;
+ sal_uInt16 nErrCode;
if ( bShowFormulas )
{
((ScFormulaCell*)pCell)->GetFormula( aString );
- bString = TRUE;
+ bString = sal_True;
}
else if ( ( nErrCode = ((ScFormulaCell*)pCell)->GetErrCode() ) != 0 )
{
aString = ScGlobal::GetErrorString( nErrCode );
- bString = TRUE;
+ bString = sal_True;
}
else if ( ((ScFormulaCell*)pCell)->IsValue() )
{
@@ -1829,7 +1822,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
else
{
ScCellFormat::GetInputString( pCell, nFormat, aString, rFormatter );
- bString = FALSE;
+ bString = false;
}
}
else
@@ -1843,7 +1836,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
}
else
((ScFormulaCell*)pCell)->GetString( aString );
- bString = TRUE;
+ bString = sal_True;
}
}
break;
@@ -1857,7 +1850,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
}
else
((ScStringCell*)pCell)->GetString( aString );
- bString = TRUE;
+ bString = sal_True;
break;
case CELLTYPE_EDIT :
{
@@ -1866,7 +1859,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
EditEngine& rEngine = aDocument.GetEditEngine();
rEngine.SetText( *pObj);
aString = rEngine.GetText(); // including LF
- bString = TRUE;
+ bString = sal_True;
}
break;
case CELLTYPE_VALUE :
@@ -1882,14 +1875,14 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
else
{
ScCellFormat::GetInputString( pCell, nFormat, aString, rFormatter );
- bString = FALSE;
+ bString = false;
}
}
break;
default:
OSL_FAIL( "ScDocShell::AsciiSave: unknown CellType" );
aString.Erase();
- bString = FALSE;
+ bString = false;
}
if ( bFixedWidth )
@@ -1919,14 +1912,21 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
if ( eCharSet == RTL_TEXTENCODING_UNICODE )
{
xub_StrLen nPos = aString.Search( cStrDelim );
+ // #i116636# quotes are needed if text delimiter (quote), field delimiter, or LF is in the cell text
+ bool bNeedQuotes = rAsciiOpt.bQuoteAllText ||
+ ( nPos != STRING_NOTFOUND ) ||
+ ( aString.Search( cDelim ) != STRING_NOTFOUND ) ||
+ ( aString.Search( sal_Unicode(_LF) ) != STRING_NOTFOUND );
while ( nPos != STRING_NOTFOUND )
{
aString.Insert( cStrDelim, nPos );
nPos = aString.Search( cStrDelim, nPos+2 );
}
- rStream.WriteUniOrByteChar( cStrDelim, eCharSet );
+ if ( bNeedQuotes )
+ rStream.WriteUniOrByteChar( cStrDelim, eCharSet );
rStream.WriteUnicodeText( aString );
- rStream.WriteUniOrByteChar( cStrDelim, eCharSet );
+ if ( bNeedQuotes )
+ rStream.WriteUniOrByteChar( cStrDelim, eCharSet );
}
else
{
@@ -1952,6 +1952,10 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
UniString aStrDec( aStrEnc, eCharSet );
// search on re-decoded string
xub_StrLen nPos = aStrDec.Search( aStrDelimDecoded );
+ bool bNeedQuotes = rAsciiOpt.bQuoteAllText ||
+ ( nPos != STRING_NOTFOUND ) ||
+ ( aStrDec.Search( aDelimDecoded ) != STRING_NOTFOUND ) ||
+ ( aStrDec.Search( sal_Unicode(_LF) ) != STRING_NOTFOUND );
while ( nPos != STRING_NOTFOUND )
{
aStrDec.Insert( aStrDelimDecoded, nPos );
@@ -1959,15 +1963,21 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
nPos+1+aStrDelimDecoded.Len() );
}
// write byte re-encoded
- rStream.WriteUniOrByteChar( cStrDelim, eCharSet );
+ if ( bNeedQuotes )
+ rStream.WriteUniOrByteChar( cStrDelim, eCharSet );
rStream.WriteUnicodeOrByteText( aStrDec, eCharSet );
- rStream.WriteUniOrByteChar( cStrDelim, eCharSet );
+ if ( bNeedQuotes )
+ rStream.WriteUniOrByteChar( cStrDelim, eCharSet );
}
else
{
ByteString aStrEnc( aString, eCharSet );
// search on encoded string
xub_StrLen nPos = aStrEnc.Search( aStrDelimEncoded );
+ bool bNeedQuotes = rAsciiOpt.bQuoteAllText ||
+ ( nPos != STRING_NOTFOUND ) ||
+ ( aStrEnc.Search( aDelimEncoded ) != STRING_NOTFOUND ) ||
+ ( aStrEnc.Search( sal_Char(_LF) ) != STRING_NOTFOUND );
while ( nPos != STRING_NOTFOUND )
{
aStrEnc.Insert( aStrDelimEncoded, nPos );
@@ -1975,11 +1985,13 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
nPos+1+aStrDelimEncoded.Len() );
}
// write byte encoded
- rStream.Write( aStrDelimEncoded.GetBuffer(),
- aStrDelimEncoded.Len() );
+ if ( bNeedQuotes )
+ rStream.Write( aStrDelimEncoded.GetBuffer(),
+ aStrDelimEncoded.Len() );
rStream.Write( aStrEnc.GetBuffer(), aStrEnc.Len() );
- rStream.Write( aStrDelimEncoded.GetBuffer(),
- aStrDelimEncoded.Len() );
+ if ( bNeedQuotes )
+ rStream.Write( aStrDelimEncoded.GetBuffer(),
+ aStrDelimEncoded.Len() );
}
}
}
@@ -2033,7 +2045,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
rStream.SetNumberFormatInt( nOldNumberFormatInt );
}
-BOOL ScDocShell::ConvertTo( SfxMedium &rMed )
+sal_Bool ScDocShell::ConvertTo( SfxMedium &rMed )
{
RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScDocShell::ConvertTo" );
@@ -2049,7 +2061,7 @@ BOOL ScDocShell::ConvertTo( SfxMedium &rMed )
DBG_ASSERT( rMed.GetFilter(), "Filter == 0" );
- BOOL bRet = FALSE;
+ sal_Bool bRet = false;
String aFltName = rMed.GetFilter()->GetFilterName();
if (aFltName.EqualsAscii(pFilterXML))
@@ -2123,7 +2135,7 @@ BOOL ScDocShell::ConvertTo( SfxMedium &rMed )
SfxItemSet* pSet = rMed.GetItemSet();
const SfxPoolItem* pItem;
if ( pSet && SFX_ITEM_SET ==
- pSet->GetItemState( SID_FILE_FILTEROPTIONS, TRUE, &pItem ) )
+ pSet->GetItemState( SID_FILE_FILTEROPTIONS, sal_True, &pItem ) )
{
sItStr = ((const SfxStringItem*)pItem)->GetValue();
}
@@ -2140,7 +2152,7 @@ BOOL ScDocShell::ConvertTo( SfxMedium &rMed )
WaitObject aWait( GetActiveDialogParent() );
ScImportOptions aOptions( sItStr );
AsciiSave( *pStream, aOptions );
- bRet = TRUE;
+ bRet = sal_True;
if (aDocument.GetTableCount() > 1)
if (!rMed.GetError())
@@ -2153,7 +2165,7 @@ BOOL ScDocShell::ConvertTo( SfxMedium &rMed )
SfxItemSet* pSet = rMed.GetItemSet();
const SfxPoolItem* pItem;
if ( pSet && SFX_ITEM_SET ==
- pSet->GetItemState( SID_FILE_FILTEROPTIONS, TRUE, &pItem ) )
+ pSet->GetItemState( SID_FILE_FILTEROPTIONS, sal_True, &pItem ) )
{
sCharSet = ((const SfxStringItem*)pItem)->GetValue();
}
@@ -2169,9 +2181,9 @@ BOOL ScDocShell::ConvertTo( SfxMedium &rMed )
WaitObject aWait( GetActiveDialogParent() );
// HACK damit Sba geoffnetes TempFile ueberschreiben kann
rMed.CloseOutStream();
- BOOL bHasMemo = FALSE;
+ sal_Bool bHasMemo = false;
- ULONG eError = DBaseExport( rMed.GetPhysicalName(),
+ sal_uLong eError = DBaseExport( rMed.GetPhysicalName(),
ScGlobal::GetCharsetValue(sCharSet), bHasMemo );
if ( eError != eERR_OK && (eError & ERRCODE_WARNING_MASK) )
@@ -2191,7 +2203,7 @@ BOOL ScDocShell::ConvertTo( SfxMedium &rMed )
}
else
{
- bRet = TRUE;
+ bRet = sal_True;
if ( bHasMemo )
{
SfxStringItem* pNameItem =
@@ -2199,9 +2211,9 @@ BOOL ScDocShell::ConvertTo( SfxMedium &rMed )
INetURLObject aDbtFile( pNameItem->GetValue(), INET_PROT_FILE );
aDbtFile.setExtension( String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("dbt")) );
if ( IsDocument( aDbtFile ) && !KillFile( aDbtFile ) )
- bRet = FALSE;
+ bRet = false;
if ( bRet && !MoveFile( aTmpFile, aDbtFile ) )
- bRet = FALSE;
+ bRet = false;
if ( !bRet )
{
KillFile( aTmpFile );
@@ -2220,7 +2232,7 @@ BOOL ScDocShell::ConvertTo( SfxMedium &rMed )
SfxItemSet* pSet = rMed.GetItemSet();
const SfxPoolItem* pItem;
if ( pSet && SFX_ITEM_SET ==
- pSet->GetItemState( SID_FILE_FILTEROPTIONS, TRUE, &pItem ) )
+ pSet->GetItemState( SID_FILE_FILTEROPTIONS, sal_True, &pItem ) )
{
sItStr = ((const SfxStringItem*)pItem)->GetValue();
}
@@ -2236,7 +2248,7 @@ BOOL ScDocShell::ConvertTo( SfxMedium &rMed )
WaitObject aWait( GetActiveDialogParent() );
ScFormatFilter::Get().ScExportDif( *pStream, &aDocument, ScAddress(0,0,0),
ScGlobal::GetCharsetValue(sItStr) );
- bRet = TRUE;
+ bRet = sal_True;
if (aDocument.GetTableCount() > 1)
if (!rMed.GetError())
@@ -2256,7 +2268,7 @@ BOOL ScDocShell::ConvertTo( SfxMedium &rMed )
ScRange aRange( 0,0,0, nEndCol,nEndRow,0 );
ScImportExport aImExport( &aDocument, aRange );
- aImExport.SetFormulas( TRUE );
+ aImExport.SetFormulas( sal_True );
bRet = aImExport.ExportStream( *pStream, rMed.GetBaseURL( true ), SOT_FORMATSTR_ID_SYLK );
}
}
@@ -2285,15 +2297,15 @@ BOOL ScDocShell::ConvertTo( SfxMedium &rMed )
}
-BOOL ScDocShell::SaveCompleted( const uno::Reference < embed::XStorage >& xStor )
+sal_Bool ScDocShell::SaveCompleted( const uno::Reference < embed::XStorage >& xStor )
{
return SfxObjectShell::SaveCompleted( xStor );
}
-BOOL ScDocShell::DoSaveCompleted( SfxMedium * pNewStor )
+sal_Bool ScDocShell::DoSaveCompleted( SfxMedium * pNewStor )
{
- BOOL bRet = SfxObjectShell::DoSaveCompleted( pNewStor );
+ sal_Bool bRet = SfxObjectShell::DoSaveCompleted( pNewStor );
// SC_HINT_DOC_SAVED fuer Wechsel ReadOnly -> Read/Write
Broadcast( SfxSimpleHint( SC_HINT_DOC_SAVED ) );
@@ -2301,7 +2313,7 @@ BOOL ScDocShell::DoSaveCompleted( SfxMedium * pNewStor )
}
-sal_Bool ScDocShell::QuerySlotExecutable( USHORT nSlotId )
+sal_Bool ScDocShell::QuerySlotExecutable( sal_uInt16 nSlotId )
{
// #i112634# ask VBA event handlers whether to save or print the document
@@ -2331,7 +2343,7 @@ sal_Bool ScDocShell::QuerySlotExecutable( USHORT nSlotId )
}
catch( util::VetoException& )
{
- bSlotExecutable = sal_False;
+ bSlotExecutable = false;
}
catch( uno::Exception& )
{
@@ -2340,7 +2352,7 @@ sal_Bool ScDocShell::QuerySlotExecutable( USHORT nSlotId )
}
-USHORT ScDocShell::PrepareClose( BOOL bUI, BOOL bForBrowsing )
+sal_uInt16 ScDocShell::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing )
{
if(SC_MOD()->GetCurRefDlgId()>0)
{
@@ -2356,12 +2368,12 @@ USHORT ScDocShell::PrepareClose( BOOL bUI, BOOL bForBrowsing )
}
}
- return FALSE;
+ return false;
}
if ( aDocument.IsInLinkUpdate() || aDocument.IsInInterpreter() )
{
ErrorMessage(STR_CLOSE_ERROR_LINK);
- return FALSE;
+ return false;
}
DoEnterHandler();
@@ -2378,7 +2390,7 @@ USHORT ScDocShell::PrepareClose( BOOL bUI, BOOL bForBrowsing )
catch( util::VetoException& )
{
// if event processor throws VetoException, macro has vetoed close
- return sal_False;
+ return false;
}
catch( uno::Exception& )
{
@@ -2386,9 +2398,9 @@ USHORT ScDocShell::PrepareClose( BOOL bUI, BOOL bForBrowsing )
}
// end handler code
- USHORT nRet = SfxObjectShell::PrepareClose( bUI, bForBrowsing );
- if (nRet == TRUE) // TRUE = schliessen
- aDocument.DisableIdle(TRUE); // nicht mehr drin rumpfuschen !!!
+ sal_uInt16 nRet = SfxObjectShell::PrepareClose( bUI, bForBrowsing );
+ if (nRet == sal_True) // sal_True = schliessen
+ aDocument.DisableIdle(sal_True); // nicht mehr drin rumpfuschen !!!
return nRet;
}
@@ -2442,9 +2454,9 @@ String ScDocShell::GetDifFilterName()
return String::CreateFromAscii(pFilterDif);
}
-BOOL ScDocShell::HasAutomaticTableName( const String& rFilter )
+sal_Bool ScDocShell::HasAutomaticTableName( const String& rFilter )
{
- // TRUE for those filters that keep the default table name
+ // sal_True for those filters that keep the default table name
// (which is language specific)
return rFilter.EqualsAscii( pFilterAscii )
@@ -2465,15 +2477,15 @@ BOOL ScDocShell::HasAutomaticTableName( const String& rFilter )
aDdeTextFmt(String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("TEXT"))), \
nPrtToScreenFactor( 1.0 ), \
pImpl ( new DocShell_Impl ), \
- bHeaderOn ( TRUE ), \
- bFooterOn ( TRUE ), \
- bNoInformLost ( TRUE ), \
- bIsEmpty ( TRUE ), \
- bIsInUndo ( FALSE ), \
- bDocumentModifiedPending( FALSE ), \
+ bHeaderOn ( sal_True ), \
+ bFooterOn ( sal_True ), \
+ bNoInformLost ( sal_True ), \
+ bIsEmpty ( sal_True ), \
+ bIsInUndo ( false ), \
+ bDocumentModifiedPending( false ), \
nDocumentLock ( 0 ), \
nCanUpdate (com::sun::star::document::UpdateDocMode::ACCORDING_TO_CONFIG), \
- bUpdateEnabled ( TRUE ), \
+ bUpdateEnabled ( sal_True ), \
pOldAutoDBRange ( NULL ), \
pDocHelper ( NULL ), \
pAutoStyleList ( NULL ), \
@@ -2588,7 +2600,7 @@ SfxUndoManager* ScDocShell::GetUndoManager()
return aDocument.GetUndoManager();
}
-void ScDocShell::SetModified( BOOL bModified )
+void ScDocShell::SetModified( sal_Bool bModified )
{
if ( SfxObjectShell::IsEnableSetModified() )
{
@@ -2598,7 +2610,7 @@ void ScDocShell::SetModified( BOOL bModified )
}
-void ScDocShell::SetDocumentModified( BOOL bIsModified /* = TRUE */ )
+void ScDocShell::SetDocumentModified( sal_Bool bIsModified /* = sal_True */ )
{
// BroadcastUno muss auch mit pPaintLockData sofort passieren
//! auch bei SetDrawModified, wenn Drawing angebunden ist
@@ -2607,6 +2619,7 @@ void ScDocShell::SetDocumentModified( BOOL bIsModified /* = TRUE */ )
if ( pPaintLockData && bIsModified )
{
//! BCA_BRDCST_ALWAYS etc. also needed here?
+ aDocument.InvalidateTableArea(); // #i105279# needed here
aDocument.BroadcastUno( SfxSimpleHint( SFX_HINT_DATACHANGED ) );
pPaintLockData->SetModified(); // spaeter...
@@ -2618,16 +2631,16 @@ void ScDocShell::SetDocumentModified( BOOL bIsModified /* = TRUE */ )
if ( bIsModified )
{
if ( aDocument.IsAutoCalcShellDisabled() )
- SetDocumentModifiedPending( TRUE );
+ SetDocumentModifiedPending( sal_True );
else
{
- SetDocumentModifiedPending( FALSE );
+ SetDocumentModifiedPending( false );
aDocument.InvalidateStyleSheetUsage();
aDocument.InvalidateTableArea();
aDocument.InvalidateLastTableOpParams();
aDocument.Broadcast( SC_HINT_DATACHANGED, BCA_BRDCST_ALWAYS, NULL );
if ( aDocument.IsForcedFormulaPending() && aDocument.GetAutoCalc() )
- aDocument.CalcFormulaTree( TRUE );
+ aDocument.CalcFormulaTree( sal_True );
PostDataChanged();
// Detective AutoUpdate:
@@ -2639,9 +2652,9 @@ void ScDocShell::SetDocumentModified( BOOL bIsModified /* = TRUE */ )
if ( pList && ( aDocument.IsDetectiveDirty() || pList->HasAddError() ) &&
pList->Count() && !IsInUndo() && SC_MOD()->GetAppOptions().GetDetectiveAuto() )
{
- GetDocFunc().DetectiveRefresh(TRUE); // TRUE = caused by automatic update
+ GetDocFunc().DetectiveRefresh(sal_True); // sal_True = caused by automatic update
}
- aDocument.SetDetectiveDirty(FALSE); // always reset, also if not refreshed
+ aDocument.SetDetectiveDirty(false); // always reset, also if not refreshed
}
// notify UNO objects after BCA_BRDCST_ALWAYS etc.
@@ -2653,9 +2666,9 @@ void ScDocShell::SetDocumentModified( BOOL bIsModified /* = TRUE */ )
// (Drawing muss auch beim normalen SetDocumentModified upgedated werden,
// z.B. bei Tabelle loeschen etc.)
-void ScDocShell::SetDrawModified( BOOL bIsModified /* = TRUE */ )
+void ScDocShell::SetDrawModified( sal_Bool bIsModified /* = sal_True */ )
{
- BOOL bUpdate = ( bIsModified != IsModified() );
+ sal_Bool bUpdate = ( bIsModified != IsModified() );
SetModified( bIsModified );
@@ -2690,7 +2703,7 @@ void ScDocShell::SetDrawModified( BOOL bIsModified /* = TRUE */ )
}
}
-void ScDocShell::SetInUndo(BOOL bSet)
+void ScDocShell::SetInUndo(sal_Bool bSet)
{
bIsInUndo = bSet;
}
@@ -2705,8 +2718,8 @@ void ScDocShell::GetDocStat( ScDocStat& rDocStat )
if ( pPrinter )
for ( SCTAB i=0; i<rDocStat.nTableCount; i++ )
- rDocStat.nPageCount = sal::static_int_cast<USHORT>( rDocStat.nPageCount +
- (USHORT) ScPrintFunc( this, pPrinter, i ).GetTotalPages() );
+ rDocStat.nPageCount = sal::static_int_cast<sal_uInt16>( rDocStat.nPageCount +
+ (sal_uInt16) ScPrintFunc( this, pPrinter, i ).GetTotalPages() );
}
@@ -2879,7 +2892,7 @@ void ScDocShell::UseSheetSaveEntries()
for (nTab = 0; nTab < nTabCount; ++nTab)
if (aDocument.IsStreamValid(nTab))
- aDocument.SetStreamValid(nTab, FALSE);
+ aDocument.SetStreamValid(nTab, false);
}
}
}
@@ -2894,8 +2907,8 @@ ScDocShellModificator::ScDocShellModificator( ScDocShell& rDS )
ScDocument* pDoc = rDocShell.GetDocument();
bAutoCalcShellDisabled = pDoc->IsAutoCalcShellDisabled();
bIdleDisabled = pDoc->IsIdleDisabled();
- pDoc->SetAutoCalcShellDisabled( TRUE );
- pDoc->DisableIdle( TRUE );
+ pDoc->SetAutoCalcShellDisabled( sal_True );
+ pDoc->DisableIdle( sal_True );
}
@@ -2915,7 +2928,7 @@ void ScDocShellModificator::SetDocumentModified()
if ( !pDoc->IsImportingXML() )
{
// AutoCalcShellDisabled temporaer restaurieren
- BOOL bDisabled = pDoc->IsAutoCalcShellDisabled();
+ sal_Bool bDisabled = pDoc->IsAutoCalcShellDisabled();
pDoc->SetAutoCalcShellDisabled( bAutoCalcShellDisabled );
rDocShell.SetDocumentModified();
pDoc->SetAutoCalcShellDisabled( bDisabled );
@@ -2936,7 +2949,7 @@ sal_Bool ScDocShell::AcceptStateUpdate() const
if( SC_MOD()->Find1RefWindow( SFX_APP()->GetTopWindow() ) )
return sal_True;
- return sal_False;
+ return false;
}
@@ -2965,7 +2978,7 @@ void ScDocShell::SetChangeRecording( bool bActivate )
{
aDocument.StartChangeTracking();
ScChangeViewSettings aChangeViewSet;
- aChangeViewSet.SetShowChanges(TRUE);
+ aChangeViewSet.SetShowChanges(sal_True);
aDocument.SetChangeViewSettings(aChangeViewSet);
}
else
@@ -2980,7 +2993,7 @@ void ScDocShell::SetChangeRecording( bool bActivate )
// Slots invalidieren
SfxBindings* pBindings = GetViewBindings();
if (pBindings)
- pBindings->InvalidateAll(FALSE);
+ pBindings->InvalidateAll(false);
}
}
diff --git a/sc/source/ui/docshell/docsh2.cxx b/sc/source/ui/docshell/docsh2.cxx
index d4d581dc7783..52d99479f27d 100644
--- a/sc/source/ui/docshell/docsh2.cxx
+++ b/sc/source/ui/docshell/docsh2.cxx
@@ -68,22 +68,22 @@ using namespace com::sun::star;
//------------------------------------------------------------------
-BOOL ScDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
+sal_Bool ScDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
{
RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScDocShell::InitNew" );
- BOOL bRet = SfxObjectShell::InitNew( xStor );
+ sal_Bool bRet = SfxObjectShell::InitNew( xStor );
aDocument.MakeTable(0);
// zusaetzliche Tabellen werden von der ersten View angelegt,
- // wenn bIsEmpty dann noch TRUE ist
+ // wenn bIsEmpty dann noch sal_True ist
if( bRet )
{
Size aSize( (long) ( STD_COL_WIDTH * HMM_PER_TWIPS * OLE_STD_CELLS_X ),
(long) ( ScGlobal::nStdRowHeight * HMM_PER_TWIPS * OLE_STD_CELLS_Y ) );
// hier muss auch der Start angepasst werden
- SetVisAreaOrSize( Rectangle( Point(), aSize ), TRUE );
+ SetVisAreaOrSize( Rectangle( Point(), aSize ), sal_True );
}
aDocument.SetDrawDefaults(); // drawing layer defaults that are set only in InitNew
@@ -104,13 +104,13 @@ BOOL ScDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
//------------------------------------------------------------------
-BOOL ScDocShell::IsEmpty() const
+sal_Bool ScDocShell::IsEmpty() const
{
return bIsEmpty;
}
-void ScDocShell::SetEmpty(BOOL bSet)
+void ScDocShell::SetEmpty(sal_Bool bSet)
{
bIsEmpty = bSet;
}
@@ -151,7 +151,7 @@ void ScDocShell::InitItems()
!aDocument.IsValidAsianCompression() || !aDocument.IsValidAsianKerning() )
{
// get settings from SvxAsianConfig
- SvxAsianConfig aAsian( sal_False );
+ SvxAsianConfig aAsian( false );
if ( !aDocument.GetForbiddenCharacters().is() )
{
@@ -179,7 +179,7 @@ void ScDocShell::InitItems()
if ( !aDocument.IsValidAsianCompression() )
{
// set compression mode from configuration if not already set (e.g. XML import)
- aDocument.SetAsianCompression( sal::static_int_cast<BYTE>( aAsian.GetCharDistanceCompression() ) );
+ aDocument.SetAsianCompression( sal::static_int_cast<sal_uInt8>( aAsian.GetCharDistanceCompression() ) );
}
if ( !aDocument.IsValidAsianKerning() )
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index a9e79b46e86f..87ae56cceb38 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -111,8 +111,8 @@ void ScDocShell::PostDataChanged()
}
void ScDocShell::PostPaint( SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab,
- SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab, USHORT nPart,
- USHORT nExtFlags )
+ SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab, sal_uInt16 nPart,
+ sal_uInt16 nExtFlags )
{
if (!ValidCol(nStartCol)) nStartCol = MAXCOL;
if (!ValidRow(nStartRow)) nStartRow = MAXROW;
@@ -123,7 +123,7 @@ void ScDocShell::PostPaint( SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab,
{
// #i54081# PAINT_EXTRAS still has to be brodcast because it changes the
// current sheet if it's invalid. All other flags added to pPaintLockData.
- USHORT nLockPart = nPart & ~PAINT_EXTRAS;
+ sal_uInt16 nLockPart = nPart & ~PAINT_EXTRAS;
if ( nLockPart )
{
//! nExtFlags ???
@@ -173,7 +173,7 @@ void ScDocShell::PostPaint( SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab,
aDocument.ResetChanged( ScRange(nStartCol,nStartRow,nStartTab,nEndCol,nEndRow,nEndTab) );
}
-void ScDocShell::PostPaint( const ScRange& rRange, USHORT nPart, USHORT nExtFlags )
+void ScDocShell::PostPaint( const ScRange& rRange, sal_uInt16 nPart, sal_uInt16 nExtFlags )
{
PostPaint( rRange.aStart.Col(), rRange.aStart.Row(), rRange.aStart.Tab(),
rRange.aEnd.Col(), rRange.aEnd.Row(), rRange.aEnd.Tab(),
@@ -200,7 +200,7 @@ void ScDocShell::PostPaintExtras()
PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PAINT_EXTRAS );
}
-void ScDocShell::UpdatePaintExt( USHORT& rExtFlags, const ScRange& rRange )
+void ScDocShell::UpdatePaintExt( sal_uInt16& rExtFlags, const ScRange& rRange )
{
if ( ( rExtFlags & SC_PF_LINES ) == 0 && aDocument.HasAttrib( rRange, HASATTR_PAINTEXT ) )
{
@@ -224,7 +224,7 @@ void ScDocShell::UpdatePaintExt( USHORT& rExtFlags, const ScRange& rRange )
}
}
-void ScDocShell::UpdatePaintExt( USHORT& rExtFlags, SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab,
+void ScDocShell::UpdatePaintExt( sal_uInt16& rExtFlags, SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab,
SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab )
{
UpdatePaintExt( rExtFlags, ScRange( nStartCol, nStartRow, nStartTab, nEndCol, nEndRow, nEndTab ) );
@@ -232,14 +232,14 @@ void ScDocShell::UpdatePaintExt( USHORT& rExtFlags, SCCOL nStartCol, SCROW nStar
//------------------------------------------------------------------
-void ScDocShell::LockPaint_Impl(BOOL bDoc)
+void ScDocShell::LockPaint_Impl(sal_Bool bDoc)
{
if ( !pPaintLockData )
pPaintLockData = new ScPaintLockData(0); //! Modus...
pPaintLockData->IncLevel(bDoc);
}
-void ScDocShell::UnlockPaint_Impl(BOOL bDoc)
+void ScDocShell::UnlockPaint_Impl(sal_Bool bDoc)
{
if ( pPaintLockData )
{
@@ -255,7 +255,7 @@ void ScDocShell::UnlockPaint_Impl(BOOL bDoc)
ScRangeListRef xRangeList = pPaint->GetRangeList();
if (xRangeList)
{
- USHORT nParts = pPaint->GetParts();
+ sal_uInt16 nParts = pPaint->GetParts();
for ( size_t i = 0, nCount = xRangeList->size(); i < nCount; i++ )
{
//! nExtFlags ???
@@ -278,7 +278,7 @@ void ScDocShell::UnlockPaint_Impl(BOOL bDoc)
}
}
-void ScDocShell::LockDocument_Impl(USHORT nNew)
+void ScDocShell::LockDocument_Impl(sal_uInt16 nNew)
{
if (!nDocumentLock)
{
@@ -289,7 +289,7 @@ void ScDocShell::LockDocument_Impl(USHORT nNew)
nDocumentLock = nNew;
}
-void ScDocShell::UnlockDocument_Impl(USHORT nNew)
+void ScDocShell::UnlockDocument_Impl(sal_uInt16 nNew)
{
nDocumentLock = nNew;
if (!nDocumentLock)
@@ -300,41 +300,41 @@ void ScDocShell::UnlockDocument_Impl(USHORT nNew)
}
}
-USHORT ScDocShell::GetLockCount() const
+sal_uInt16 ScDocShell::GetLockCount() const
{
return nDocumentLock;
}
-void ScDocShell::SetLockCount(USHORT nNew)
+void ScDocShell::SetLockCount(sal_uInt16 nNew)
{
if (nNew) // setzen
{
if ( !pPaintLockData )
pPaintLockData = new ScPaintLockData(0); //! Modus...
- pPaintLockData->SetLevel(nNew-1, TRUE);
+ pPaintLockData->SetLevel(nNew-1, sal_True);
LockDocument_Impl(nNew);
}
else if (pPaintLockData) // loeschen
{
- pPaintLockData->SetLevel(0, TRUE); // bei Unlock sofort ausfuehren
- UnlockPaint_Impl(TRUE); // jetzt
+ pPaintLockData->SetLevel(0, sal_True); // bei Unlock sofort ausfuehren
+ UnlockPaint_Impl(sal_True); // jetzt
UnlockDocument_Impl(0);
}
}
void ScDocShell::LockPaint()
{
- LockPaint_Impl(FALSE);
+ LockPaint_Impl(false);
}
void ScDocShell::UnlockPaint()
{
- UnlockPaint_Impl(FALSE);
+ UnlockPaint_Impl(false);
}
void ScDocShell::LockDocument()
{
- LockPaint_Impl(TRUE);
+ LockPaint_Impl(sal_True);
LockDocument_Impl(nDocumentLock + 1);
}
@@ -342,7 +342,7 @@ void ScDocShell::UnlockDocument()
{
if (nDocumentLock)
{
- UnlockPaint_Impl(TRUE);
+ UnlockPaint_Impl(sal_True);
UnlockDocument_Impl(nDocumentLock - 1);
}
else
@@ -353,7 +353,7 @@ void ScDocShell::UnlockDocument()
//------------------------------------------------------------------
-void ScDocShell::SetInplace( BOOL bInplace )
+void ScDocShell::SetInplace( sal_Bool bInplace )
{
if (bIsInplace != bInplace)
{
@@ -370,7 +370,7 @@ void ScDocShell::CalcOutputFactor()
return;
}
- BOOL bTextWysiwyg = SC_MOD()->GetInputOptions().GetTextWysiwyg();
+ sal_Bool bTextWysiwyg = SC_MOD()->GetInputOptions().GetTextWysiwyg();
if (bTextWysiwyg)
{
nPrtToScreenFactor = 1.0;
@@ -423,8 +423,8 @@ void ScDocShell::InitOptions(bool bForLoading) // called from InitNew and L
{
// Einstellungen aus dem SpellCheckCfg kommen in Doc- und ViewOptions
- USHORT nDefLang, nCjkLang, nCtlLang;
- BOOL bAutoSpell;
+ sal_uInt16 nDefLang, nCjkLang, nCtlLang;
+ sal_Bool bAutoSpell;
ScModule::GetSpellSettings( nDefLang, nCjkLang, nCtlLang, bAutoSpell );
ScModule* pScMod = SC_MOD();
@@ -433,7 +433,7 @@ void ScDocShell::InitOptions(bool bForLoading) // called from InitNew and L
aDocOpt.SetAutoSpell( bAutoSpell );
// zweistellige Jahreszahleneingabe aus Extras->Optionen->Allgemein->Sonstiges
- aDocOpt.SetYear2000( sal::static_int_cast<USHORT>( ::utl::MiscCfg().GetYear2000() ) );
+ aDocOpt.SetYear2000( sal::static_int_cast<sal_uInt16>( ::utl::MiscCfg().GetYear2000() ) );
if (bForLoading)
{
@@ -458,7 +458,7 @@ Printer* ScDocShell::GetDocumentPrinter() // fuer OLE
return aDocument.GetPrinter();
}
-SfxPrinter* ScDocShell::GetPrinter(BOOL bCreateIfNotExist)
+SfxPrinter* ScDocShell::GetPrinter(sal_Bool bCreateIfNotExist)
{
return aDocument.GetPrinter(bCreateIfNotExist);
}
@@ -467,7 +467,7 @@ void ScDocShell::UpdateFontList()
{
delete pImpl->pFontList;
// pImpl->pFontList = new FontList( GetPrinter(), Application::GetDefaultDevice() );
- pImpl->pFontList = new FontList( GetRefDevice(), NULL, FALSE ); // FALSE or TRUE???
+ pImpl->pFontList = new FontList( GetRefDevice(), NULL, false ); // sal_False or sal_True???
SvxFontListItem aFontListItem( pImpl->pFontList, SID_ATTR_CHAR_FONTLIST );
PutItem( aFontListItem );
@@ -479,9 +479,9 @@ OutputDevice* ScDocShell::GetRefDevice()
return aDocument.GetRefDevice();
}
-USHORT ScDocShell::SetPrinter( SfxPrinter* pNewPrinter, USHORT nDiffFlags )
+sal_uInt16 ScDocShell::SetPrinter( SfxPrinter* pNewPrinter, sal_uInt16 nDiffFlags )
{
- SfxPrinter *pOld = aDocument.GetPrinter( FALSE );
+ SfxPrinter *pOld = aDocument.GetPrinter( false );
if ( pOld && pOld->IsPrinting() )
return SFX_PRINTERROR_BUSY;
@@ -552,8 +552,8 @@ USHORT ScDocShell::SetPrinter( SfxPrinter* pNewPrinter, USHORT nDiffFlags )
if (nDiffFlags & SFX_PRINTER_CHG_ORIENTATION)
{
const SvxPageItem& rOldItem = (const SvxPageItem&)rSet.Get(ATTR_PAGE);
- BOOL bWasLand = rOldItem.IsLandscape();
- BOOL bNewLand = ( pNewPrinter->GetOrientation() == ORIENTATION_LANDSCAPE );
+ sal_Bool bWasLand = rOldItem.IsLandscape();
+ sal_Bool bNewLand = ( pNewPrinter->GetOrientation() == ORIENTATION_LANDSCAPE );
if (bNewLand != bWasLand)
{
SvxPageItem aNewItem( rOldItem );
@@ -660,13 +660,13 @@ void ScDocShell::SetChangeComment( ScChangeAction* pAction, const String& rComme
ScChangeTrack* pTrack = GetDocument()->GetChangeTrack();
if (pTrack)
{
- ULONG nNumber = pAction->GetActionNumber();
+ sal_uLong nNumber = pAction->GetActionNumber();
pTrack->NotifyModified( SC_CTM_CHANGE, nNumber, nNumber );
}
}
}
-void ScDocShell::ExecuteChangeCommentDialog( ScChangeAction* pAction, Window* pParent,BOOL bPrevNext)
+void ScDocShell::ExecuteChangeCommentDialog( ScChangeAction* pAction, Window* pParent,sal_Bool bPrevNext)
{
if (!pAction) return; // ohne Aktion ist nichts..
@@ -676,7 +676,7 @@ void ScDocShell::ExecuteChangeCommentDialog( ScChangeAction* pAction, Window* pP
DateTime aDT = pAction->GetDateTime();
String aDate = ScGlobal::pLocaleData->getDate( aDT );
aDate += ' ';
- aDate += ScGlobal::pLocaleData->getTime( aDT, FALSE, FALSE );
+ aDate += ScGlobal::pLocaleData->getTime( aDT, false, false );
SfxItemSet aSet( GetPool(),
SID_ATTR_POSTIT_AUTHOR, SID_ATTR_POSTIT_AUTHOR,
@@ -728,7 +728,7 @@ void ScDocShell::CompareDocument( ScDocument& rOtherDoc )
if (pOtherMed)
aOtherFile = pOtherMed->GetName();
}
- BOOL bSameDoc = ( aThisFile == aOtherFile && aThisFile.Len() );
+ sal_Bool bSameDoc = ( aThisFile == aOtherFile && aThisFile.Len() );
if ( !bSameDoc )
{
// create change actions from comparing with the name of the user
@@ -764,7 +764,7 @@ void ScDocShell::CompareDocument( ScDocument& rOtherDoc )
//
//---------------------------------------------------------------------
-inline BOOL lcl_Equal( const ScChangeAction* pA, const ScChangeAction* pB, BOOL bIgnore100Sec )
+inline sal_Bool lcl_Equal( const ScChangeAction* pA, const ScChangeAction* pB, sal_Bool bIgnore100Sec )
{
return pA && pB &&
pA->GetActionNumber() == pB->GetActionNumber() &&
@@ -776,14 +776,14 @@ inline BOOL lcl_Equal( const ScChangeAction* pA, const ScChangeAction* pB, BOOL
// State nicht vergleichen, falls eine alte Aenderung akzeptiert wurde
}
-bool lcl_FindAction( ScDocument* pDoc, const ScChangeAction* pAction, ScDocument* pSearchDoc, const ScChangeAction* pFirstSearchAction, const ScChangeAction* pLastSearchAction, BOOL bIgnore100Sec )
+bool lcl_FindAction( ScDocument* pDoc, const ScChangeAction* pAction, ScDocument* pSearchDoc, const ScChangeAction* pFirstSearchAction, const ScChangeAction* pLastSearchAction, sal_Bool bIgnore100Sec )
{
if ( !pDoc || !pAction || !pSearchDoc || !pFirstSearchAction || !pLastSearchAction )
{
return false;
}
- ULONG nLastSearchAction = pLastSearchAction->GetActionNumber();
+ sal_uLong nLastSearchAction = pLastSearchAction->GetActionNumber();
const ScChangeAction* pA = pFirstSearchAction;
while ( pA && pA->GetActionNumber() <= nLastSearchAction )
{
@@ -795,9 +795,9 @@ bool lcl_FindAction( ScDocument* pDoc, const ScChangeAction* pAction, ScDocument
pAction->GetBigRange() == pA->GetBigRange() )
{
String aActionDesc;
- pAction->GetDescription( aActionDesc, pDoc, TRUE );
+ pAction->GetDescription( aActionDesc, pDoc, sal_True );
String aADesc;
- pA->GetDescription( aADesc, pSearchDoc, TRUE );
+ pA->GetDescription( aADesc, pSearchDoc, sal_True );
if ( aActionDesc.Equals( aADesc ) )
{
OSL_FAIL( "lcl_FindAction(): found equal action!" );
@@ -810,9 +810,9 @@ bool lcl_FindAction( ScDocument* pDoc, const ScChangeAction* pAction, ScDocument
return false;
}
-void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheckDuplicates, ULONG nOffset, ScChangeActionMergeMap* pMergeMap, bool bInverseMap )
+void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheckDuplicates, sal_uLong nOffset, ScChangeActionMergeMap* pMergeMap, bool bInverseMap )
{
- ScTabViewShell* pViewSh = GetBestViewShell( FALSE ); //! Funktionen an die DocShell
+ ScTabViewShell* pViewSh = GetBestViewShell( false ); //! Funktionen an die DocShell
if (!pViewSh)
return;
@@ -830,17 +830,17 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
{
// visuelles RedLining einschalten
ScChangeViewSettings aChangeViewSet;
- aChangeViewSet.SetShowChanges(TRUE);
+ aChangeViewSet.SetShowChanges(sal_True);
aDocument.SetChangeViewSettings(aChangeViewSet);
}
}
// include 100th seconds in compare?
- BOOL bIgnore100Sec = !pSourceTrack->IsTime100thSeconds() ||
+ sal_Bool bIgnore100Sec = !pSourceTrack->IsTime100thSeconds() ||
!pThisTrack->IsTime100thSeconds();
// gemeinsame Ausgangsposition suchen
- ULONG nFirstNewNumber = 0;
+ sal_uLong nFirstNewNumber = 0;
const ScChangeAction* pSourceAction = pSourceTrack->GetFirst();
const ScChangeAction* pThisAction = pThisTrack->GetFirst();
// skip identical actions
@@ -863,7 +863,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
const ScChangeAction* pLastSearchAction = pThisTrack->GetLast();
// MergeChangeData aus den folgenden Aktionen erzeugen
- ULONG nNewActionCount = 0;
+ sal_uLong nNewActionCount = 0;
const ScChangeAction* pCount = pSourceAction;
while ( pCount )
{
@@ -879,7 +879,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("...")),
nNewActionCount );
- ULONG nLastMergeAction = pSourceTrack->GetLast()->GetActionNumber();
+ sal_uLong nLastMergeAction = pSourceTrack->GetLast()->GetActionNumber();
// UpdateReference-Undo, gueltige Referenzen fuer den letzten gemeinsamen Zustand
pSourceTrack->MergePrepare( (ScChangeAction*) pFirstMergeAction, bShared );
@@ -905,7 +905,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
const ScChangeActionDel* pDel = (const ScChangeActionDel*) pThisAction;
if ( pDel->IsTopDelete() && !pDel->IsTabDeleteCol() )
{ // deleted Table enthaelt deleted Cols, die nicht
- ULONG nStart, nEnd;
+ sal_uLong nStart, nEnd;
pSourceTrack->AppendDeleteRange(
pDel->GetOverAllRange().MakeRange(), NULL, nStart, nEnd );
}
@@ -930,9 +930,9 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
LockPaint(); // #i73877# no repainting after each action
// MergeChangeData in das aktuelle Dokument uebernehmen
- BOOL bHasRejected = FALSE;
+ sal_Bool bHasRejected = false;
String aOldUser = pThisTrack->GetUser();
- pThisTrack->SetUseFixDateTime( TRUE );
+ pThisTrack->SetUseFixDateTime( sal_True );
ScMarkData& rMarkData = pViewSh->GetViewData()->GetMarkData();
ScMarkData aOldMarkData( rMarkData );
pSourceAction = pFirstMergeAction;
@@ -981,10 +981,10 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
pThisTrack->SetUser( pSourceAction->GetUser() );
pThisTrack->SetFixDateTimeUTC( pSourceAction->GetDateTimeUTC() );
- ULONG nOldActionMax = pThisTrack->GetActionMax();
+ sal_uLong nOldActionMax = pThisTrack->GetActionMax();
bool bExecute = true;
- ULONG nReject = pSourceAction->GetRejectAction();
+ sal_uLong nReject = pSourceAction->GetRejectAction();
if ( nReject )
{
if ( bShared )
@@ -997,7 +997,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
if ( pOldAction && pOldAction->IsVirgin() )
{
pThisTrack->Reject( pOldAction );
- bHasRejected = TRUE;
+ bHasRejected = sal_True;
bExecute = false;
}
}
@@ -1012,7 +1012,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
//! oder Reject-Aenderung normal ausfuehren
pThisTrack->Reject(pOldAction);
- bHasRejected = TRUE; // fuer Paint
+ bHasRejected = sal_True; // fuer Paint
}
bExecute = false;
}
@@ -1034,7 +1034,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
ScAddress aPos = aSourceRange.aStart;
String aValue;
((const ScChangeActionContent*)pSourceAction)->GetNewString( aValue );
- BYTE eMatrix = MM_NONE;
+ sal_uInt8 eMatrix = MM_NONE;
const ScBaseCell* pCell = ((const ScChangeActionContent*)pSourceAction)->GetNewCell();
if ( pCell && pCell->GetCellType() == CELLTYPE_FORMULA )
eMatrix = ((const ScFormulaCell*)pCell)->GetMatrixFlag();
@@ -1053,7 +1053,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
aValue.Erase( 0, 1 );
aValue.Erase( aValue.Len()-1, 1 );
GetDocFunc().EnterMatrix( aSourceRange,
- NULL, NULL, aValue, FALSE, FALSE,
+ NULL, NULL, aValue, false, false,
EMPTY_STRING, formula::FormulaGrammar::GRAM_DEFAULT );
}
break;
@@ -1072,17 +1072,17 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
{
String aName;
aDocument.CreateValidTabName( aName );
- GetDocFunc().InsertTable( aSourceRange.aStart.Tab(), aName, TRUE, FALSE );
+ GetDocFunc().InsertTable( aSourceRange.aStart.Tab(), aName, sal_True, false );
}
break;
case SC_CAT_INSERT_ROWS:
- GetDocFunc().InsertCells( aSourceRange, NULL, INS_INSROWS, TRUE, FALSE );
+ GetDocFunc().InsertCells( aSourceRange, NULL, INS_INSROWS, sal_True, false );
break;
case SC_CAT_INSERT_COLS:
- GetDocFunc().InsertCells( aSourceRange, NULL, INS_INSCOLS, TRUE, FALSE );
+ GetDocFunc().InsertCells( aSourceRange, NULL, INS_INSCOLS, sal_True, false );
break;
case SC_CAT_DELETE_TABS :
- GetDocFunc().DeleteTable( aSourceRange.aStart.Tab(), TRUE, FALSE );
+ GetDocFunc().DeleteTable( aSourceRange.aStart.Tab(), sal_True, false );
break;
case SC_CAT_DELETE_ROWS:
{
@@ -1090,7 +1090,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
if ( pDel->IsTopDelete() )
{
aSourceRange = pDel->GetOverAllRange().MakeRange();
- GetDocFunc().DeleteCells( aSourceRange, NULL, DEL_DELROWS, TRUE, FALSE );
+ GetDocFunc().DeleteCells( aSourceRange, NULL, DEL_DELROWS, sal_True, false );
// #i101099# [Collaboration] Changes are not correctly shown
if ( bShared )
@@ -1110,7 +1110,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
if ( pDel->IsTopDelete() && !pDel->IsTabDeleteCol() )
{ // deleted Table enthaelt deleted Cols, die nicht
aSourceRange = pDel->GetOverAllRange().MakeRange();
- GetDocFunc().DeleteCells( aSourceRange, NULL, DEL_DELCOLS, TRUE, FALSE );
+ GetDocFunc().DeleteCells( aSourceRange, NULL, DEL_DELCOLS, sal_True, false );
}
}
break;
@@ -1119,7 +1119,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
const ScChangeActionMove* pMove = (const ScChangeActionMove*) pSourceAction;
ScRange aFromRange( pMove->GetFromRange().MakeRange() );
GetDocFunc().MoveBlock( aFromRange,
- aSourceRange.aStart, TRUE, TRUE, FALSE, FALSE );
+ aSourceRange.aStart, sal_True, sal_True, false, false );
}
break;
default:
@@ -1159,10 +1159,10 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
ScChangeAction* pAct = pThisTrack->GetLast();
if ( pAct && pAct->GetActionNumber() > nOldActionMax )
{
- ULONG nActionMax = pAct->GetActionNumber();
- ULONG nActionCount = nActionMax - nOldActionMax;
- ULONG nAction = nActionMax - nActionCount + 1;
- ULONG nSourceAction = pSourceAction->GetActionNumber() - nActionCount + 1;
+ sal_uLong nActionMax = pAct->GetActionNumber();
+ sal_uLong nActionCount = nActionMax - nOldActionMax;
+ sal_uLong nAction = nActionMax - nActionCount + 1;
+ sal_uLong nSourceAction = pSourceAction->GetActionNumber() - nActionCount + 1;
while ( nAction <= nActionMax )
{
if ( bInverseMap )
@@ -1184,7 +1184,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
rMarkData = aOldMarkData;
pThisTrack->SetUser(aOldUser);
- pThisTrack->SetUseFixDateTime( FALSE );
+ pThisTrack->SetUseFixDateTime( false );
pSourceTrack->Clear(); //! der ist jetzt verhunzt
@@ -1216,11 +1216,11 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell )
// reset show changes
ScChangeViewSettings aChangeViewSet;
- aChangeViewSet.SetShowChanges( FALSE );
+ aChangeViewSet.SetShowChanges( false );
aDocument.SetChangeViewSettings( aChangeViewSet );
// find first merge action in this document
- BOOL bIgnore100Sec = !pThisTrack->IsTime100thSeconds() || !pSharedTrack->IsTime100thSeconds();
+ sal_Bool bIgnore100Sec = !pThisTrack->IsTime100thSeconds() || !pSharedTrack->IsTime100thSeconds();
ScChangeAction* pThisAction = pThisTrack->GetFirst();
ScChangeAction* pSharedAction = pSharedTrack->GetFirst();
while ( lcl_Equal( pThisAction, pSharedAction, bIgnore100Sec ) )
@@ -1234,8 +1234,8 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell )
if ( pThisAction )
{
// merge own changes into shared document
- ULONG nActStartShared = pSharedAction->GetActionNumber();
- ULONG nActEndShared = pSharedTrack->GetActionMax();
+ sal_uLong nActStartShared = pSharedAction->GetActionNumber();
+ sal_uLong nActEndShared = pSharedTrack->GetActionMax();
ScDocument* pTmpDoc = new ScDocument;
for ( sal_Int32 nIndex = 0; nIndex < aDocument.GetTableCount(); ++nIndex )
{
@@ -1247,8 +1247,8 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell )
ScChangeActionMergeMap aOwnInverseMergeMap;
pSharedDocShell->MergeDocument( *pTmpDoc, true, true, 0, &aOwnInverseMergeMap, true );
delete pTmpDoc;
- ULONG nActStartOwn = nActEndShared + 1;
- ULONG nActEndOwn = pSharedTrack->GetActionMax();
+ sal_uLong nActStartOwn = nActEndShared + 1;
+ sal_uLong nActEndOwn = pSharedTrack->GetActionMax();
// find conflicts
ScConflictsList aConflictsList;
@@ -1291,7 +1291,7 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell )
pThisTrack->Clone( pTmpDoc );
// undo own changes since last save in own document
- ULONG nStartShared = pThisAction->GetActionNumber();
+ sal_uLong nStartShared = pThisAction->GetActionNumber();
ScChangeAction* pAction = pThisTrack->GetLast();
while ( pAction && pAction->GetActionNumber() >= nStartShared )
{
@@ -1305,7 +1305,7 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell )
// merge shared changes into own document
ScChangeActionMergeMap aSharedMergeMap;
MergeDocument( rSharedDoc, true, true, 0, &aSharedMergeMap );
- ULONG nEndShared = pThisTrack->GetActionMax();
+ sal_uLong nEndShared = pThisTrack->GetActionMax();
// resolve conflicts for shared non-content actions
if ( !aConflictsList.empty() )
@@ -1323,18 +1323,18 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell )
nEndShared = pThisTrack->GetActionMax();
// only show changes from shared document
- aChangeViewSet.SetShowChanges( TRUE );
- aChangeViewSet.SetShowAccepted( TRUE );
+ aChangeViewSet.SetShowChanges( sal_True );
+ aChangeViewSet.SetShowAccepted( sal_True );
aChangeViewSet.SetHasActionRange( true );
aChangeViewSet.SetTheActionRange( nStartShared, nEndShared );
aDocument.SetChangeViewSettings( aChangeViewSet );
// merge own changes back into own document
- ULONG nStartOwn = nEndShared + 1;
+ sal_uLong nStartOwn = nEndShared + 1;
ScChangeActionMergeMap aOwnMergeMap;
MergeDocument( *pTmpDoc, true, true, nEndShared - nStartShared + 1, &aOwnMergeMap );
delete pTmpDoc;
- ULONG nEndOwn = pThisTrack->GetActionMax();
+ sal_uLong nEndOwn = pThisTrack->GetActionMax();
// resolve conflicts for shared content actions and own actions
if ( !aConflictsList.empty() )
@@ -1362,13 +1362,13 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell )
else
{
// merge shared changes into own document
- ULONG nStartShared = pThisTrack->GetActionMax() + 1;
+ sal_uLong nStartShared = pThisTrack->GetActionMax() + 1;
MergeDocument( rSharedDoc, true, true );
- ULONG nEndShared = pThisTrack->GetActionMax();
+ sal_uLong nEndShared = pThisTrack->GetActionMax();
// only show changes from shared document
- aChangeViewSet.SetShowChanges( TRUE );
- aChangeViewSet.SetShowAccepted( TRUE );
+ aChangeViewSet.SetShowChanges( sal_True );
+ aChangeViewSet.SetShowAccepted( sal_True );
aChangeViewSet.SetHasActionRange( true );
aChangeViewSet.SetTheActionRange( nStartShared, nEndShared );
aDocument.SetChangeViewSettings( aChangeViewSet );
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index fbf4ab710e73..b4ee37a9e7b7 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -42,7 +42,7 @@ using namespace ::com::sun::star;
#include "scitems.hxx"
#include <sfx2/fcontnr.hxx>
#include <editeng/eeitem.hxx>
-
+#include <sfx2/objface.hxx>
#include <sfx2/app.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/docfile.hxx>
@@ -54,7 +54,6 @@ using namespace ::com::sun::star;
#include <svtools/sfxecode.hxx>
#include <svx/ofaitem.hxx>
#include <sot/formats.hxx>
-#include <svtools/printdlg.hxx>
#include <svl/whiter.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/waitobj.hxx>
@@ -104,6 +103,7 @@ using namespace ::com::sun::star;
#include "chgviset.hxx"
#include "reffact.hxx"
#include "chartlis.hxx"
+#include "chartpos.hxx"
#include "waitoff.hxx"
#include "tablink.hxx" // ScDocumentLoader statics
#include "drwlayer.hxx"
@@ -133,7 +133,7 @@ using namespace ::com::sun::star;
Get(ATTR_PAGE_SHARED)).GetValue()
#define IS_AVAILABLE(WhichId,ppItem) \
- (pReqArgs->GetItemState((WhichId), TRUE, ppItem ) == SFX_ITEM_SET)
+ (pReqArgs->GetItemState((WhichId), sal_True, ppItem ) == SFX_ITEM_SET)
#define SC_PREVIEW_SIZE_X 10000
#define SC_PREVIEW_SIZE_Y 12400
@@ -149,9 +149,9 @@ void ScDocShell::Execute( SfxRequest& rReq )
const SfxItemSet* pReqArgs = rReq.GetArgs();
SfxBindings* pBindings = GetViewBindings();
- BOOL bUndo (aDocument.IsUndoEnabled());
+ sal_Bool bUndo (aDocument.IsUndoEnabled());
- USHORT nSlot = rReq.GetSlot();
+ sal_uInt16 nSlot = rReq.GetSlot();
switch ( nSlot )
{
case SID_SC_SETTEXT:
@@ -206,18 +206,18 @@ void ScDocShell::Execute( SfxRequest& rReq )
const SfxPoolItem* pItem;
String sSbaData, sTarget;
- if ( pReqArgs->GetItemState( nSlot, TRUE, &pItem ) == SFX_ITEM_SET )
+ if ( pReqArgs->GetItemState( nSlot, sal_True, &pItem ) == SFX_ITEM_SET )
sSbaData = ((const SfxStringItem*)pItem)->GetValue();
- if ( pReqArgs->GetItemState( FN_PARAM_1, TRUE, &pItem ) == SFX_ITEM_SET )
+ if ( pReqArgs->GetItemState( FN_PARAM_1, sal_True, &pItem ) == SFX_ITEM_SET )
sTarget = ((const SfxStringItem*)pItem)->GetValue();
- BOOL bIsNewArea = TRUE; // Default TRUE (keine Nachfrage)
- if ( pReqArgs->GetItemState( FN_PARAM_2, TRUE, &pItem ) == SFX_ITEM_SET )
+ sal_Bool bIsNewArea = sal_True; // Default sal_True (keine Nachfrage)
+ if ( pReqArgs->GetItemState( FN_PARAM_2, sal_True, &pItem ) == SFX_ITEM_SET )
bIsNewArea = ((const SfxBoolItem*)pItem)->GetValue();
::com::sun::star::uno::Reference<
::com::sun::star::sdbc::XResultSet > xResultSet;
- if ( pReqArgs->GetItemState( FN_PARAM_3, FALSE, &pItem ) == SFX_ITEM_SET && pItem )
+ if ( pReqArgs->GetItemState( FN_PARAM_3, false, &pItem ) == SFX_ITEM_SET && pItem )
xResultSet.set(((const SfxUsrAnyItem*)pItem)->GetValue(),::com::sun::star::uno::UNO_QUERY);
String sDBName = sSbaData.GetToken(0,cSbaSep); // Datenbankname
@@ -225,7 +225,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
String sTabFlag = sSbaData.GetToken(2,cSbaSep);
String sDBSql = sSbaData.GetToken(3,cSbaSep); // SQL im Klartext
- BYTE nType = ScDbTable; // "0" oder "1"
+ sal_uInt8 nType = ScDbTable; // "0" oder "1"
if ( sTabFlag.EqualsAscii("0") ) // "0" = Query, "1" = Table (Default)
nType = ScDbQuery;
@@ -243,17 +243,17 @@ void ScDocShell::Execute( SfxRequest& rReq )
}
// bei Bedarf neuen Datenbankbereich anlegen
- BOOL bMakeArea = FALSE;
+ sal_Bool bMakeArea = false;
if (bIsNewArea)
{
ScDBCollection* pDBColl = aDocument.GetDBCollection();
- USHORT nDummy;
+ sal_uInt16 nDummy;
if ( !pDBColl || !pDBColl->SearchName( sTarget, nDummy ) )
{
ScAddress aPos;
if ( aPos.Parse( sTarget, &aDocument, aDocument.GetAddressConvention() ) & SCA_VALID )
{
- bMakeArea = TRUE;
+ bMakeArea = sal_True;
if (bUndo)
{
String aStrImport = ScGlobal::GetRscString( STR_UNDO_IMPORTDATA );
@@ -268,7 +268,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
}
// nachfragen, bevor alter DB-Bereich ueberschrieben wird
- BOOL bDo = TRUE;
+ sal_Bool bDo = sal_True;
if (!bIsNewArea)
{
String aTemplate = ScGlobal::GetRscString( STR_IMPORT_REPLACE );
@@ -283,7 +283,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
if (bDo)
{
ScDBDocFunc(*this).UpdateImport( sTarget, sDBName,
- sDBTable, sDBSql, TRUE, nType, xResultSet,
+ sDBTable, sDBSql, sal_True, nType, xResultSet,
pSelectionList );
rReq.Done();
@@ -312,13 +312,13 @@ void ScDocShell::Execute( SfxRequest& rReq )
ScRange aSingleRange;
ScRangeListRef aRangeListRef;
- BOOL bMultiRange = FALSE;
+ sal_Bool bMultiRange = false;
- BOOL bColHeaders = TRUE;
- BOOL bRowHeaders = TRUE;
- BOOL bColInit = FALSE;
- BOOL bRowInit = FALSE;
- BOOL bAddRange = (nSlot == SID_CHART_ADDSOURCE);
+ sal_Bool bColHeaders = sal_True;
+ sal_Bool bRowHeaders = sal_True;
+ sal_Bool bColInit = false;
+ sal_Bool bRowInit = false;
+ sal_Bool bAddRange = (nSlot == SID_CHART_ADDSOURCE);
if( IS_AVAILABLE( SID_CHART_NAME, &pItem ) )
aChartName = ((const SfxStringItem*)pItem)->GetValue();
@@ -329,25 +329,25 @@ void ScDocShell::Execute( SfxRequest& rReq )
if( IS_AVAILABLE( FN_PARAM_1, &pItem ) )
{
bColHeaders = ((const SfxBoolItem*)pItem)->GetValue();
- bColInit = TRUE;
+ bColInit = sal_True;
}
if( IS_AVAILABLE( FN_PARAM_2, &pItem ) )
{
bRowHeaders = ((const SfxBoolItem*)pItem)->GetValue();
- bRowInit = TRUE;
+ bRowInit = sal_True;
}
ScAddress::Details aDetails(pDoc->GetAddressConvention(), 0, 0);
- BOOL bValid = ( aSingleRange.ParseAny( aRangeName, pDoc, aDetails ) & SCA_VALID ) != 0;
+ sal_Bool bValid = ( aSingleRange.ParseAny( aRangeName, pDoc, aDetails ) & SCA_VALID ) != 0;
if (!bValid)
{
aRangeListRef = new ScRangeList;
aRangeListRef->Parse( aRangeName, pDoc );
if ( !aRangeListRef->empty() )
{
- bMultiRange = TRUE;
+ bMultiRange = true;
aSingleRange = *aRangeListRef->front(); // fuer Header
- bValid = TRUE;
+ bValid = true;
}
else
aRangeListRef.Clear();
@@ -369,22 +369,14 @@ void ScDocShell::Execute( SfxRequest& rReq )
aDocument.LimitChartArea( nTab, nCol1,nRow1, nCol2,nRow2 );
// Dialog fuer Spalten/Zeilenkoepfe
- BOOL bOk = TRUE;
+ sal_Bool bOk = sal_True;
if ( !bAddRange && ( !bColInit || !bRowInit ) )
{
- // Spalten/Zeilenkoepfe testen wie in chartarr
+ ScChartPositioner aChartPositioner( &aDocument, nTab, nCol1,nRow1, nCol2,nRow2 );
if (!bColInit)
- {
- for (SCCOL i=nCol1; i<=nCol2 && bColHeaders; i++)
- if (aDocument.HasValueData( i, nRow1, nTab ))
- bColHeaders = FALSE;
- }
+ bColHeaders = aChartPositioner.HasColHeaders();
if (!bRowInit)
- {
- for (SCROW i=nRow1; i<=nRow2 && bRowHeaders; i++)
- if (aDocument.HasValueData( nCol1, i, nTab ))
- bRowHeaders = FALSE;
- }
+ bRowHeaders = aChartPositioner.HasRowHeaders();
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
@@ -400,7 +392,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
rReq.AppendItem(SfxBoolItem(FN_PARAM_2, bRowHeaders));
}
else
- bOk = FALSE;
+ bOk = false;
delete pDlg;
}
@@ -445,9 +437,9 @@ void ScDocShell::Execute( SfxRequest& rReq )
case FID_AUTO_CALC:
{
- BOOL bNewVal;
+ sal_Bool bNewVal;
const SfxPoolItem* pItem;
- if ( pReqArgs && SFX_ITEM_SET == pReqArgs->GetItemState( nSlot, TRUE, &pItem ) )
+ if ( pReqArgs && SFX_ITEM_SET == pReqArgs->GetItemState( nSlot, sal_True, &pItem ) )
bNewVal = ((const SfxBoolItem*)pItem)->GetValue();
else
bNewVal = !aDocument.GetAutoCalc(); // Toggle fuer Menue
@@ -475,7 +467,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
ScLkUpdMode nSet=pDoc->GetLinkMode();
- USHORT nDlgRet=RET_NO;
+ sal_uInt16 nDlgRet=RET_NO;
if(nSet==LM_UNKNOWN)
{
ScAppOptions aAppOptions=SC_MOD()->GetAppOptions();
@@ -518,7 +510,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
// wird nach dem Laden aufgerufen, wenn DB-Bereiche mit
// weggelassenen Daten enthalten sind
- BOOL bDone = FALSE;
+ sal_Bool bDone = false;
ScDBCollection* pDBColl = aDocument.GetDBCollection();
if ((nCanUpdate != com::sun::star::document::UpdateDocMode::NO_UPDATE) &&
@@ -533,7 +525,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
ScGlobal::GetRscString(STR_REIMPORT_AFTER_LOAD) );
if (aBox.Execute() == RET_YES)
{
- for (USHORT i=0; i<pDBColl->GetCount(); i++)
+ for (sal_uInt16 i=0; i<pDBColl->GetCount(); i++)
{
ScDBData* pDBData = (*pDBColl)[i];
if ( pDBData->IsStripData() &&
@@ -547,7 +539,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
ScImportParam aImportParam;
pDBData->GetImportParam( aImportParam );
- BOOL bContinue = pViewSh->ImportData( aImportParam );
+ sal_Bool bContinue = pViewSh->ImportData( aImportParam );
pDBData->SetImportParam( aImportParam );
// markieren (Groesse kann sich geaendert haben)
@@ -568,7 +560,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
}
}
}
- bDone = TRUE;
+ bDone = sal_True;
}
}
}
@@ -609,19 +601,19 @@ void ScDocShell::Execute( SfxRequest& rReq )
if(pDoc!=NULL)
{
// get argument (recorded macro)
- SFX_REQUEST_ARG( rReq, pItem, SfxBoolItem, FID_CHG_RECORD, sal_False );
- BOOL bDo = TRUE;
+ SFX_REQUEST_ARG( rReq, pItem, SfxBoolItem, FID_CHG_RECORD, false );
+ sal_Bool bDo = sal_True;
// xmlsec05/06:
// getting real parent window when called from Security-Options TP
Window* pParent = NULL;
const SfxPoolItem* pParentItem;
- if( pReqArgs && SFX_ITEM_SET == pReqArgs->GetItemState( SID_ATTR_XWINDOW, FALSE, &pParentItem ) )
+ if( pReqArgs && SFX_ITEM_SET == pReqArgs->GetItemState( SID_ATTR_XWINDOW, false, &pParentItem ) )
pParent = ( ( const XWindowItem* ) pParentItem )->GetWindowPtr();
// desired state
ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
- BOOL bActivateTracking = (pChangeTrack == 0); // toggle
+ sal_Bool bActivateTracking = (pChangeTrack == 0); // toggle
if ( pItem )
bActivateTracking = pItem->GetValue(); // from argument
@@ -651,7 +643,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
{
pDoc->StartChangeTracking();
ScChangeViewSettings aChangeViewSet;
- aChangeViewSet.SetShowChanges(TRUE);
+ aChangeViewSet.SetShowChanges(sal_True);
pDoc->SetChangeViewSettings(aChangeViewSet);
}
@@ -661,7 +653,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
// Slots invalidieren
if (pBindings)
- pBindings->InvalidateAll(FALSE);
+ pBindings->InvalidateAll(false);
if ( !pItem )
rReq.AppendItem( SfxBoolItem( FID_CHG_RECORD, bActivateTracking ) );
rReq.Done();
@@ -676,7 +668,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
{
Window* pParent = NULL;
const SfxPoolItem* pParentItem;
- if( pReqArgs && SFX_ITEM_SET == pReqArgs->GetItemState( SID_ATTR_XWINDOW, FALSE, &pParentItem ) )
+ if( pReqArgs && SFX_ITEM_SET == pReqArgs->GetItemState( SID_ATTR_XWINDOW, false, &pParentItem ) )
pParent = ( ( const XWindowItem* ) pParentItem )->GetWindowPtr();
if ( ExecuteChangeProtectionDialog( pParent ) )
{
@@ -691,7 +683,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
case SID_DOCUMENT_MERGE:
case SID_DOCUMENT_COMPARE:
{
- BOOL bDo = TRUE;
+ sal_Bool bDo = sal_True;
ScChangeTrack* pChangeTrack = aDocument.GetChangeTrack();
if ( pChangeTrack && !pImpl->bIgnoreLostRedliningWarning )
{
@@ -701,12 +693,12 @@ void ScDocShell::Execute( SfxRequest& rReq )
WinBits(WB_YES_NO | WB_DEF_NO),
ScGlobal::GetRscString( STR_END_REDLINING ) );
if( aBox.Execute() == RET_YES )
- bDo = ExecuteChangeProtectionDialog( NULL, TRUE );
+ bDo = ExecuteChangeProtectionDialog( NULL, sal_True );
else
- bDo = FALSE;
+ bDo = false;
}
else // merge might reject some actions
- bDo = ExecuteChangeProtectionDialog( NULL, TRUE );
+ bDo = ExecuteChangeProtectionDialog( NULL, sal_True );
}
if ( !bDo )
{
@@ -717,25 +709,25 @@ void ScDocShell::Execute( SfxRequest& rReq )
const SfxPoolItem* pItem;
SfxMedium* pMed = NULL;
if ( pReqArgs &&
- pReqArgs->GetItemState( SID_FILE_NAME, TRUE, &pItem ) == SFX_ITEM_SET &&
+ pReqArgs->GetItemState( SID_FILE_NAME, sal_True, &pItem ) == SFX_ITEM_SET &&
pItem->ISA(SfxStringItem) )
{
String aFileName = ((const SfxStringItem*)pItem)->GetValue();
String aFilterName;
- if ( pReqArgs->GetItemState( SID_FILTER_NAME, TRUE, &pItem ) == SFX_ITEM_SET &&
+ if ( pReqArgs->GetItemState( SID_FILTER_NAME, sal_True, &pItem ) == SFX_ITEM_SET &&
pItem->ISA(SfxStringItem) )
{
aFilterName = ((const SfxStringItem*)pItem)->GetValue();
}
String aOptions;
- if ( pReqArgs->GetItemState( SID_FILE_FILTEROPTIONS, TRUE, &pItem ) == SFX_ITEM_SET &&
+ if ( pReqArgs->GetItemState( SID_FILE_FILTEROPTIONS, sal_True, &pItem ) == SFX_ITEM_SET &&
pItem->ISA(SfxStringItem) )
{
aOptions = ((const SfxStringItem*)pItem)->GetValue();
}
short nVersion = 0;
- if ( pReqArgs->GetItemState( SID_VERSION, TRUE, &pItem ) == SFX_ITEM_SET &&
+ if ( pReqArgs->GetItemState( SID_VERSION, sal_True, &pItem ) == SFX_ITEM_SET &&
pItem->ISA(SfxInt16Item) )
{
nVersion = ((const SfxInt16Item*)pItem)->GetValue();
@@ -743,7 +735,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
// kein Filter angegeben -> Detection
if ( !aFilterName.Len() )
- ScDocumentLoader::GetFilterName( aFileName, aFilterName, aOptions, TRUE, FALSE );
+ ScDocumentLoader::GetFilterName( aFileName, aFilterName, aOptions, sal_True, false );
// filter name from dialog contains application prefix,
// GetFilter needs name without the prefix.
@@ -755,7 +747,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
pSet->Put( SfxStringItem( SID_FILE_FILTEROPTIONS, aOptions ) );
if ( nVersion != 0 )
pSet->Put( SfxInt16Item( SID_VERSION, nVersion ) );
- pMed = new SfxMedium( aFileName, STREAM_STD_READ, FALSE, pFilter, pSet );
+ pMed = new SfxMedium( aFileName, STREAM_STD_READ, false, pFilter, pSet );
}
else
{
@@ -774,17 +766,18 @@ void ScDocShell::Execute( SfxRequest& rReq )
{
SfxErrorContext aEc( ERRCTX_SFX_OPENDOC, pMed->GetName() );
+ // pOtherDocSh->DoClose() will be called explicitly later, but it is still more safe to use SfxObjectShellLock here
ScDocShell* pOtherDocSh = new ScDocShell;
- SfxObjectShellRef aDocShTablesRef = pOtherDocSh;
+ SfxObjectShellLock aDocShTablesRef = pOtherDocSh;
pOtherDocSh->DoLoad( pMed );
- ULONG nErr = pOtherDocSh->GetErrorCode();
+ sal_uLong nErr = pOtherDocSh->GetErrorCode();
if (nErr)
ErrorHandler::HandleError( nErr ); // auch Warnings
if ( !pOtherDocSh->GetError() ) // nur Errors
{
- BOOL bHadTrack = ( aDocument.GetChangeTrack() != NULL );
- ULONG nStart = 0;
+ sal_Bool bHadTrack = ( aDocument.GetChangeTrack() != NULL );
+ sal_uLong nStart = 0;
if ( nSlot == SID_DOCUMENT_MERGE && pChangeTrack )
{
nStart = pChangeTrack->GetActionMax() + 1;
@@ -802,7 +795,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
SfxViewFrame* pViewFrm = SfxViewFrame::Current();
if ( pViewFrm )
{
- pViewFrm->ShowChildWindow( ScAcceptChgDlgWrapper::GetChildWindowId(), TRUE ); //@51669
+ pViewFrm->ShowChildWindow( ScAcceptChgDlgWrapper::GetChildWindowId(), sal_True ); //@51669
}
if ( pBindings )
{
@@ -819,19 +812,19 @@ void ScDocShell::Execute( SfxRequest& rReq )
if ( !pOldSet || !pOldSet->ShowChanges() )
{
ScChangeViewSettings aChangeViewSet;
- aChangeViewSet.SetShowChanges(TRUE);
+ aChangeViewSet.SetShowChanges(sal_True);
aDocument.SetChangeViewSettings(aChangeViewSet);
}
}
else if ( nSlot == SID_DOCUMENT_MERGE && IsDocShared() && pChangeTrack )
{
- ULONG nEnd = pChangeTrack->GetActionMax();
+ sal_uLong nEnd = pChangeTrack->GetActionMax();
if ( nEnd >= nStart )
{
// only show changes from merged document
ScChangeViewSettings aChangeViewSet;
- aChangeViewSet.SetShowChanges( TRUE );
- aChangeViewSet.SetShowAccepted( TRUE );
+ aChangeViewSet.SetShowChanges( sal_True );
+ aChangeViewSet.SetShowAccepted( sal_True );
aChangeViewSet.SetHasActionRange( true );
aChangeViewSet.SetTheActionRange( nStart, nEnd );
aDocument.SetChangeViewSettings( aChangeViewSet );
@@ -851,7 +844,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
if (pReqArgs)
{
const SfxPoolItem* pItem;
- if ( pReqArgs->GetItemState( nSlot, TRUE, &pItem ) == SFX_ITEM_SET )
+ if ( pReqArgs->GetItemState( nSlot, sal_True, &pItem ) == SFX_ITEM_SET )
{
if ( pItem->ISA(SfxStringItem) )
{
@@ -879,7 +872,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
case SID_EDIT_SCENARIO:
{
const SfxPoolItem* pItem;
- if ( pReqArgs->GetItemState( nSlot, TRUE, &pItem ) == SFX_ITEM_SET )
+ if ( pReqArgs->GetItemState( nSlot, sal_True, &pItem ) == SFX_ITEM_SET )
{
if ( pItem->ISA(SfxStringItem) )
{
@@ -891,7 +884,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
{
String aComment;
Color aColor;
- USHORT nFlags;
+ sal_uInt16 nFlags;
aDocument.GetScenarioData( nTab, aComment, aColor, nFlags );
// Determine if the Sheet that the Scenario was created on
@@ -903,12 +896,12 @@ void ScDocShell::Execute( SfxRequest& rReq )
nActualTab--;
}
while(aDocument.IsScenario(nActualTab));
- BOOL bSheetProtected = aDocument.IsTabProtected(nActualTab);
+ sal_Bool bSheetProtected = aDocument.IsTabProtected(nActualTab);
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
- AbstractScNewScenarioDlg* pNewDlg = pFact->CreateScNewScenarioDlg( GetActiveDialogParent(), aName, RID_SCDLG_NEWSCENARIO, TRUE,bSheetProtected);
+ AbstractScNewScenarioDlg* pNewDlg = pFact->CreateScNewScenarioDlg( GetActiveDialogParent(), aName, RID_SCDLG_NEWSCENARIO, true,bSheetProtected);
DBG_ASSERT(pNewDlg, "Dialog create fail!");
pNewDlg->SetScenarioData( aName, aComment, aColor, nFlags );
if ( pNewDlg->Execute() == RET_OK )
@@ -928,11 +921,11 @@ void ScDocShell::Execute( SfxRequest& rReq )
case SID_ATTR_YEAR2000 :
{
const SfxPoolItem* pItem;
- if ( pReqArgs->GetItemState( nSlot, TRUE, &pItem ) == SFX_ITEM_SET )
+ if ( pReqArgs->GetItemState( nSlot, sal_True, &pItem ) == SFX_ITEM_SET )
{
if ( pItem->ISA(SfxUInt16Item) )
{
- UINT16 nY2k = ((SfxUInt16Item*)pItem)->GetValue();
+ sal_uInt16 nY2k = ((SfxUInt16Item*)pItem)->GetValue();
// immer an den DocOptions setzen, damit das auch fuer SO50
// gespeichert wird (und alle Abfragen bisher auch darauf laufen).
// SetDocOptions propagiert das an den NumberFormatter
@@ -1075,7 +1068,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
{
xCloseable->close( sal_True );
- if ( !SwitchToShared( sal_False, sal_True ) )
+ if ( !SwitchToShared( false, sal_True ) )
{
// TODO/LATER: what should be done in case the switch has failed?
// for example in case the user has cancelled the saveAs operation
@@ -1159,15 +1152,15 @@ void UpdateAcceptChangesDialog()
//------------------------------------------------------------------
-BOOL ScDocShell::ExecuteChangeProtectionDialog( Window* _pParent, BOOL bJustQueryIfProtected )
+sal_Bool ScDocShell::ExecuteChangeProtectionDialog( Window* _pParent, sal_Bool bJustQueryIfProtected )
{
- BOOL bDone = FALSE;
+ sal_Bool bDone = false;
ScChangeTrack* pChangeTrack = aDocument.GetChangeTrack();
if ( pChangeTrack )
{
- BOOL bProtected = pChangeTrack->IsProtected();
+ sal_Bool bProtected = pChangeTrack->IsProtected();
if ( bJustQueryIfProtected && !bProtected )
- return TRUE;
+ return sal_True;
String aTitle( ScResId( bProtected ? SCSTR_CHG_UNPROTECT : SCSTR_CHG_PROTECT ) );
String aText( ScResId( SCSTR_PASSWORD ) );
@@ -1177,7 +1170,7 @@ BOOL ScDocShell::ExecuteChangeProtectionDialog( Window* _pParent, BOOL bJustQuer
_pParent ? _pParent : GetActiveDialogParent(), &aText );
pDlg->SetText( aTitle );
pDlg->SetMinLen( 1 );
- pDlg->SetHelpId( SID_CHG_PROTECT );
+ pDlg->SetHelpId( GetStaticInterface()->GetSlot(SID_CHG_PROTECT)->GetCommand() );
pDlg->SetEditHelpId( HID_CHG_PROTECT );
if ( !bProtected )
pDlg->ShowExtras( SHOWEXTRAS_CONFIRM );
@@ -1192,7 +1185,7 @@ BOOL ScDocShell::ExecuteChangeProtectionDialog( Window* _pParent, BOOL bJustQuer
if ( SvPasswordHelper::CompareHashPassword(pChangeTrack->GetProtection(), aPassword) )
{
if ( bJustQueryIfProtected )
- bDone = TRUE;
+ bDone = sal_True;
else
pChangeTrack->SetProtection(
com::sun::star::uno::Sequence< sal_Int8 > (0) );
@@ -1213,21 +1206,21 @@ BOOL ScDocShell::ExecuteChangeProtectionDialog( Window* _pParent, BOOL bJustQuer
if ( bProtected != pChangeTrack->IsProtected() )
{
UpdateAcceptChangesDialog();
- bDone = TRUE;
+ bDone = sal_True;
}
}
}
else if ( bJustQueryIfProtected )
- bDone = TRUE;
+ bDone = sal_True;
return bDone;
}
//------------------------------------------------------------------
-void ScDocShell::DoRecalc( BOOL bApi )
+void ScDocShell::DoRecalc( sal_Bool bApi )
{
- BOOL bDone = FALSE;
+ sal_Bool bDone = false;
ScTabViewShell* pSh = GetBestViewShell();
if ( pSh )
{
@@ -1235,7 +1228,7 @@ void ScDocShell::DoRecalc( BOOL bApi )
if ( pHdl && pHdl->IsInputMode() && pHdl->IsFormulaMode() && !bApi )
{
pHdl->FormulaPreview(); // Teilergebnis als QuickHelp
- bDone = TRUE;
+ bDone = sal_True;
}
else
{
@@ -1248,7 +1241,7 @@ void ScDocShell::DoRecalc( BOOL bApi )
WaitObject aWaitObj( GetActiveDialogParent() );
aDocument.CalcFormulaTree();
if ( pSh )
- pSh->UpdateCharts(TRUE);
+ pSh->UpdateCharts(sal_True);
aDocument.BroadcastUno( SfxSimpleHint( SFX_HINT_DATACHANGED ) );
@@ -1264,7 +1257,7 @@ void ScDocShell::DoRecalc( BOOL bApi )
}
}
-void ScDocShell::DoHardRecalc( BOOL /* bApi */ )
+void ScDocShell::DoHardRecalc( sal_Bool /* bApi */ )
{
WaitObject aWaitObj( GetActiveDialogParent() );
ScTabViewShell* pSh = GetBestViewShell();
@@ -1276,7 +1269,7 @@ void ScDocShell::DoHardRecalc( BOOL /* bApi */ )
aDocument.CalcAll();
GetDocFunc().DetectiveRefresh(); // erzeugt eigenes Undo
if ( pSh )
- pSh->UpdateCharts(TRUE);
+ pSh->UpdateCharts(sal_True);
// set notification flags for "calculate" event (used in SFX_HINT_DATACHANGED broadcast)
// (might check for the presence of any formulas on each sheet)
@@ -1295,7 +1288,7 @@ void ScDocShell::DoHardRecalc( BOOL /* bApi */ )
// (somewhat consistent with charts)
for (nTab=0; nTab<nTabCount; nTab++)
if (aDocument.IsStreamValid(nTab))
- aDocument.SetStreamValid(nTab, FALSE);
+ aDocument.SetStreamValid(nTab, false);
PostPaintGridAll();
}
@@ -1329,7 +1322,7 @@ void ScDocShell::DoAutoStyle( const ScRange& rRange, const String& rStyle )
void ScDocShell::NotifyStyle( const SfxStyleSheetHint& rHint )
{
- USHORT nId = rHint.GetHint();
+ sal_uInt16 nId = rHint.GetHint();
const SfxStyleSheetBase* pStyle = rHint.GetStyleSheet();
if (!pStyle)
return;
@@ -1342,7 +1335,7 @@ void ScDocShell::NotifyStyle( const SfxStyleSheetHint& rHint )
String aNewName = pStyle->GetName();
String aOldName = aNewName;
- BOOL bExtended = rHint.ISA(SfxStyleSheetHintExtended); // Name geaendert?
+ sal_Bool bExtended = rHint.ISA(SfxStyleSheetHintExtended); // Name geaendert?
if (bExtended)
aOldName = ((SfxStyleSheetHintExtended&)rHint).GetOldName();
@@ -1380,7 +1373,7 @@ void ScDocShell::NotifyStyle( const SfxStyleSheetHint& rHint )
{
String aNewName = pStyle->GetName();
String aOldName = aNewName;
- BOOL bExtended = rHint.ISA(SfxStyleSheetHintExtended);
+ sal_Bool bExtended = rHint.ISA(SfxStyleSheetHintExtended);
if (bExtended)
aOldName = ((SfxStyleSheetHintExtended&)rHint).GetOldName();
if ( aNewName != aOldName )
@@ -1398,9 +1391,9 @@ void ScDocShell::NotifyStyle( const SfxStyleSheetHint& rHint )
// wie in printfun.cxx
#define ZOOM_MIN 10
-void ScDocShell::SetPrintZoom( SCTAB nTab, USHORT nScale, USHORT nPages )
+void ScDocShell::SetPrintZoom( SCTAB nTab, sal_uInt16 nScale, sal_uInt16 nPages )
{
- BOOL bUndo(aDocument.IsUndoEnabled());
+ sal_Bool bUndo(aDocument.IsUndoEnabled());
String aStyleName = aDocument.GetPageStyle( nTab );
ScStyleSheetPool* pStylePool = aDocument.GetStyleSheetPool();
SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aStyleName, SFX_STYLE_FAMILY_PAGE );
@@ -1412,8 +1405,8 @@ void ScDocShell::SetPrintZoom( SCTAB nTab, USHORT nScale, USHORT nPages )
SfxItemSet& rSet = pStyleSheet->GetItemSet();
if (bUndo)
{
- USHORT nOldScale = ((const SfxUInt16Item&)rSet.Get(ATTR_PAGE_SCALE)).GetValue();
- USHORT nOldPages = ((const SfxUInt16Item&)rSet.Get(ATTR_PAGE_SCALETOPAGES)).GetValue();
+ sal_uInt16 nOldScale = ((const SfxUInt16Item&)rSet.Get(ATTR_PAGE_SCALE)).GetValue();
+ sal_uInt16 nOldPages = ((const SfxUInt16Item&)rSet.Get(ATTR_PAGE_SCALETOPAGES)).GetValue();
GetUndoManager()->AddUndoAction( new ScUndoPrintZoom(
this, nTab, nOldScale, nOldPages, nScale, nPages ) );
}
@@ -1431,9 +1424,9 @@ void ScDocShell::SetPrintZoom( SCTAB nTab, USHORT nScale, USHORT nPages )
}
}
-BOOL ScDocShell::AdjustPrintZoom( const ScRange& rRange )
+sal_Bool ScDocShell::AdjustPrintZoom( const ScRange& rRange )
{
- BOOL bChange = FALSE;
+ sal_Bool bChange = false;
SCTAB nTab = rRange.aStart.Tab();
String aStyleName = aDocument.GetPageStyle( nTab );
@@ -1443,15 +1436,15 @@ BOOL ScDocShell::AdjustPrintZoom( const ScRange& rRange )
if ( pStyleSheet )
{
SfxItemSet& rSet = pStyleSheet->GetItemSet();
- BOOL bHeaders = ((const SfxBoolItem&)rSet.Get(ATTR_PAGE_HEADERS)).GetValue();
- USHORT nOldScale = ((const SfxUInt16Item&)rSet.Get(ATTR_PAGE_SCALE)).GetValue();
- USHORT nOldPages = ((const SfxUInt16Item&)rSet.Get(ATTR_PAGE_SCALETOPAGES)).GetValue();
+ sal_Bool bHeaders = ((const SfxBoolItem&)rSet.Get(ATTR_PAGE_HEADERS)).GetValue();
+ sal_uInt16 nOldScale = ((const SfxUInt16Item&)rSet.Get(ATTR_PAGE_SCALE)).GetValue();
+ sal_uInt16 nOldPages = ((const SfxUInt16Item&)rSet.Get(ATTR_PAGE_SCALETOPAGES)).GetValue();
const ScRange* pRepeatCol = aDocument.GetRepeatColRange( nTab );
const ScRange* pRepeatRow = aDocument.GetRepeatRowRange( nTab );
// benoetigte Skalierung fuer Selektion ausrechnen
- USHORT nNewScale = nOldScale;
+ sal_uInt16 nNewScale = nOldScale;
long nBlkTwipsX = 0;
if (bHeaders)
@@ -1501,7 +1494,7 @@ BOOL ScDocShell::AdjustPrintZoom( const ScRange& rRange )
if ( nNeeded < ZOOM_MIN )
nNeeded = ZOOM_MIN; // Begrenzung
if ( nNeeded < (long) nNewScale )
- nNewScale = (USHORT) nNeeded;
+ nNewScale = (sal_uInt16) nNeeded;
bChange = ( nNewScale != nOldScale || nOldPages != 0 );
if ( bChange )
@@ -1510,11 +1503,11 @@ BOOL ScDocShell::AdjustPrintZoom( const ScRange& rRange )
return bChange;
}
-void ScDocShell::PageStyleModified( const String& rStyleName, BOOL bApi )
+void ScDocShell::PageStyleModified( const String& rStyleName, sal_Bool bApi )
{
ScDocShellModificator aModificator( *this );
- BOOL bWarn = FALSE;
+ sal_Bool bWarn = false;
SCTAB nTabCount = aDocument.GetTableCount();
SCTAB nUseTab = MAXTAB+1;
@@ -1528,7 +1521,7 @@ void ScDocShell::PageStyleModified( const String& rStyleName, BOOL bApi )
{
ScPrintFunc aPrintFunc( this, GetPrinter(), nUseTab ); //! ohne CountPages auskommen
if (!aPrintFunc.UpdatePages()) // setzt Umbrueche auf allen Tabs
- bWarn = TRUE;
+ bWarn = sal_True;
if (bWarn && !bApi)
{
@@ -1566,7 +1559,7 @@ void ScDocShell::ExecutePageStyle( SfxViewShell& rCaller,
}
else if ( pReqArgs == NULL )
{
- BOOL bUndo(aDocument.IsUndoEnabled());
+ sal_Bool bUndo(aDocument.IsUndoEnabled());
String aOldName = aDocument.GetPageStyle( nCurTab );
ScStyleSheetPool* pStylePool = aDocument.GetStyleSheetPool();
SfxStyleSheetBase* pStyleSheet
@@ -1622,7 +1615,7 @@ void ScDocShell::ExecutePageStyle( SfxViewShell& rCaller,
aOldData, aNewData ) );
}
- PageStyleModified( aNewName, FALSE );
+ PageStyleModified( aNewName, false );
rReq.Done();
}
delete pDlg;
@@ -1658,9 +1651,9 @@ void ScDocShell::ExecutePageStyle( SfxViewShell& rCaller,
SvxPageUsage( ((const SvxPageItem&)
rStyleSet.Get( ATTR_PAGE )).
GetPageUsage() );
- BOOL bShareHeader = IS_SHARE_HEADER(rStyleSet);
- BOOL bShareFooter = IS_SHARE_FOOTER(rStyleSet);
- USHORT nResId = 0;
+ sal_Bool bShareHeader = IS_SHARE_HEADER(rStyleSet);
+ sal_Bool bShareFooter = IS_SHARE_FOOTER(rStyleSet);
+ sal_uInt16 nResId = 0;
switch ( eUsage )
{
@@ -1772,7 +1765,7 @@ void ScDocShell::GetStatePageStyle( SfxViewShell& /* rCaller */,
SCTAB nCurTab )
{
SfxWhichIter aIter(rSet);
- USHORT nWhich = aIter.FirstWhich();
+ sal_uInt16 nWhich = aIter.FirstWhich();
while ( nWhich )
{
switch (nWhich)
@@ -1817,7 +1810,7 @@ void lcl_GetPrintData( ScDocShell* pDocShell /*in*/,
// get settings from print options sub-dialog
const SfxItemSet& rOptionSet = pPrinter->GetOptions();
const SfxPoolItem* pItem;
- rbHasOptions = ( rOptionSet.GetItemState( SID_SCPRINTOPTIONS, FALSE, &pItem ) == SFX_ITEM_SET );
+ rbHasOptions = ( rOptionSet.GetItemState( SID_SCPRINTOPTIONS, false, &pItem ) == SFX_ITEM_SET );
if ( rbHasOptions )
{
rOptions = ((const ScTpPrintItem*)pItem)->GetPrintOptions();
@@ -1955,7 +1948,7 @@ void ScDocShell::PreparePrint( PrintDialog* pPrintDialog, ScMarkData* pMarkData
pMarkData, bHasOptions, aOptions, bAllTabs, nTotalPages,
aPageArr, aPageRanges, &pMarkedRange );
- BOOL bFound = FALSE; // erste Seite gefunden
+ sal_Bool bFound = false; // erste Seite gefunden
long nTabStart = 0;
SCTAB nTabCount = aDocument.GetTableCount();
for ( SCTAB nTab=0; nTab<nTabCount && !bFound; nTab++ )
@@ -1963,17 +1956,17 @@ void ScDocShell::PreparePrint( PrintDialog* pPrintDialog, ScMarkData* pMarkData
if ( bAllTabs || !pMarkData || pMarkData->GetTableSelect( nTab ) )
{
long nNext = nTabStart + aPageArr[nTab];
- BOOL bSelected = FALSE;
+ sal_Bool bSelected = false;
for (long nP=nTabStart+1; nP<=nNext; nP++) // 1-basiert
if (aPageRanges.IsSelected( nP )) // eine Seite von dieser Tabelle selektiert?
- bSelected = TRUE;
+ bSelected = true;
if (bSelected)
{
ScPrintFunc aPrintFunc( this, pPrinter, nTab );
aPrintFunc.ApplyPrintSettings(); // dann Settings fuer diese Tabelle
- bFound = TRUE;
+ bFound = true;
}
nTabStart = nNext;
}
@@ -1982,9 +1975,9 @@ void ScDocShell::PreparePrint( PrintDialog* pPrintDialog, ScMarkData* pMarkData
delete pMarkedRange;
}
-BOOL lcl_HasTransparent( ScDocument* pDoc, SCTAB nTab, const ScRange* pRange )
+sal_Bool lcl_HasTransparent( ScDocument* pDoc, SCTAB nTab, const ScRange* pRange )
{
- BOOL bFound = FALSE;
+ sal_Bool bFound = false;
ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
if (pDrawLayer)
{
@@ -2007,10 +2000,10 @@ BOOL lcl_HasTransparent( ScDocument* pDoc, SCTAB nTab, const ScRange* pRange )
{
Rectangle aObjRect = pObject->GetLogicRect();
if ( aObjRect.IsOver( aMMRect ) )
- bFound = TRUE;
+ bFound = true;
}
else
- bFound = TRUE;
+ bFound = true;
}
pObject = aIter.Next();
@@ -2022,7 +2015,7 @@ BOOL lcl_HasTransparent( ScDocument* pDoc, SCTAB nTab, const ScRange* pRange )
}
void ScDocShell::Print( SfxProgress& rProgress, PrintDialog* pPrintDialog,
- ScMarkData* pMarkData, Window* pDialogParent, BOOL bForceSelected, BOOL bIsAPI )
+ ScMarkData* pMarkData, Window* pDialogParent, sal_Bool bForceSelected, sal_Bool bIsAPI )
{
SfxPrinter* pPrinter = GetPrinter();
if ( !pPrinter )
@@ -2042,14 +2035,14 @@ void ScDocShell::Print( SfxProgress& rProgress, PrintDialog* pPrintDialog,
pMarkData, bHasOptions, aOptions, bAllTabs, nTotalPages,
aPageArr, aPageRanges, &pMarkedRange );
- USHORT nCollateCopies = 1;
+ sal_uInt16 nCollateCopies = 1;
if ( pPrintDialog && pPrintDialog->IsCollateEnabled() && pPrintDialog->IsCollateChecked() )
nCollateCopies = pPrintDialog->GetCopyCount();
// test if printed range contains transparent objects
- BOOL bHasTransp = FALSE;
- BOOL bAnyPrintRanges = aDocument.HasPrintRange();
+ sal_Bool bHasTransp = false;
+ sal_Bool bAnyPrintRanges = aDocument.HasPrintRange();
ScStyleSheetPool* pStylePool = aDocument.GetStyleSheetPool();
SCTAB nTabCount = aDocument.GetTableCount();
for ( SCTAB nTab=0; nTab<nTabCount && !bHasTransp; nTab++ )
@@ -2069,8 +2062,8 @@ void ScDocShell::Print( SfxProgress& rProgress, PrintDialog* pPrintDialog,
bHasTransp = bHasTransp || lcl_HasTransparent( &aDocument, nTab, pMarkedRange );
else if ( aDocument.GetPrintRangeCount(nTab) )
{
- USHORT nRangeCount = aDocument.GetPrintRangeCount(nTab);
- for (USHORT i=0; i<nRangeCount; i++)
+ sal_uInt16 nRangeCount = aDocument.GetPrintRangeCount(nTab);
+ for (sal_uInt16 i=0; i<nRangeCount; i++)
bHasTransp = bHasTransp ||
lcl_HasTransparent( &aDocument, nTab, aDocument.GetPrintRange( nTab, i ) );
}
@@ -2081,11 +2074,11 @@ void ScDocShell::Print( SfxProgress& rProgress, PrintDialog* pPrintDialog,
}
}
- BOOL bContinue = pPrinter->InitJob( pDialogParent, !bIsAPI && bHasTransp );
+ sal_Bool bContinue = pPrinter->InitJob( pDialogParent, !bIsAPI && bHasTransp );
if ( bContinue )
{
- for ( USHORT n=0; n<nCollateCopies; n++ )
+ for ( sal_uInt16 n=0; n<nCollateCopies; n++ )
{
long nTabStart = 0;
long nDisplayStart = 0;
@@ -2105,12 +2098,12 @@ void ScDocShell::Print( SfxProgress& rProgress, PrintDialog* pPrintDialog,
{
pDrawView = new FmFormView( pModel, pPrinter );
pDrawView->ShowSdrPage(pDrawView->GetModel()->GetPage(nTab));
- pDrawView->SetPrintPreview( TRUE );
+ pDrawView->SetPrintPreview( true );
}
ScPrintFunc aPrintFunc( this, pPrinter, nTab, nAttrPage, nTotalPages, pMarkedRange, &aOptions );
aPrintFunc.SetDrawView( pDrawView );
- aPrintFunc.DoPrint( aPageRanges, nTabStart, nDisplayStart, TRUE, &rProgress, NULL );
+ aPrintFunc.DoPrint( aPageRanges, nTabStart, nDisplayStart, true, &rProgress, NULL );
nTabStart += aPageArr[nTab];
if ( aDocument.NeedPageResetAfterTab(nTab) )
@@ -2159,13 +2152,13 @@ void ScDocShell::Print( SfxProgress& rProgress, PrintDialog* pPrintDialog,
void ScDocShell::GetState( SfxItemSet &rSet )
{
SfxWhichIter aIter(rSet);
- USHORT nWhich = aIter.FirstWhich();
+ sal_uInt16 nWhich = aIter.FirstWhich();
while ( nWhich )
{
switch (nWhich)
{
case FID_AUTO_CALC:
- if ( (BOOL) aDocument.GetHardRecalcState() )
+ if ( (sal_Bool) aDocument.GetHardRecalcState() )
rSet.DisableItem( nWhich );
else
rSet.Put( SfxBoolItem( nWhich, aDocument.GetAutoCalc() ) );
@@ -2249,14 +2242,14 @@ void ScDocShell::GetSbxState( SfxItemSet &rSet )
pVisibleSh->GetState( rSet );
}
-void ScDocShell::Draw( OutputDevice* pDev, const JobSetup & /* rSetup */, USHORT nAspect )
+void ScDocShell::Draw( OutputDevice* pDev, const JobSetup & /* rSetup */, sal_uInt16 nAspect )
{
SCTAB nVisTab = aDocument.GetVisibleTab();
if (!aDocument.HasTable(nVisTab))
return;
- ULONG nOldLayoutMode = pDev->GetLayoutMode();
+ sal_uLong nOldLayoutMode = pDev->GetLayoutMode();
pDev->SetLayoutMode( TEXT_LAYOUT_DEFAULT ); // even if it's the same, to get the metafile action
if ( nAspect == ASPECT_THUMBNAIL )
@@ -2266,7 +2259,7 @@ void ScDocShell::Draw( OutputDevice* pDev, const JobSetup & /* rSetup */, USHORT
aTmpData.SetTabNo(nVisTab);
aDocument.SnapVisArea( aBoundRect );
aTmpData.SetScreen( aBoundRect );
- ScPrintFunc::DrawToDev( &aDocument, pDev, 1.0, aBoundRect, &aTmpData, TRUE );
+ ScPrintFunc::DrawToDev( &aDocument, pDev, 1.0, aBoundRect, &aTmpData, sal_True );
}
else
{
@@ -2275,13 +2268,13 @@ void ScDocShell::Draw( OutputDevice* pDev, const JobSetup & /* rSetup */, USHORT
aTmpData.SetTabNo(nVisTab);
aDocument.SnapVisArea( aBoundRect );
aTmpData.SetScreen( aBoundRect );
- ScPrintFunc::DrawToDev( &aDocument, pDev, 1.0, aBoundRect, &aTmpData, TRUE );
+ ScPrintFunc::DrawToDev( &aDocument, pDev, 1.0, aBoundRect, &aTmpData, sal_True );
}
pDev->SetLayoutMode( nOldLayoutMode );
}
-Rectangle ScDocShell::GetVisArea( USHORT nAspect ) const
+Rectangle ScDocShell::GetVisArea( sal_uInt16 nAspect ) const
{
SfxObjectCreateMode eShellMode = GetCreateMode();
if ( eShellMode == SFX_CREATE_MODE_ORGANIZER )
@@ -2294,7 +2287,7 @@ Rectangle ScDocShell::GetVisArea( USHORT nAspect ) const
if( nAspect == ASPECT_THUMBNAIL )
{
Rectangle aArea( 0,0, SC_PREVIEW_SIZE_X,SC_PREVIEW_SIZE_Y );
- BOOL bNegativePage = aDocument.IsNegativePage( aDocument.GetVisibleTab() );
+ sal_Bool bNegativePage = aDocument.IsNegativePage( aDocument.GetVisibleTab() );
if ( bNegativePage )
ScDrawLayer::MirrorRectRTL( aArea );
aDocument.SnapVisArea( aArea );
@@ -2332,8 +2325,8 @@ Rectangle ScDocShell::GetVisArea( USHORT nAspect ) const
void ScDocShell::GetPageOnFromPageStyleSet( const SfxItemSet* pStyleSet,
SCTAB nCurTab,
- BOOL& rbHeader,
- BOOL& rbFooter )
+ sal_Bool& rbHeader,
+ sal_Bool& rbFooter )
{
if ( !pStyleSet )
{
@@ -2347,7 +2340,7 @@ void ScDocShell::GetPageOnFromPageStyleSet( const SfxItemSet* pStyleSet,
if ( pStyleSheet )
pStyleSet = &pStyleSheet->GetItemSet();
else
- rbHeader = rbFooter = FALSE;
+ rbHeader = rbFooter = false;
}
DBG_ASSERT( pStyleSet, "PageStyle-Set not found! :-(" );
@@ -2385,7 +2378,7 @@ long ScDocShell::DdeGetData( const String& rItem,
return 0; // ungueltiger Bereich
if( aDdeTextFmt.GetChar(0) == 'F' )
- aObj.SetFormulas( TRUE );
+ aObj.SetFormulas( sal_True );
if( aDdeTextFmt.EqualsAscii( "SYLK" ) ||
aDdeTextFmt.EqualsAscii( "FSYLK" ) )
{
@@ -2432,7 +2425,7 @@ long ScDocShell::DdeSetData( const String& rItem,
}
ScImportExport aObj( &aDocument, rItem );
if( aDdeTextFmt.GetChar(0) == 'F' )
- aObj.SetFormulas( TRUE );
+ aObj.SetFormulas( sal_True );
if( aDdeTextFmt.EqualsAscii( "SYLK" ) ||
aDdeTextFmt.EqualsAscii( "FSYLK" ) )
{
@@ -2510,7 +2503,7 @@ SCTAB ScDocShell::GetCurTab()
return pViewData ? pViewData->GetTabNo() : static_cast<SCTAB>(0);
}
-ScTabViewShell* ScDocShell::GetBestViewShell( BOOL bOnlyVisible )
+ScTabViewShell* ScDocShell::GetBestViewShell( sal_Bool bOnlyVisible )
{
ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
// falsches Doc?
@@ -2542,11 +2535,11 @@ SfxBindings* ScDocShell::GetViewBindings()
//------------------------------------------------------------------
-ScDocShell* ScDocShell::GetShellByNum( USHORT nDocNo ) // static
+ScDocShell* ScDocShell::GetShellByNum( sal_uInt16 nDocNo ) // static
{
ScDocShell* pFound = NULL;
SfxObjectShell* pShell = SfxObjectShell::GetFirst();
- USHORT nShellCnt = 0;
+ sal_uInt16 nShellCnt = 0;
while ( pShell && !pFound )
{
@@ -2572,7 +2565,7 @@ IMPL_LINK( ScDocShell, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg )
if ( ERRCODE_NONE == _pFileDlg->GetError() )
{
- USHORT nSlot = pImpl->pRequest->GetSlot();
+ sal_uInt16 nSlot = pImpl->pRequest->GetSlot();
SfxMedium* pMed = pImpl->pDocInserter->CreateMedium();
// #i87094# If a .odt was selected pMed is NULL.
if (pMed)
@@ -2590,7 +2583,7 @@ IMPL_LINK( ScDocShell, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg )
const SfxPoolItem* pItem = NULL;
SfxItemSet* pSet = pMed->GetItemSet();
if ( pSet &&
- pSet->GetItemState( SID_VERSION, TRUE, &pItem ) == SFX_ITEM_SET &&
+ pSet->GetItemState( SID_VERSION, sal_True, &pItem ) == SFX_ITEM_SET &&
pItem->ISA( SfxInt16Item ) )
{
pImpl->pRequest->AppendItem( *pItem );
@@ -2616,7 +2609,7 @@ void ScDocShell::EnableSharedSettings( bool bEnable )
aDocument.StartChangeTracking();
// hide accept or reject changes dialog
- USHORT nId = ScAcceptChgDlgWrapper::GetChildWindowId();
+ sal_uInt16 nId = ScAcceptChgDlgWrapper::GetChildWindowId();
SfxViewFrame* pViewFrame = SfxViewFrame::Current();
if ( pViewFrame && pViewFrame->HasChildWindow( nId ) )
{
@@ -2634,7 +2627,7 @@ void ScDocShell::EnableSharedSettings( bool bEnable )
}
ScChangeViewSettings aChangeViewSet;
- aChangeViewSet.SetShowChanges( FALSE );
+ aChangeViewSet.SetShowChanges( false );
aDocument.SetChangeViewSettings( aChangeViewSet );
}
@@ -2655,7 +2648,7 @@ uno::Reference< frame::XModel > ScDocShell::LoadSharedDocument()
if ( GetMedium() )
{
- SFX_ITEMSET_ARG( GetMedium()->GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD, sal_False);
+ SFX_ITEMSET_ARG( GetMedium()->GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD, false);
if ( pPasswordItem && pPasswordItem->GetValue().Len() )
{
aArgs.realloc( 2 );
diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx
index 4d09ec0c9438..4fafac178e2f 100644
--- a/sc/source/ui/docshell/docsh5.cxx
+++ b/sc/source/ui/docshell/docsh5.cxx
@@ -90,13 +90,13 @@ using ::std::vector;
// former viewfunc/dbfunc methods
//
-void ScDocShell::ErrorMessage( USHORT nGlobStrId )
+void ScDocShell::ErrorMessage( sal_uInt16 nGlobStrId )
{
//! StopMarking an der (aktiven) View?
Window* pParent = GetActiveDialogParent();
ScWaitCursorOff aWaitOff( pParent );
- BOOL bFocus = pParent && pParent->HasFocus();
+ sal_Bool bFocus = pParent && pParent->HasFocus();
if(nGlobStrId==STR_PROTECTIONERR)
{
@@ -112,7 +112,7 @@ void ScDocShell::ErrorMessage( USHORT nGlobStrId )
pParent->GrabFocus();
}
-BOOL ScDocShell::IsEditable() const
+sal_Bool ScDocShell::IsEditable() const
{
// import into read-only document is possible - must be extended if other filters use api
// #i108547# MSOOXML filter uses "IsChangeReadOnlyEnabled" property
@@ -139,12 +139,12 @@ ScDBData* lcl_GetDBNearCursor( ScDBCollection* pColl, SCCOL nCol, SCROW nRow, SC
ScDBData* pNoNameData = NULL;
ScDBData* pNearData = NULL;
- USHORT nCount = pColl->GetCount();
+ sal_uInt16 nCount = pColl->GetCount();
String aNoName = ScGlobal::GetRscString( STR_DB_NONAME );
SCTAB nAreaTab;
SCCOL nStartCol, nEndCol;
SCROW nStartRow, nEndRow;
- for (USHORT i = 0; i < nCount; i++)
+ for (sal_uInt16 i = 0; i < nCount; i++)
{
ScDBData* pDB = (*pColl)[i];
pDB->GetArea( nAreaTab, nStartCol, nStartRow, nEndCol, nEndRow );
@@ -188,11 +188,11 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe
if (!pData)
pData = lcl_GetDBNearCursor( aDocument.GetDBCollection(), nCol, nRow, nTab );
- BOOL bSelected = ( eSel == SC_DBSEL_FORCE_MARK ||
+ sal_Bool bSelected = ( eSel == SC_DBSEL_FORCE_MARK ||
(rMarked.aStart != rMarked.aEnd && eSel != SC_DBSEL_ROW_DOWN) );
bool bOnlyDown = (!bSelected && eSel == SC_DBSEL_ROW_DOWN && rMarked.aStart.Row() == rMarked.aEnd.Row());
- BOOL bUseThis = FALSE;
+ sal_Bool bUseThis = false;
if (pData)
{
// Bereich nehmen, wenn nichts anderes markiert
@@ -203,11 +203,11 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe
SCCOL nOldCol2;
SCROW nOldRow2;
pData->GetArea( nDummy, nOldCol1,nOldRow1, nOldCol2,nOldRow2 );
- BOOL bIsNoName = ( pData->GetName() == ScGlobal::GetRscString( STR_DB_NONAME ) );
+ sal_Bool bIsNoName = ( pData->GetName() == ScGlobal::GetRscString( STR_DB_NONAME ) );
if (!bSelected)
{
- bUseThis = TRUE;
+ bUseThis = sal_True;
if ( bIsNoName && eMode == SC_DB_MAKE )
{
// If nothing marked or only one row marked, adapt
@@ -224,9 +224,9 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe
nEndCol = nStartCol;
nEndRow = nStartRow;
}
- aDocument.GetDataArea( nTab, nStartCol, nStartRow, nEndCol, nEndRow, FALSE, bOnlyDown );
+ aDocument.GetDataArea( nTab, nStartCol, nStartRow, nEndCol, nEndRow, false, bOnlyDown );
if ( nOldCol1 != nStartCol || nOldCol2 != nEndCol || nOldRow1 != nStartRow )
- bUseThis = FALSE; // passt gar nicht
+ bUseThis = false; // passt gar nicht
else if ( nOldRow2 != nEndRow )
{
// Bereich auf neue End-Zeile erweitern
@@ -238,15 +238,15 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe
{
if ( nOldCol1 == nStartCol && nOldRow1 == nStartRow &&
nOldCol2 == nEndCol && nOldRow2 == nEndRow ) // genau markiert?
- bUseThis = TRUE;
+ bUseThis = sal_True;
else
- bUseThis = FALSE; // immer Markierung nehmen (Bug 11964)
+ bUseThis = false; // immer Markierung nehmen (Bug 11964)
}
// fuer Import nie "unbenannt" nehmen
if ( bUseThis && eMode == SC_DB_IMPORT && bIsNoName )
- bUseThis = FALSE;
+ bUseThis = false;
}
if ( bUseThis )
@@ -277,13 +277,13 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe
nEndCol = nStartCol;
nEndRow = nStartRow;
}
- aDocument.GetDataArea( nTab, nStartCol, nStartRow, nEndCol, nEndRow, FALSE, bOnlyDown );
+ aDocument.GetDataArea( nTab, nStartCol, nStartRow, nEndCol, nEndRow, false, bOnlyDown );
}
- BOOL bHasHeader = aDocument.HasColHeader( nStartCol,nStartRow, nEndCol,nEndRow, nTab );
+ sal_Bool bHasHeader = aDocument.HasColHeader( nStartCol,nStartRow, nEndCol,nEndRow, nTab );
ScDBData* pNoNameData;
- USHORT nNoNameIndex;
+ sal_uInt16 nNoNameIndex;
ScDBCollection* pColl = aDocument.GetDBCollection();
if ( eMode != SC_DB_IMPORT &&
pColl->SearchName( ScGlobal::GetRscString( STR_DB_NONAME ), nNoNameIndex ) )
@@ -310,9 +310,9 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe
pNoNameData->SetSubTotalParam( ScSubTotalParam() );
pNoNameData->SetArea( nTab, nStartCol,nStartRow, nEndCol,nEndRow ); // neu setzen
- pNoNameData->SetByRow( TRUE );
+ pNoNameData->SetByRow( sal_True );
pNoNameData->SetHeader( bHasHeader );
- pNoNameData->SetAutoFilter( FALSE );
+ pNoNameData->SetAutoFilter( false );
}
else
{
@@ -321,12 +321,12 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe
String aNewName;
if (eMode==SC_DB_IMPORT)
{
- aDocument.CompileDBFormula( TRUE ); // CreateFormulaString
+ aDocument.CompileDBFormula( sal_True ); // CreateFormulaString
pUndoColl = new ScDBCollection( *pColl ); // Undo fuer Import1-Bereich
String aImport = ScGlobal::GetRscString( STR_DBNAME_IMPORT );
long nCount = 0;
- USHORT nDummy;
+ sal_uInt16 nDummy;
do
{
++nCount;
@@ -339,12 +339,12 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe
aNewName = ScGlobal::GetRscString( STR_DB_NONAME );
pNoNameData = new ScDBData( aNewName, nTab,
nStartCol,nStartRow, nEndCol,nEndRow,
- TRUE, bHasHeader );
+ sal_True, bHasHeader );
pColl->Insert( pNoNameData );
if ( pUndoColl )
{
- aDocument.CompileDBFormula( FALSE ); // CompileFormulaString
+ aDocument.CompileDBFormula( false ); // CompileFormulaString
ScDBCollection* pRedoColl = new ScDBCollection( *pColl );
GetUndoManager()->AddUndoAction( new ScUndoDBData( this, pUndoColl, pRedoColl ) );
@@ -374,7 +374,7 @@ void ScDocShell::CancelAutoDBRange()
// called when dialog is cancelled
if ( pOldAutoDBRange )
{
- USHORT nNoNameIndex;
+ sal_uInt16 nNoNameIndex;
ScDBCollection* pColl = aDocument.GetDBCollection();
if ( pColl->SearchName( ScGlobal::GetRscString( STR_DB_NONAME ), nNoNameIndex ) )
{
@@ -408,12 +408,12 @@ void ScDocShell::CancelAutoDBRange()
// Hoehen anpassen
//! mit docfunc zusammenfassen
-BOOL ScDocShell::AdjustRowHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab )
+sal_Bool ScDocShell::AdjustRowHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab )
{
ScSizeDeviceProvider aProv(this);
Fraction aZoom(1,1);
- BOOL bChange = aDocument.SetOptimalHeight( nStartRow,nEndRow, nTab, 0, aProv.GetDevice(),
- aProv.GetPPTX(),aProv.GetPPTY(), aZoom,aZoom, FALSE );
+ sal_Bool bChange = aDocument.SetOptimalHeight( nStartRow,nEndRow, nTab, 0, aProv.GetDevice(),
+ aProv.GetPPTX(),aProv.GetPPTY(), aZoom,aZoom, false );
if (bChange)
PostPaint( 0,nStartRow,nTab, MAXCOL,MAXROW,nTab, PAINT_GRID|PAINT_LEFT );
@@ -431,8 +431,8 @@ void ScDocShell::UpdateAllRowHeights( const ScMarkData* pTabMark )
void ScDocShell::UpdatePendingRowHeights( SCTAB nUpdateTab, bool bBefore )
{
- BOOL bIsUndoEnabled = aDocument.IsUndoEnabled();
- aDocument.EnableUndo( FALSE );
+ sal_Bool bIsUndoEnabled = aDocument.IsUndoEnabled();
+ aDocument.EnableUndo( false );
aDocument.LockStreamValid( true ); // ignore draw page size (but not formula results)
if ( bBefore ) // check all sheets up to nUpdateTab
{
@@ -444,7 +444,7 @@ void ScDocShell::UpdatePendingRowHeights( SCTAB nUpdateTab, bool bBefore )
SCTAB nTab;
for (nTab=0; nTab<=nUpdateTab; ++nTab)
if ( aDocument.IsPendingRowHeights( nTab ) )
- aUpdateSheets.SelectTable( nTab, TRUE );
+ aUpdateSheets.SelectTable( nTab, sal_True );
if (aUpdateSheets.GetSelectCount())
UpdateAllRowHeights(&aUpdateSheets); // update with a single progress bar
@@ -453,7 +453,7 @@ void ScDocShell::UpdatePendingRowHeights( SCTAB nUpdateTab, bool bBefore )
if ( aUpdateSheets.GetTableSelect( nTab ) )
{
aDocument.UpdatePageBreaks( nTab );
- aDocument.SetPendingRowHeights( nTab, FALSE );
+ aDocument.SetPendingRowHeights( nTab, false );
}
}
else // only nUpdateTab
@@ -462,7 +462,7 @@ void ScDocShell::UpdatePendingRowHeights( SCTAB nUpdateTab, bool bBefore )
{
AdjustRowHeight( 0, MAXROW, nUpdateTab );
aDocument.UpdatePageBreaks( nUpdateTab );
- aDocument.SetPendingRowHeights( nUpdateTab, FALSE );
+ aDocument.SetPendingRowHeights( nUpdateTab, false );
}
}
aDocument.LockStreamValid( false );
@@ -479,8 +479,8 @@ void ScDocShell::RefreshPivotTables( const ScRange& rSource )
// DataPilotUpdate doesn't modify the collection order like PivotUpdate did,
// so a simple loop can be used.
- USHORT nCount = pColl->GetCount();
- for ( USHORT i=0; i<nCount; i++ )
+ sal_uInt16 nCount = pColl->GetCount();
+ for ( sal_uInt16 i=0; i<nCount; i++ )
{
ScDPObject* pOld = (*pColl)[i];
if ( pOld )
@@ -490,7 +490,7 @@ void ScDocShell::RefreshPivotTables( const ScRange& rSource )
{
ScDPObject* pNew = new ScDPObject( *pOld );
ScDBDocFunc aFunc( *this );
- aFunc.DataPilotUpdate( pOld, pNew, TRUE, FALSE );
+ aFunc.DataPilotUpdate( pOld, pNew, sal_True, false );
delete pNew; // DataPilotUpdate copies settings from "new" object
}
}
@@ -501,14 +501,14 @@ void ScDocShell::RefreshPivotTables( const ScRange& rSource )
String lcl_GetAreaName( ScDocument* pDoc, ScArea* pArea )
{
String aName;
- BOOL bOk = FALSE;
+ sal_Bool bOk = false;
ScDBData* pData = pDoc->GetDBAtArea( pArea->nTab, pArea->nColStart, pArea->nRowStart,
pArea->nColEnd, pArea->nRowEnd );
if (pData)
{
pData->GetName( aName );
if ( aName != ScGlobal::GetRscString( STR_DB_NONAME ) )
- bOk = TRUE;
+ bOk = sal_True;
}
if (!bOk)
@@ -517,14 +517,14 @@ String lcl_GetAreaName( ScDocument* pDoc, ScArea* pArea )
return aName;
}
-void ScDocShell::DoConsolidate( const ScConsolidateParam& rParam, BOOL bRecord )
+void ScDocShell::DoConsolidate( const ScConsolidateParam& rParam, sal_Bool bRecord )
{
ScConsData aData;
- USHORT nPos;
+ sal_uInt16 nPos;
SCCOL nColSize = 0;
SCROW nRowSize = 0;
- BOOL bErr = FALSE;
+ sal_Bool bErr = false;
for (nPos=0; nPos<rParam.nDataAreaCount; nPos++)
{
ScArea* pArea = rParam.ppDataAreas[nPos];
@@ -534,7 +534,7 @@ void ScDocShell::DoConsolidate( const ScConsolidateParam& rParam, BOOL bRecord )
// Test, ob Quelldaten verschoben wuerden
if (rParam.bReferenceData)
if (pArea->nTab == rParam.nTab && pArea->nRowEnd >= rParam.nRow)
- bErr = TRUE;
+ bErr = sal_True;
}
if (bErr)
@@ -551,7 +551,7 @@ void ScDocShell::DoConsolidate( const ScConsolidateParam& rParam, BOOL bRecord )
ScDocShellModificator aModificator( *this );
ScRange aOldDest;
- ScDBData* pDestData = aDocument.GetDBAtCursor( rParam.nCol, rParam.nRow, rParam.nTab, TRUE );
+ ScDBData* pDestData = aDocument.GetDBAtCursor( rParam.nCol, rParam.nRow, rParam.nTab, sal_True );
if (pDestData)
pDestData->GetArea(aOldDest);
@@ -594,28 +594,28 @@ void ScDocShell::DoConsolidate( const ScConsolidateParam& rParam, BOOL bRecord )
ScOutlineTable* pUndoTab = pTable ? new ScOutlineTable( *pTable ) : NULL;
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( &aDocument, 0, nTabCount-1, FALSE, TRUE );
+ pUndoDoc->InitUndo( &aDocument, 0, nTabCount-1, false, sal_True );
// Zeilenstatus
aDocument.CopyToDocument( 0,0,nDestTab, MAXCOL,MAXROW,nDestTab,
- IDF_NONE, FALSE, pUndoDoc );
+ IDF_NONE, false, pUndoDoc );
// alle Formeln
aDocument.CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTabCount-1,
- IDF_FORMULA, FALSE, pUndoDoc );
+ IDF_FORMULA, false, pUndoDoc );
// komplette Ausgangszeilen
aDocument.CopyToDocument( 0,aDestArea.nRowStart,nDestTab,
MAXCOL,aDestArea.nRowEnd,nDestTab,
- IDF_ALL, FALSE, pUndoDoc );
+ IDF_ALL, false, pUndoDoc );
// alten Ausgabebereich
if (pDestData)
- aDocument.CopyToDocument( aOldDest, IDF_ALL, FALSE, pUndoDoc );
+ aDocument.CopyToDocument( aOldDest, IDF_ALL, false, pUndoDoc );
GetUndoManager()->AddUndoAction(
new ScUndoConsolidate( this, aDestArea, rParam, pUndoDoc,
- TRUE, nInsertCount, pUndoTab, pUndoData ) );
+ sal_True, nInsertCount, pUndoTab, pUndoData ) );
}
else
{
@@ -624,15 +624,15 @@ void ScDocShell::DoConsolidate( const ScConsolidateParam& rParam, BOOL bRecord )
aDocument.CopyToDocument( aDestArea.nColStart, aDestArea.nRowStart, aDestArea.nTab,
aDestArea.nColEnd, aDestArea.nRowEnd, aDestArea.nTab,
- IDF_ALL, FALSE, pUndoDoc );
+ IDF_ALL, false, pUndoDoc );
// alten Ausgabebereich
if (pDestData)
- aDocument.CopyToDocument( aOldDest, IDF_ALL, FALSE, pUndoDoc );
+ aDocument.CopyToDocument( aOldDest, IDF_ALL, false, pUndoDoc );
GetUndoManager()->AddUndoAction(
new ScUndoConsolidate( this, aDestArea, rParam, pUndoDoc,
- FALSE, 0, NULL, pUndoData ) );
+ false, 0, NULL, pUndoData ) );
}
}
@@ -650,7 +650,7 @@ void ScDocShell::DoConsolidate( const ScConsolidateParam& rParam, BOOL bRecord )
SCROW nPaintStartRow = rParam.nRow;
SCCOL nPaintEndCol = nPaintStartCol + nColSize - 1;
SCROW nPaintEndRow = nPaintStartRow + nRowSize - 1;
- USHORT nPaintFlags = PAINT_GRID;
+ sal_uInt16 nPaintFlags = PAINT_GRID;
if (rParam.bByCol)
++nPaintEndRow;
if (rParam.bByRow)
@@ -674,7 +674,7 @@ void ScDocShell::DoConsolidate( const ScConsolidateParam& rParam, BOOL bRecord )
aModificator.SetDocumentModified();
}
-void ScDocShell::UseScenario( SCTAB nTab, const String& rName, BOOL bRecord )
+void ScDocShell::UseScenario( SCTAB nTab, const String& rName, sal_Bool bRecord )
{
if (!aDocument.IsScenario(nTab))
{
@@ -712,22 +712,22 @@ void ScDocShell::UseScenario( SCTAB nTab, const String& rName, BOOL bRecord )
pUndoDoc->InitUndo( &aDocument, nTab,nEndTab ); // auch alle Szenarien
// angezeigte Tabelle:
aDocument.CopyToDocument( nStartCol,nStartRow,nTab,
- nEndCol,nEndRow,nTab, IDF_ALL,TRUE, pUndoDoc, &aScenMark );
+ nEndCol,nEndRow,nTab, IDF_ALL,sal_True, pUndoDoc, &aScenMark );
// Szenarien
for (SCTAB i=nTab+1; i<=nEndTab; i++)
{
- pUndoDoc->SetScenario( i, TRUE );
+ pUndoDoc->SetScenario( i, sal_True );
String aComment;
Color aColor;
- USHORT nScenFlags;
+ sal_uInt16 nScenFlags;
aDocument.GetScenarioData( i, aComment, aColor, nScenFlags );
pUndoDoc->SetScenarioData( i, aComment, aColor, nScenFlags );
- BOOL bActive = aDocument.IsActiveScenario( i );
+ sal_Bool bActive = aDocument.IsActiveScenario( i );
pUndoDoc->SetActiveScenario( i, bActive );
// Bei Zurueckkopier-Szenarios auch Inhalte
if ( nScenFlags & SC_SCENARIO_TWOWAY )
aDocument.CopyToDocument( 0,0,i, MAXCOL,MAXROW,i,
- IDF_ALL,FALSE, pUndoDoc );
+ IDF_ALL,false, pUndoDoc );
}
GetUndoManager()->AddUndoAction(
@@ -766,14 +766,14 @@ void ScDocShell::UseScenario( SCTAB nTab, const String& rName, BOOL bRecord )
}
void ScDocShell::ModifyScenario( SCTAB nTab, const String& rName, const String& rComment,
- const Color& rColor, USHORT nFlags )
+ const Color& rColor, sal_uInt16 nFlags )
{
// Undo
String aOldName;
aDocument.GetName( nTab, aOldName );
String aOldComment;
Color aOldColor;
- USHORT nOldFlags;
+ sal_uInt16 nOldFlags;
aDocument.GetScenarioData( nTab, aOldComment, aOldColor, nOldFlags );
GetUndoManager()->AddUndoAction(
new ScUndoScenarioFlags( this, nTab,
@@ -796,8 +796,8 @@ void ScDocShell::ModifyScenario( SCTAB nTab, const String& rName, const String&
}
SCTAB ScDocShell::MakeScenario( SCTAB nTab, const String& rName, const String& rComment,
- const Color& rColor, USHORT nFlags,
- ScMarkData& rMark, BOOL bRecord )
+ const Color& rColor, sal_uInt16 nFlags,
+ ScMarkData& rMark, sal_Bool bRecord )
{
rMark.MarkToMulti();
if (rMark.IsMultiMarked())
@@ -806,7 +806,7 @@ SCTAB ScDocShell::MakeScenario( SCTAB nTab, const String& rName, const String& r
while (aDocument.IsScenario(nNewTab))
++nNewTab;
- BOOL bCopyAll = ( (nFlags & SC_SCENARIO_COPYALL) != 0 );
+ sal_Bool bCopyAll = ( (nFlags & SC_SCENARIO_COPYALL) != 0 );
const ScMarkData* pCopyMark = NULL;
if (!bCopyAll)
pCopyMark = &rMark;
@@ -825,8 +825,8 @@ SCTAB ScDocShell::MakeScenario( SCTAB nTab, const String& rName, const String& r
rName, rComment, rColor, nFlags, rMark ));
}
- aDocument.RenameTab( nNewTab, rName, FALSE ); // ohne Formel-Update
- aDocument.SetScenario( nNewTab, TRUE );
+ aDocument.RenameTab( nNewTab, rName, false ); // ohne Formel-Update
+ aDocument.SetScenario( nNewTab, sal_True );
aDocument.SetScenarioData( nNewTab, rComment, rColor, nFlags );
ScMarkData aDestMark = rMark;
@@ -835,19 +835,19 @@ SCTAB ScDocShell::MakeScenario( SCTAB nTab, const String& rName, const String& r
//! auf Filter / Buttons / Merging testen !
ScPatternAttr aProtPattern( aDocument.GetPool() );
- aProtPattern.GetItemSet().Put( ScProtectionAttr( TRUE ) );
+ aProtPattern.GetItemSet().Put( ScProtectionAttr( sal_True ) );
aDocument.ApplyPatternAreaTab( 0,0, MAXCOL,MAXROW, nNewTab, aProtPattern );
ScPatternAttr aPattern( aDocument.GetPool() );
aPattern.GetItemSet().Put( ScMergeFlagAttr( SC_MF_SCENARIO ) );
- aPattern.GetItemSet().Put( ScProtectionAttr( TRUE ) );
+ aPattern.GetItemSet().Put( ScProtectionAttr( sal_True ) );
aDocument.ApplySelectionPattern( aPattern, aDestMark );
if (!bCopyAll)
- aDocument.SetVisible( nNewTab, FALSE );
+ aDocument.SetVisible( nNewTab, false );
// dies ist dann das aktive Szenario
- aDocument.CopyScenario( nNewTab, nTab, TRUE ); // TRUE - nicht aus Szenario kopieren
+ aDocument.CopyScenario( nNewTab, nTab, sal_True ); // sal_True - nicht aus Szenario kopieren
if (nFlags & SC_SCENARIO_SHOWFRAME)
PostPaint( 0,0,nTab, MAXCOL,MAXROW,nTab, PAINT_GRID ); // Rahmen painten
@@ -862,13 +862,13 @@ SCTAB ScDocShell::MakeScenario( SCTAB nTab, const String& rName, const String& r
return nTab;
}
-ULONG ScDocShell::TransferTab( ScDocShell& rSrcDocShell, SCTAB nSrcPos,
- SCTAB nDestPos, BOOL bInsertNew,
- BOOL bNotifyAndPaint )
+sal_uLong ScDocShell::TransferTab( ScDocShell& rSrcDocShell, SCTAB nSrcPos,
+ SCTAB nDestPos, sal_Bool bInsertNew,
+ sal_Bool bNotifyAndPaint )
{
ScDocument* pSrcDoc = rSrcDocShell.GetDocument();
- ULONG nErrVal = aDocument.TransferTab( pSrcDoc, nSrcPos, nDestPos,
+ sal_uLong nErrVal = aDocument.TransferTab( pSrcDoc, nSrcPos, nDestPos,
bInsertNew ); // no insert
// TransferTab doesn't copy drawing objects with bInsertNew=FALSE
@@ -879,15 +879,15 @@ ULONG ScDocShell::TransferTab( ScDocShell& rSrcDocShell, SCTAB nSrcPos,
{
String aComment;
Color aColor;
- USHORT nFlags;
+ sal_uInt16 nFlags;
pSrcDoc->GetScenarioData( nSrcPos, aComment,aColor, nFlags);
- aDocument.SetScenario(nDestPos,TRUE);
+ aDocument.SetScenario(nDestPos,true);
aDocument.SetScenarioData(nDestPos,aComment,aColor,nFlags);
- BOOL bActive = pSrcDoc->IsActiveScenario(nSrcPos);
+ sal_Bool bActive = pSrcDoc->IsActiveScenario(nSrcPos);
aDocument.SetActiveScenario(nDestPos, bActive );
- BOOL bVisible=pSrcDoc->IsVisible(nSrcPos);
+ sal_Bool bVisible=pSrcDoc->IsVisible(nSrcPos);
aDocument.SetVisible(nDestPos,bVisible );
}
@@ -903,7 +903,7 @@ ULONG ScDocShell::TransferTab( ScDocShell& rSrcDocShell, SCTAB nSrcPos,
return nErrVal;
}
-BOOL ScDocShell::MoveTable( SCTAB nSrcTab, SCTAB nDestTab, BOOL bCopy, BOOL bRecord )
+sal_Bool ScDocShell::MoveTable( SCTAB nSrcTab, SCTAB nDestTab, sal_Bool bCopy, sal_Bool bRecord )
{
ScDocShellModificator aModificator( *this );
@@ -922,7 +922,7 @@ BOOL ScDocShell::MoveTable( SCTAB nSrcTab, SCTAB nDestTab, BOOL bCopy, BOOL bRec
if (!aDocument.CopyTab( nSrcTab, nDestTab ))
{
//! EndDrawUndo?
- return FALSE;
+ return false;
}
else
{
@@ -941,7 +941,7 @@ BOOL ScDocShell::MoveTable( SCTAB nSrcTab, SCTAB nDestTab, BOOL bCopy, BOOL bRec
new ScUndoCopyTab(this, pSrcList.release(), pDestList.release()));
}
- BOOL bVbaEnabled = aDocument.IsInVBAMode();
+ sal_Bool bVbaEnabled = aDocument.IsInVBAMode();
if ( bVbaEnabled )
{
String aLibName( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) );
@@ -978,7 +978,7 @@ BOOL ScDocShell::MoveTable( SCTAB nSrcTab, SCTAB nDestTab, BOOL bCopy, BOOL bRec
else
{
if ( aDocument.GetChangeTrack() )
- return FALSE;
+ return false;
if ( nSrcTab<nDestTab && nDestTab!=SC_TAB_APPEND )
nDestTab--;
@@ -986,11 +986,11 @@ BOOL ScDocShell::MoveTable( SCTAB nSrcTab, SCTAB nDestTab, BOOL bCopy, BOOL bRec
if ( nSrcTab == nDestTab )
{
//! allow only for api calls?
- return TRUE; // nothing to do, but valid
+ return sal_True; // nothing to do, but valid
}
if (!aDocument.MoveTab( nSrcTab, nDestTab ))
- return FALSE;
+ return false;
else if (bRecord)
{
auto_ptr< vector<SCTAB> > pSrcList(new vector<SCTAB>(1, nSrcTab));
@@ -1007,7 +1007,7 @@ BOOL ScDocShell::MoveTable( SCTAB nSrcTab, SCTAB nDestTab, BOOL bCopy, BOOL bRec
aModificator.SetDocumentModified();
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
- return TRUE;
+ return sal_True;
}
@@ -1015,7 +1015,7 @@ IMPL_LINK( ScDocShell, RefreshDBDataHdl, ScRefreshTimer*, pRefreshTimer )
{
ScDBDocFunc aFunc(*this);
- BOOL bContinue = TRUE;
+ sal_Bool bContinue = sal_True;
ScDBData* pDBData = static_cast<ScDBData*>(pRefreshTimer);
ScImportParam aImportParam;
pDBData->GetImportParam( aImportParam );
@@ -1024,11 +1024,11 @@ IMPL_LINK( ScDocShell, RefreshDBDataHdl, ScRefreshTimer*, pRefreshTimer )
ScRange aRange;
pDBData->GetArea( aRange );
Reference< ::com::sun::star::sdbc::XResultSet> xResultSet;
- bContinue = aFunc.DoImport( aRange.aStart.Tab(), aImportParam, xResultSet, NULL, TRUE, FALSE ); //! Api-Flag as parameter
+ bContinue = aFunc.DoImport( aRange.aStart.Tab(), aImportParam, xResultSet, NULL, true, false ); //! Api-Flag as parameter
// internal operations (sort, query, subtotal) only if no error
if (bContinue)
{
- aFunc.RepeatDB( pDBData->GetName(), TRUE, TRUE );
+ aFunc.RepeatDB( pDBData->GetName(), sal_True, sal_True );
RefreshPivotTables(aRange);
}
}
diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx
index 88ea2135f9f6..07bc6e4c5d35 100644
--- a/sc/source/ui/docshell/docsh6.cxx
+++ b/sc/source/ui/docshell/docsh6.cxx
@@ -103,7 +103,7 @@ void ScDocShell::SetVisArea( const Rectangle & rVisArea )
{
// with the SnapVisArea call in SetVisAreaOrSize, it's safe to always
// use both the size and position of the VisArea
- SetVisAreaOrSize( rVisArea, TRUE );
+ SetVisAreaOrSize( rVisArea, sal_True );
}
void lcl_SetTopRight( Rectangle& rRect, const Point& rPos )
@@ -115,9 +115,9 @@ void lcl_SetTopRight( Rectangle& rRect, const Point& rPos )
rRect.Bottom() = rPos.Y() + aSize.Height() - 1;
}
-void ScDocShell::SetVisAreaOrSize( const Rectangle& rVisArea, BOOL bModifyStart )
+void ScDocShell::SetVisAreaOrSize( const Rectangle& rVisArea, sal_Bool bModifyStart )
{
- BOOL bNegativePage = aDocument.IsNegativePage( aDocument.GetVisibleTab() );
+ sal_Bool bNegativePage = aDocument.IsNegativePage( aDocument.GetVisibleTab() );
Rectangle aArea = rVisArea;
if (bModifyStart)
@@ -200,12 +200,12 @@ void ScDocShell::SetVisAreaOrSize( const Rectangle& rVisArea, BOOL bModifyStart
}
}
-BOOL ScDocShell::IsOle()
+sal_Bool ScDocShell::IsOle()
{
return (GetCreateMode() == SFX_CREATE_MODE_EMBEDDED);
}
-void ScDocShell::UpdateOle( const ScViewData* pViewData, BOOL bSnapSize )
+void ScDocShell::UpdateOle( const ScViewData* pViewData, sal_Bool bSnapSize )
{
// wenn's gar nicht Ole ist, kann man sich die Berechnungen sparen
// (VisArea wird dann beim Save wieder zurueckgesetzt)
@@ -218,7 +218,7 @@ void ScDocShell::UpdateOle( const ScViewData* pViewData, BOOL bSnapSize )
Rectangle aOldArea = SfxObjectShell::GetVisArea();
Rectangle aNewArea = aOldArea;
- BOOL bEmbedded = aDocument.IsEmbedded();
+ sal_Bool bEmbedded = aDocument.IsEmbedded();
if (bEmbedded)
aNewArea = aDocument.GetEmbeddedRect();
else
@@ -227,7 +227,7 @@ void ScDocShell::UpdateOle( const ScViewData* pViewData, BOOL bSnapSize )
if ( nTab != aDocument.GetVisibleTab() )
aDocument.SetVisibleTab( nTab );
- BOOL bNegativePage = aDocument.IsNegativePage( nTab );
+ sal_Bool bNegativePage = aDocument.IsNegativePage( nTab );
SCCOL nX = pViewData->GetPosX(SC_SPLIT_LEFT);
SCROW nY = pViewData->GetPosY(SC_SPLIT_BOTTOM);
Rectangle aMMRect = aDocument.GetMMRect( nX,nY, nX,nY, nTab );
@@ -240,7 +240,7 @@ void ScDocShell::UpdateOle( const ScViewData* pViewData, BOOL bSnapSize )
}
if (aNewArea != aOldArea)
- SetVisAreaOrSize( aNewArea, TRUE ); // hier muss auch der Start angepasst werden
+ SetVisAreaOrSize( aNewArea, true ); // hier muss auch der Start angepasst werden
}
//
@@ -266,14 +266,14 @@ void lcl_AdjustPool( SfxStyleSheetBasePool* pStylePool )
SfxItemSet& rStyleSet = pStyle->GetItemSet();
const SfxPoolItem* pItem;
- if (rStyleSet.GetItemState(ATTR_PAGE_HEADERSET,FALSE,&pItem) == SFX_ITEM_SET)
+ if (rStyleSet.GetItemState(ATTR_PAGE_HEADERSET,false,&pItem) == SFX_ITEM_SET)
{
SfxItemSet& rSrcSet = ((SvxSetItem*)pItem)->GetItemSet();
SfxItemSet* pDestSet = new SfxItemSet(*rStyleSet.GetPool(),rSrcSet.GetRanges());
pDestSet->Put(rSrcSet);
rStyleSet.Put(SvxSetItem(ATTR_PAGE_HEADERSET,pDestSet));
}
- if (rStyleSet.GetItemState(ATTR_PAGE_FOOTERSET,FALSE,&pItem) == SFX_ITEM_SET)
+ if (rStyleSet.GetItemState(ATTR_PAGE_FOOTERSET,false,&pItem) == SFX_ITEM_SET)
{
SfxItemSet& rSrcSet = ((SvxSetItem*)pItem)->GetItemSet();
SfxItemSet* pDestSet = new SfxItemSet(*rStyleSet.GetPool(),rSrcSet.GetRanges());
@@ -301,7 +301,7 @@ void ScDocShell::LoadStyles( SfxObjectShell &rSource )
PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PAINT_GRID | PAINT_LEFT );
}
-void ScDocShell::LoadStylesArgs( ScDocShell& rSource, BOOL bReplace, BOOL bCellStyles, BOOL bPageStyles )
+void ScDocShell::LoadStylesArgs( ScDocShell& rSource, sal_Bool bReplace, sal_Bool bCellStyles, sal_Bool bPageStyles )
{
// similar to LoadStyles, but with selectable behavior for XStyleLoader::loadStylesFromURL call
@@ -315,12 +315,12 @@ void ScDocShell::LoadStylesArgs( ScDocShell& rSource, BOOL bReplace, BOOL bCellS
( bPageStyles ? SFX_STYLE_FAMILY_ALL : SFX_STYLE_FAMILY_PARA ) :
SFX_STYLE_FAMILY_PAGE;
SfxStyleSheetIterator aIter( pSourcePool, eFamily );
- USHORT nSourceCount = aIter.Count();
+ sal_uInt16 nSourceCount = aIter.Count();
if ( nSourceCount == 0 )
return; // no source styles
ScStylePair* pStyles = new ScStylePair[ nSourceCount ];
- USHORT nFound = 0;
+ sal_uInt16 nFound = 0;
// first create all new styles
@@ -351,7 +351,7 @@ void ScDocShell::LoadStylesArgs( ScDocShell& rSource, BOOL bReplace, BOOL bCellS
// then copy contents (after inserting all styles, for parent etc.)
- for ( USHORT i = 0; i < nFound; ++i )
+ for ( sal_uInt16 i = 0; i < nFound; ++i )
{
pStyles[i].pDest->GetItemSet().PutExtended(
pStyles[i].pSource->GetItemSet(), SFX_ITEM_DONTCARE, SFX_ITEM_DEFAULT);
@@ -368,11 +368,11 @@ void ScDocShell::LoadStylesArgs( ScDocShell& rSource, BOOL bReplace, BOOL bCellS
}
-BOOL ScDocShell::Insert( SfxObjectShell &rSource,
- USHORT nSourceIdx1, USHORT nSourceIdx2, USHORT nSourceIdx3,
- USHORT &nIdx1, USHORT &nIdx2, USHORT &nIdx3, USHORT &rIdxDeleted )
+sal_Bool ScDocShell::Insert( SfxObjectShell &rSource,
+ sal_uInt16 nSourceIdx1, sal_uInt16 nSourceIdx2, sal_uInt16 nSourceIdx3,
+ sal_uInt16 &nIdx1, sal_uInt16 &nIdx2, sal_uInt16 &nIdx3, sal_uInt16 &rIdxDeleted )
{
- BOOL bRet = SfxObjectShell::Insert( rSource, nSourceIdx1, nSourceIdx2, nSourceIdx3,
+ sal_Bool bRet = SfxObjectShell::Insert( rSource, nSourceIdx1, nSourceIdx2, nSourceIdx3,
nIdx1, nIdx2, nIdx3, rIdxDeleted );
if (bRet)
lcl_AdjustPool( GetStyleSheetPool() ); // SetItems anpassen
@@ -396,8 +396,8 @@ void ScDocShell::UpdateLinks()
// nicht mehr benutzte Links raus
- USHORT nCount = pLinkManager->GetLinks().Count();
- for (USHORT k=nCount; k>0; )
+ sal_uInt16 nCount = pLinkManager->GetLinks().Count();
+ for (sal_uInt16 k=nCount; k>0; )
{
--k;
::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[k];
@@ -412,7 +412,7 @@ void ScDocShell::UpdateLinks()
}
else // nicht mehr benutzt -> loeschen
{
- pTabLink->SetAddUndo(TRUE);
+ pTabLink->SetAddUndo(sal_True);
pLinkManager->Remove(k);
}
}
@@ -428,8 +428,8 @@ void ScDocShell::UpdateLinks()
String aDocName = aDocument.GetLinkDoc(i);
String aFltName = aDocument.GetLinkFlt(i);
String aOptions = aDocument.GetLinkOpt(i);
- ULONG nRefresh = aDocument.GetLinkRefreshDelay(i);
- BOOL bThere = FALSE;
+ sal_uLong nRefresh = aDocument.GetLinkRefreshDelay(i);
+ sal_Bool bThere = false;
for (SCTAB j=0; j<i && !bThere; j++) // im Dokument mehrfach?
if (aDocument.IsLinked(j)
&& aDocument.GetLinkDoc(j) == aDocName
@@ -438,7 +438,7 @@ void ScDocShell::UpdateLinks()
// Ignore refresh delay in compare, it should be the
// same for identical links and we don't want dupes
// if it ain't.
- bThere = TRUE;
+ bThere = sal_True;
if (!bThere) // schon als Filter eingetragen?
{
@@ -446,36 +446,36 @@ void ScDocShell::UpdateLinks()
if (!aNames.Insert(pData))
{
delete pData;
- bThere = TRUE;
+ bThere = sal_True;
}
}
if (!bThere)
{
ScTableLink* pLink = new ScTableLink( this, aDocName, aFltName, aOptions, nRefresh );
- pLink->SetInCreate( TRUE );
+ pLink->SetInCreate( sal_True );
pLinkManager->InsertFileLink( *pLink, OBJECT_CLIENT_FILE, aDocName, &aFltName );
pLink->Update();
- pLink->SetInCreate( FALSE );
+ pLink->SetInCreate( false );
}
}
}
-BOOL ScDocShell::ReloadTabLinks()
+sal_Bool ScDocShell::ReloadTabLinks()
{
sfx2::LinkManager* pLinkManager = aDocument.GetLinkManager();
- BOOL bAny = FALSE;
- USHORT nCount = pLinkManager->GetLinks().Count();
- for (USHORT i=0; i<nCount; i++ )
+ sal_Bool bAny = false;
+ sal_uInt16 nCount = pLinkManager->GetLinks().Count();
+ for (sal_uInt16 i=0; i<nCount; i++ )
{
::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[i];
if (pBase->ISA(ScTableLink))
{
ScTableLink* pTabLink = (ScTableLink*)pBase;
- pTabLink->SetPaint(FALSE); // Paint nur einmal am Ende
+ pTabLink->SetPaint(false); // Paint nur einmal am Ende
pTabLink->Update();
- pTabLink->SetPaint(TRUE);
- bAny = TRUE;
+ pTabLink->SetPaint(true);
+ bAny = true;
}
}
@@ -488,7 +488,7 @@ BOOL ScDocShell::ReloadTabLinks()
SetDocumentModified();
}
- return TRUE; //! Fehler erkennen
+ return sal_True; //! Fehler erkennen
}
void ScDocShell::CheckConfigOptions()
diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx
index db1bcaf82251..1d7ec23e50e9 100644
--- a/sc/source/ui/docshell/docsh8.cxx
+++ b/sc/source/ui/docshell/docsh8.cxx
@@ -115,7 +115,7 @@ using ::std::vector;
namespace
{
- ULONG lcl_getDBaseConnection(uno::Reference<sdbc::XDriverManager>& _rDrvMgr,uno::Reference<sdbc::XConnection>& _rConnection,String& _rTabName,const String& rFullFileName,rtl_TextEncoding eCharSet)
+ sal_uLong lcl_getDBaseConnection(uno::Reference<sdbc::XDriverManager>& _rDrvMgr,uno::Reference<sdbc::XConnection>& _rConnection,String& _rTabName,const String& rFullFileName,rtl_TextEncoding eCharSet)
{
INetURLObject aURL;
aURL.SetSmartProtocol( INET_PROT_FILE );
@@ -171,13 +171,13 @@ namespace
// -----------------------------------------------------------------------
// MoveFile/KillFile/IsDocument: similar to SfxContentHelper
-BOOL ScDocShell::MoveFile( const INetURLObject& rSourceObj, const INetURLObject& rDestObj )
+sal_Bool ScDocShell::MoveFile( const INetURLObject& rSourceObj, const INetURLObject& rDestObj )
{
sal_Bool bMoveData = sal_True;
- sal_Bool bRet = sal_True, bKillSource = sal_False;
+ sal_Bool bRet = sal_True, bKillSource = false;
if ( rSourceObj.GetProtocol() != rDestObj.GetProtocol() )
{
- bMoveData = sal_False;
+ bMoveData = false;
bKillSource = sal_True;
}
String aName = rDestObj.getName();
@@ -205,7 +205,7 @@ BOOL ScDocShell::MoveFile( const INetURLObject& rSourceObj, const INetURLObject&
catch( uno::Exception& )
{
// ucb may throw different exceptions on failure now
- bRet = sal_False;
+ bRet = false;
}
if ( bKillSource )
@@ -215,7 +215,7 @@ BOOL ScDocShell::MoveFile( const INetURLObject& rSourceObj, const INetURLObject&
}
-BOOL ScDocShell::KillFile( const INetURLObject& rURL )
+sal_Bool ScDocShell::KillFile( const INetURLObject& rURL )
{
sal_Bool bRet = sal_True;
try
@@ -228,15 +228,15 @@ BOOL ScDocShell::KillFile( const INetURLObject& rURL )
catch( uno::Exception& )
{
// ucb may throw different exceptions on failure now
- bRet = sal_False;
+ bRet = false;
}
return bRet;
}
-BOOL ScDocShell::IsDocument( const INetURLObject& rURL )
+sal_Bool ScDocShell::IsDocument( const INetURLObject& rURL )
{
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = false;
try
{
::ucbhelper::Content aCnt( rURL.GetMainURL(INetURLObject::NO_DECODE),
@@ -273,11 +273,11 @@ static void lcl_setScalesToColumns(ScDocument& rDoc, const vector<long>& rScales
continue;
LanguageType eLang = pOldEntry->GetLanguage();
- BOOL bThousand, bNegRed;
- USHORT nPrecision, nLeading;
+ sal_Bool bThousand, bNegRed;
+ sal_uInt16 nPrecision, nLeading;
pOldEntry->GetFormatSpecialInfo(bThousand, bNegRed, nPrecision, nLeading);
- nPrecision = static_cast<USHORT>(rScales[i]);
+ nPrecision = static_cast<sal_uInt16>(rScales[i]);
String aNewPicture;
pFormatter->GenerateFormat(aNewPicture, nOldFormat, eLang,
bThousand, bNegRed, nPrecision, nLeading);
@@ -301,12 +301,12 @@ static void lcl_setScalesToColumns(ScDocument& rDoc, const vector<long>& rScales
}
}
-ULONG ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet,
+sal_uLong ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet,
ScColWidthParam aColWidthParam[MAXCOLCOUNT], ScFlatBoolRowSegments& rRowHeightsRecalc )
{
ScColumn::DoubleAllocSwitch aAllocSwitch(true);
- ULONG nErr = eERR_OK;
+ sal_uLong nErr = eERR_OK;
long i;
try
@@ -314,7 +314,7 @@ ULONG ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet,
String aTabName;
uno::Reference<sdbc::XDriverManager> xDrvMan;
uno::Reference<sdbc::XConnection> xConnection;
- ULONG nRet = lcl_getDBaseConnection(xDrvMan,xConnection,aTabName,rFullFileName,eCharSet);
+ sal_uLong nRet = lcl_getDBaseConnection(xDrvMan,xConnection,aTabName,rFullFileName,eCharSet);
if ( !xConnection.is() || !xDrvMan.is() )
return nRet;
::utl::DisposableComponent aConnectionHelper(xConnection);
@@ -351,7 +351,7 @@ ULONG ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet,
xRowProp->setPropertyValue(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_COMMAND)), aAny );
- aAny <<= sal_False;
+ aAny <<= false;
xRowProp->setPropertyValue(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_DBPROP_PROPCHANGE_NOTIFY)), aAny );
@@ -429,7 +429,7 @@ ULONG ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet,
lcl_setScalesToColumns(aDocument, aScales);
SCROW nRow = 1; // 0 is column titles
- BOOL bEnd = FALSE;
+ sal_Bool bEnd = false;
while ( !bEnd && xRowSet->next() )
{
bool bSimpleRow = true;
@@ -440,7 +440,7 @@ ULONG ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet,
{
ScDatabaseDocUtil::StrData aStrData;
ScDatabaseDocUtil::PutData( &aDocument, nCol, nRow, 0,
- xRow, i+1, pTypeArr[i], FALSE,
+ xRow, i+1, pTypeArr[i], false,
&aStrData );
if (aStrData.mnStrLength > aColWidthParam[nCol].mnMaxTextLen)
@@ -463,7 +463,7 @@ ULONG ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet,
}
else // past the end of the spreadsheet
{
- bEnd = TRUE; // don't continue
+ bEnd = sal_True; // don't continue
nErr = SCWARN_IMPORT_RANGE_OVERFLOW; // warning message
}
@@ -497,15 +497,15 @@ inline sal_Bool IsAsciiAlpha( sal_Unicode c )
}
void lcl_GetColumnTypes( ScDocShell& rDocShell,
- const ScRange& rDataRange, BOOL bHasFieldNames,
+ const ScRange& rDataRange, sal_Bool bHasFieldNames,
rtl::OUString* pColNames, sal_Int32* pColTypes,
sal_Int32* pColLengths, sal_Int32* pColScales,
- BOOL& bHasMemo, CharSet eCharSet )
+ sal_Bool& bHasMemo, CharSet eCharSet )
{
// updating of column titles didn't work in 5.2 and isn't always wanted
// (saving normally shouldn't modify the document)
//! read flag from configuration
- BOOL bUpdateTitles = FALSE;
+ sal_Bool bUpdateTitles = false;
ScDocument* pDoc = rDocShell.GetDocument();
SvNumberFormatter* pNumFmt = pDoc->GetFormatTable();
@@ -522,8 +522,8 @@ void lcl_GetColumnTypes( ScDocShell& rDocShell,
SCROW nFirstDataRow = ( bHasFieldNames ? nFirstRow + 1 : nFirstRow );
for ( SCCOL nCol = nFirstCol; nCol <= nLastCol; nCol++ )
{
- BOOL bTypeDefined = FALSE;
- BOOL bPrecDefined = FALSE;
+ sal_Bool bTypeDefined = false;
+ sal_Bool bPrecDefined = false;
sal_Int32 nFieldLen = 0;
sal_Int32 nPrecision = 0;
sal_Int32 nDbType = sdbc::DataType::SQLNULL;
@@ -545,26 +545,26 @@ void lcl_GetColumnTypes( ScDocShell& rDocShell,
case 'L' :
nDbType = sdbc::DataType::BIT;
nFieldLen = 1;
- bTypeDefined = TRUE;
- bPrecDefined = TRUE;
+ bTypeDefined = sal_True;
+ bPrecDefined = sal_True;
break;
case 'D' :
nDbType = sdbc::DataType::DATE;
nFieldLen = 8;
- bTypeDefined = TRUE;
- bPrecDefined = TRUE;
+ bTypeDefined = sal_True;
+ bPrecDefined = sal_True;
break;
case 'M' :
nDbType = sdbc::DataType::LONGVARCHAR;
nFieldLen = 10;
- bTypeDefined = TRUE;
- bPrecDefined = TRUE;
- bHasMemo = TRUE;
+ bTypeDefined = sal_True;
+ bPrecDefined = sal_True;
+ bHasMemo = sal_True;
break;
case 'C' :
nDbType = sdbc::DataType::VARCHAR;
- bTypeDefined = TRUE;
- bPrecDefined = TRUE;
+ bTypeDefined = sal_True;
+ bPrecDefined = sal_True;
break;
case 'N' :
nDbType = sdbc::DataType::DECIMAL;
@@ -579,7 +579,7 @@ void lcl_GetColumnTypes( ScDocShell& rDocShell,
if ( CharClass::isAsciiNumeric(aTmp) )
{
nPrecision = aTmp.ToInt32();
- bPrecDefined = TRUE;
+ bPrecDefined = sal_True;
}
}
}
@@ -609,7 +609,7 @@ void lcl_GetColumnTypes( ScDocShell& rDocShell,
StrData* pStrData = new StrData( aFieldName );
if ( !aFieldNamesCollection.Insert( pStrData ) )
{ // doppelter Feldname, numerisch erweitern
- USHORT nSub = 1;
+ sal_uInt16 nSub = 1;
String aFixPart( aFieldName );
do
{
@@ -665,8 +665,8 @@ void lcl_GetColumnTypes( ScDocShell& rDocShell,
}
}
}
- BOOL bSdbLenAdjusted = FALSE;
- BOOL bSdbLenBad = FALSE;
+ sal_Bool bSdbLenAdjusted = false;
+ sal_Bool bSdbLenBad = false;
// Feldlaenge
if ( nDbType == sdbc::DataType::VARCHAR && !nFieldLen )
{ // maximale Feldbreite bestimmen
@@ -708,9 +708,9 @@ void lcl_GetColumnTypes( ScDocShell& rDocShell,
//! CAVEAT! There is no way to define a numeric field with a length
//! of 1 and no decimals!
if ( nFieldLen == 1 && nPrecision == 0 )
- bSdbLenBad = TRUE;
+ bSdbLenBad = sal_True;
nFieldLen = SvDbaseConverter::ConvertPrecisionToOdbc( nFieldLen, nPrecision );
- bSdbLenAdjusted = TRUE;
+ bSdbLenAdjusted = sal_True;
}
if ( nFieldLen > 254 )
{
@@ -718,7 +718,7 @@ void lcl_GetColumnTypes( ScDocShell& rDocShell,
{ // zu lang fuer normales Textfeld => Memofeld
nDbType = sdbc::DataType::LONGVARCHAR;
nFieldLen = 10;
- bHasMemo = TRUE;
+ bHasMemo = sal_True;
}
else
nFieldLen = 254; // dumm gelaufen..
@@ -790,13 +790,13 @@ inline void lcl_getLongVarCharString( String& rString, ScBaseCell* pCell,
}
-ULONG ScDocShell::DBaseExport( const String& rFullFileName, CharSet eCharSet, BOOL& bHasMemo )
+sal_uLong ScDocShell::DBaseExport( const String& rFullFileName, CharSet eCharSet, sal_Bool& bHasMemo )
{
// remove the file so the dBase driver doesn't find an invalid file
INetURLObject aDeleteObj( rFullFileName, INET_PROT_FILE );
KillFile( aDeleteObj );
- ULONG nErr = eERR_OK;
+ sal_uLong nErr = eERR_OK;
uno::Any aAny;
SCCOL nFirstCol, nLastCol;
@@ -812,11 +812,11 @@ ULONG ScDocShell::DBaseExport( const String& rFullFileName, CharSet eCharSet, BO
nLastRow - nFirstRow );
SvNumberFormatter* pNumFmt = aDocument.GetFormatTable();
- BOOL bHasFieldNames = TRUE;
+ sal_Bool bHasFieldNames = sal_True;
for ( SCCOL nDocCol = nFirstCol; nDocCol <= nLastCol && bHasFieldNames; nDocCol++ )
{ // nur Strings in erster Zeile => sind Feldnamen
if ( !aDocument.HasStringData( nDocCol, nFirstRow, nTab ) )
- bHasFieldNames = FALSE;
+ bHasFieldNames = false;
}
long nColCount = nLastCol - nFirstCol + 1;
@@ -840,7 +840,7 @@ ULONG ScDocShell::DBaseExport( const String& rFullFileName, CharSet eCharSet, BO
{
uno::Reference<sdbc::XDriverManager> xDrvMan;
uno::Reference<sdbc::XConnection> xConnection;
- ULONG nRet = lcl_getDBaseConnection(xDrvMan,xConnection,aTabName,rFullFileName,eCharSet);
+ sal_uLong nRet = lcl_getDBaseConnection(xDrvMan,xConnection,aTabName,rFullFileName,eCharSet);
if ( !xConnection.is() || !xDrvMan.is() )
return nRet;
::utl::DisposableComponent aConnectionHelper(xConnection);
@@ -1004,7 +1004,7 @@ ULONG ScDocShell::DBaseExport( const String& rFullFileName, CharSet eCharSet, BO
{
aDocument.GetValue( nDocCol, nDocRow, nTab, fVal );
// zwischen 0 Wert und 0 kein Wert unterscheiden
- BOOL bIsNull = (fVal == 0.0);
+ sal_Bool bIsNull = (fVal == 0.0);
if ( bIsNull )
bIsNull = !aDocument.HasValueData( nDocCol, nDocRow, nTab );
if ( bIsNull )
diff --git a/sc/source/ui/docshell/editable.cxx b/sc/source/ui/docshell/editable.cxx
index 24cae921fddf..4e5535f92677 100644
--- a/sc/source/ui/docshell/editable.cxx
+++ b/sc/source/ui/docshell/editable.cxx
@@ -39,15 +39,15 @@
//------------------------------------------------------------------
ScEditableTester::ScEditableTester() :
- bIsEditable( TRUE ),
- bOnlyMatrix( TRUE )
+ bIsEditable( sal_True ),
+ bOnlyMatrix( sal_True )
{
}
ScEditableTester::ScEditableTester( ScDocument* pDoc, SCTAB nTab,
SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow ) :
- bIsEditable( TRUE ),
- bOnlyMatrix( TRUE )
+ bIsEditable( sal_True ),
+ bOnlyMatrix( sal_True )
{
TestBlock( pDoc, nTab, nStartCol, nStartRow, nEndCol, nEndRow );
}
@@ -55,29 +55,29 @@ ScEditableTester::ScEditableTester( ScDocument* pDoc, SCTAB nTab,
ScEditableTester::ScEditableTester( ScDocument* pDoc,
SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
const ScMarkData& rMark ) :
- bIsEditable( TRUE ),
- bOnlyMatrix( TRUE )
+ bIsEditable( sal_True ),
+ bOnlyMatrix( sal_True )
{
TestSelectedBlock( pDoc, nStartCol, nStartRow, nEndCol, nEndRow, rMark );
}
ScEditableTester::ScEditableTester( ScDocument* pDoc, const ScRange& rRange ) :
- bIsEditable( TRUE ),
- bOnlyMatrix( TRUE )
+ bIsEditable( sal_True ),
+ bOnlyMatrix( sal_True )
{
TestRange( pDoc, rRange );
}
ScEditableTester::ScEditableTester( ScDocument* pDoc, const ScMarkData& rMark ) :
- bIsEditable( TRUE ),
- bOnlyMatrix( TRUE )
+ bIsEditable( sal_True ),
+ bOnlyMatrix( sal_True )
{
TestSelection( pDoc, rMark );
}
ScEditableTester::ScEditableTester( ScViewFunc* pView ) :
- bIsEditable( TRUE ),
- bOnlyMatrix( TRUE )
+ bIsEditable( sal_True ),
+ bOnlyMatrix( sal_True )
{
TestView( pView );
}
@@ -89,12 +89,12 @@ void ScEditableTester::TestBlock( ScDocument* pDoc, SCTAB nTab,
{
if ( bIsEditable || bOnlyMatrix )
{
- BOOL bThisMatrix;
+ sal_Bool bThisMatrix;
if ( !pDoc->IsBlockEditable( nTab, nStartCol, nStartRow, nEndCol, nEndRow, &bThisMatrix ) )
{
- bIsEditable = FALSE;
+ bIsEditable = false;
if ( !bThisMatrix )
- bOnlyMatrix = FALSE;
+ bOnlyMatrix = false;
}
}
}
@@ -125,12 +125,12 @@ void ScEditableTester::TestSelection( ScDocument* pDoc, const ScMarkData& rMark
{
if ( bIsEditable || bOnlyMatrix )
{
- BOOL bThisMatrix;
+ sal_Bool bThisMatrix;
if ( !pDoc->IsSelectionEditable( rMark, &bThisMatrix ) )
{
- bIsEditable = FALSE;
+ bIsEditable = false;
if ( !bThisMatrix )
- bOnlyMatrix = FALSE;
+ bOnlyMatrix = false;
}
}
}
@@ -139,19 +139,19 @@ void ScEditableTester::TestView( ScViewFunc* pView )
{
if ( bIsEditable || bOnlyMatrix )
{
- BOOL bThisMatrix;
+ sal_Bool bThisMatrix;
if ( !pView->SelectionEditable( &bThisMatrix ) )
{
- bIsEditable = FALSE;
+ bIsEditable = false;
if ( !bThisMatrix )
- bOnlyMatrix = FALSE;
+ bOnlyMatrix = false;
}
}
}
//------------------------------------------------------------------
-USHORT ScEditableTester::GetMessageId() const
+sal_uInt16 ScEditableTester::GetMessageId() const
{
if (bIsEditable)
return 0;
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index 2c2bb32e3ef9..f9de3e8c0c48 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -1288,7 +1288,7 @@ static FormulaToken* lcl_convertToToken(ScBaseCell* pCell)
case CELLTYPE_FORMULA:
{
ScFormulaCell* pFCell = static_cast<ScFormulaCell*>(pCell);
- USHORT nError = pFCell->GetErrCode();
+ sal_uInt16 nError = pFCell->GetErrCode();
if (nError)
return new FormulaErrorToken( nError);
else if (pFCell->IsValue())
@@ -1391,7 +1391,7 @@ static ScTokenArray* lcl_convertToTokenArray(const ScDocument* pSrcDoc, ScRange&
case CELLTYPE_FORMULA:
{
ScFormulaCell* pFCell = static_cast<ScFormulaCell*>(pCell);
- USHORT nError = pFCell->GetErrCode();
+ sal_uInt16 nError = pFCell->GetErrCode();
if (nError)
xMat->PutDouble( CreateDoubleError( nError), nC, nR);
else if (pFCell->IsValue())
@@ -2162,7 +2162,7 @@ SfxObjectShellRef ScExternalRefManager::loadSrcDocument(sal_uInt16 nFileId, Stri
pSet->Put(SfxStringItem(SID_FILE_FILTEROPTIONS, aOptions));
// make medium hidden to prevent assertion from progress bar
- pSet->Put( SfxBoolItem( SID_HIDDEN, TRUE ) );
+ pSet->Put( SfxBoolItem( SID_HIDDEN, sal_True ) );
auto_ptr<SfxMedium> pMedium(new SfxMedium(aFile, STREAM_STD_READ, false, pFilter, pSet));
if (pMedium->GetError() != ERRCODE_NONE)
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 8b08e80d21ae..133cb368e117 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -113,9 +113,9 @@ enum SylkVersion
ScImportExport::ScImportExport( ScDocument* p )
: pDocSh( PTR_CAST(ScDocShell,p->GetDocumentShell()) ), pDoc( p ),
nSizeLimit( 0 ), cSep( '\t' ), cStr( '"' ),
- bFormulas( FALSE ), bIncludeFiltered( TRUE ),
- bAll( TRUE ), bSingle( TRUE ), bUndo( FALSE ),
- bOverflow( FALSE ), mbApi( true ), mExportTextOptions()
+ bFormulas( false ), bIncludeFiltered( sal_True ),
+ bAll( sal_True ), bSingle( sal_True ), bUndo( false ),
+ bOverflow( false ), mbApi( true ), mExportTextOptions()
{
pUndoDoc = NULL;
pExtOptions = NULL;
@@ -128,9 +128,9 @@ ScImportExport::ScImportExport( ScDocument* p, const ScAddress& rPt )
: pDocSh( PTR_CAST(ScDocShell,p->GetDocumentShell()) ), pDoc( p ),
aRange( rPt ),
nSizeLimit( 0 ), cSep( '\t' ), cStr( '"' ),
- bFormulas( FALSE ), bIncludeFiltered( TRUE ),
- bAll( FALSE ), bSingle( TRUE ), bUndo( BOOL( pDocSh != NULL ) ),
- bOverflow( FALSE ), mbApi( true ), mExportTextOptions()
+ bFormulas( false ), bIncludeFiltered( sal_True ),
+ bAll( false ), bSingle( sal_True ), bUndo( sal_Bool( pDocSh != NULL ) ),
+ bOverflow( false ), mbApi( true ), mExportTextOptions()
{
pUndoDoc = NULL;
pExtOptions = NULL;
@@ -138,15 +138,15 @@ ScImportExport::ScImportExport( ScDocument* p, const ScAddress& rPt )
// ctor with a range is only used for export
-//! ctor with a string (and bSingle=TRUE) is also used for DdeSetData
+//! ctor with a string (and bSingle=sal_True) is also used for DdeSetData
ScImportExport::ScImportExport( ScDocument* p, const ScRange& r )
: pDocSh( PTR_CAST(ScDocShell,p->GetDocumentShell()) ), pDoc( p ),
aRange( r ),
nSizeLimit( 0 ), cSep( '\t' ), cStr( '"' ),
- bFormulas( FALSE ), bIncludeFiltered( TRUE ),
- bAll( FALSE ), bSingle( FALSE ), bUndo( BOOL( pDocSh != NULL ) ),
- bOverflow( FALSE ), mbApi( true ), mExportTextOptions()
+ bFormulas( false ), bIncludeFiltered( sal_True ),
+ bAll( false ), bSingle( false ), bUndo( sal_Bool( pDocSh != NULL ) ),
+ bOverflow( false ), mbApi( true ), mExportTextOptions()
{
pUndoDoc = NULL;
pExtOptions = NULL;
@@ -161,9 +161,9 @@ ScImportExport::ScImportExport( ScDocument* p, const ScRange& r )
ScImportExport::ScImportExport( ScDocument* p, const String& rPos )
: pDocSh( PTR_CAST(ScDocShell,p->GetDocumentShell()) ), pDoc( p ),
nSizeLimit( 0 ), cSep( '\t' ), cStr( '"' ),
- bFormulas( FALSE ), bIncludeFiltered( TRUE ),
- bAll( FALSE ), bSingle( TRUE ), bUndo( BOOL( pDocSh != NULL ) ),
- bOverflow( FALSE ), mbApi( true ), mExportTextOptions()
+ bFormulas( false ), bIncludeFiltered( sal_True ),
+ bAll( false ), bSingle( sal_True ), bUndo( sal_Bool( pDocSh != NULL ) ),
+ bOverflow( false ), mbApi( true ), mExportTextOptions()
{
pUndoDoc = NULL;
pExtOptions = NULL;
@@ -187,12 +187,12 @@ ScImportExport::ScImportExport( ScDocument* p, const String& rPos )
formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
// Bereich?
if( aRange.Parse( aPos, pDoc, eConv ) & SCA_VALID )
- bSingle = FALSE;
+ bSingle = false;
// Zelle?
else if( aRange.aStart.Parse( aPos, pDoc, eConv ) & SCA_VALID )
aRange.aEnd = aRange.aStart;
else
- bAll = TRUE;
+ bAll = sal_True;
}
@@ -217,9 +217,9 @@ void ScImportExport::SetExtOptions( const ScAsciiOptions& rOpt )
}
-BOOL ScImportExport::IsFormatSupported( ULONG nFormat )
+sal_Bool ScImportExport::IsFormatSupported( sal_uLong nFormat )
{
- return BOOL( nFormat == FORMAT_STRING
+ return sal_Bool( nFormat == FORMAT_STRING
|| nFormat == SOT_FORMATSTR_ID_SYLK
|| nFormat == SOT_FORMATSTR_ID_LINK
|| nFormat == SOT_FORMATSTR_ID_HTML
@@ -233,7 +233,7 @@ BOOL ScImportExport::IsFormatSupported( ULONG nFormat )
// Vorbereitung fuer Undo: Undo-Dokument erzeugen
-BOOL ScImportExport::StartPaste()
+sal_Bool ScImportExport::StartPaste()
{
if ( !bAll )
{
@@ -243,16 +243,16 @@ BOOL ScImportExport::StartPaste()
InfoBox aInfoBox(Application::GetDefDialogParent(),
ScGlobal::GetRscString( aTester.GetMessageId() ) );
aInfoBox.Execute();
- return FALSE;
+ return false;
}
}
if( bUndo && pDocSh && pDoc->IsUndoEnabled())
{
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
pUndoDoc->InitUndo( pDoc, aRange.aStart.Tab(), aRange.aEnd.Tab() );
- pDoc->CopyToDocument( aRange, IDF_ALL | IDF_NOCAPTIONS, FALSE, pUndoDoc );
+ pDoc->CopyToDocument( aRange, IDF_ALL | IDF_NOCAPTIONS, false, pUndoDoc );
}
- return TRUE;
+ return sal_True;
}
// Nachbereitung Insert: Undo/Redo-Aktionen erzeugen, Invalidate/Repaint
@@ -260,14 +260,14 @@ BOOL ScImportExport::StartPaste()
void ScImportExport::EndPaste()
{
- BOOL bHeight = pDocSh && pDocSh->AdjustRowHeight(
+ sal_Bool bHeight = pDocSh && pDocSh->AdjustRowHeight(
aRange.aStart.Row(), aRange.aEnd.Row(), aRange.aStart.Tab() );
if( pUndoDoc && pDoc->IsUndoEnabled() )
{
ScDocument* pRedoDoc = new ScDocument( SCDOCMODE_UNDO );
pRedoDoc->InitUndo( pDoc, aRange.aStart.Tab(), aRange.aEnd.Tab() );
- pDoc->CopyToDocument( aRange, IDF_ALL | IDF_NOCAPTIONS, FALSE, pRedoDoc );
+ pDoc->CopyToDocument( aRange, IDF_ALL | IDF_NOCAPTIONS, false, pRedoDoc );
ScMarkData aDestMark;
aDestMark.SelectOneTable( aRange.aStart.Tab() );
pDocSh->GetUndoManager()->AddUndoAction(
@@ -291,14 +291,14 @@ void ScImportExport::EndPaste()
/////////////////////////////////////////////////////////////////////////////
-BOOL ScImportExport::ImportData( const String& /* rMimeType */,
+sal_Bool ScImportExport::ImportData( const String& /* rMimeType */,
const ::com::sun::star::uno::Any & /* rValue */ )
{
DBG_ASSERT( !this, "Implementation is missing" );
- return FALSE;
+ return false;
}
-BOOL ScImportExport::ExportData( const String& rMimeType,
+sal_Bool ScImportExport::ExportData( const String& rMimeType,
::com::sun::star::uno::Any & rValue )
{
SvMemoryStream aStrm;
@@ -306,17 +306,17 @@ BOOL ScImportExport::ExportData( const String& rMimeType,
if( ExportStream( aStrm, String(),
SotExchange::GetFormatIdFromMimeType( rMimeType ) ))
{
- aStrm << (BYTE) 0;
+ aStrm << (sal_uInt8) 0;
rValue <<= ::com::sun::star::uno::Sequence< sal_Int8 >(
(sal_Int8*)aStrm.GetData(),
aStrm.Seek( STREAM_SEEK_TO_END ) );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return false;
}
-BOOL ScImportExport::ImportString( const ::rtl::OUString& rText, ULONG nFmt )
+sal_Bool ScImportExport::ImportString( const ::rtl::OUString& rText, sal_uLong nFmt )
{
switch ( nFmt )
{
@@ -341,14 +341,14 @@ BOOL ScImportExport::ImportString( const ::rtl::OUString& rText, ULONG nFmt )
}
-BOOL ScImportExport::ExportString( ::rtl::OUString& rText, ULONG nFmt )
+sal_Bool ScImportExport::ExportString( ::rtl::OUString& rText, sal_uLong nFmt )
{
DBG_ASSERT( nFmt == FORMAT_STRING, "ScImportExport::ExportString: Unicode not supported for other formats than FORMAT_STRING" );
if ( nFmt != FORMAT_STRING )
{
rtl_TextEncoding eEnc = gsl_getSystemTextEncoding();
ByteString aTmp;
- BOOL bOk = ExportByteString( aTmp, eEnc, nFmt );
+ sal_Bool bOk = ExportByteString( aTmp, eEnc, nFmt );
rText = UniString( aTmp, eEnc );
return bOk;
}
@@ -364,16 +364,16 @@ BOOL ScImportExport::ExportString( ::rtl::OUString& rText, ULONG nFmt )
aStrm.Seek( STREAM_SEEK_TO_END );
rText = rtl::OUString( (const sal_Unicode*) aStrm.GetData() );
- return TRUE;
+ return sal_True;
}
rText = rtl::OUString();
- return FALSE;
+ return false;
// ExportStream must handle RTL_TEXTENCODING_UNICODE
}
-BOOL ScImportExport::ExportByteString( ByteString& rText, rtl_TextEncoding eEnc, ULONG nFmt )
+sal_Bool ScImportExport::ExportByteString( ByteString& rText, rtl_TextEncoding eEnc, sal_uLong nFmt )
{
DBG_ASSERT( eEnc != RTL_TEXTENCODING_UNICODE, "ScImportExport::ExportByteString: Unicode not supported" );
if ( eEnc == RTL_TEXTENCODING_UNICODE )
@@ -391,74 +391,74 @@ BOOL ScImportExport::ExportByteString( ByteString& rText, rtl_TextEncoding eEnc,
aStrm << (sal_Char) 0;
aStrm.Seek( STREAM_SEEK_TO_END );
// Sicherheits-Check:
- if( aStrm.Tell() <= (ULONG) STRING_MAXLEN )
+ if( aStrm.Tell() <= (sal_uLong) STRING_MAXLEN )
{
rText = (const sal_Char*) aStrm.GetData();
- return TRUE;
+ return sal_True;
}
}
rText.Erase();
- return FALSE;
+ return false;
}
-BOOL ScImportExport::ImportStream( SvStream& rStrm, const String& rBaseURL, ULONG nFmt )
+sal_Bool ScImportExport::ImportStream( SvStream& rStrm, const String& rBaseURL, sal_uLong nFmt )
{
if( nFmt == FORMAT_STRING )
{
if( ExtText2Doc( rStrm ) ) // pExtOptions auswerten
- return TRUE;
+ return sal_True;
}
if( nFmt == SOT_FORMATSTR_ID_SYLK )
{
if( Sylk2Doc( rStrm ) )
- return TRUE;
+ return sal_True;
}
if( nFmt == SOT_FORMATSTR_ID_DIF )
{
if( Dif2Doc( rStrm ) )
- return TRUE;
+ return sal_True;
}
if( nFmt == FORMAT_RTF )
{
if( RTF2Doc( rStrm, rBaseURL ) )
- return TRUE;
+ return sal_True;
}
if( nFmt == SOT_FORMATSTR_ID_LINK )
- return TRUE; // Link-Import?
+ return sal_True; // Link-Import?
if ( nFmt == SOT_FORMATSTR_ID_HTML )
{
if( HTML2Doc( rStrm, rBaseURL ) )
- return TRUE;
+ return sal_True;
}
if ( nFmt == SOT_FORMATSTR_ID_HTML_SIMPLE )
{
MSE40HTMLClipFormatObj aMSE40ClpObj; // needed to skip the header data
SvStream* pHTML = aMSE40ClpObj.IsValid( rStrm );
if ( pHTML && HTML2Doc( *pHTML, rBaseURL ) )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return false;
}
-BOOL ScImportExport::ExportStream( SvStream& rStrm, const String& rBaseURL, ULONG nFmt )
+sal_Bool ScImportExport::ExportStream( SvStream& rStrm, const String& rBaseURL, sal_uLong nFmt )
{
if( nFmt == FORMAT_STRING )
{
if( Doc2Text( rStrm ) )
- return TRUE;
+ return sal_True;
}
if( nFmt == SOT_FORMATSTR_ID_SYLK )
{
if( Doc2Sylk( rStrm ) )
- return TRUE;
+ return sal_True;
}
if( nFmt == SOT_FORMATSTR_ID_DIF )
{
if( Doc2Dif( rStrm ) )
- return TRUE;
+ return sal_True;
}
if( nFmt == SOT_FORMATSTR_ID_LINK && !bAll )
{
@@ -476,7 +476,7 @@ BOOL ScImportExport::ExportStream( SvStream& rStrm, const String& rBaseURL, ULON
if( aDocName.Len() )
{
String aRefName;
- USHORT nFlags = SCA_VALID | SCA_TAB_3D;
+ sal_uInt16 nFlags = SCA_VALID | SCA_TAB_3D;
if( bSingle )
aRange.aStart.Format( aRefName, nFlags, pDoc, pDoc->GetAddressConvention() );
else
@@ -487,32 +487,32 @@ BOOL ScImportExport::ExportStream( SvStream& rStrm, const String& rBaseURL, ULON
}
String aAppName = Application::GetAppName();
- WriteUnicodeOrByteString( rStrm, aAppName, TRUE );
- WriteUnicodeOrByteString( rStrm, aDocName, TRUE );
- WriteUnicodeOrByteString( rStrm, aRefName, TRUE );
+ WriteUnicodeOrByteString( rStrm, aAppName, sal_True );
+ WriteUnicodeOrByteString( rStrm, aDocName, sal_True );
+ WriteUnicodeOrByteString( rStrm, aRefName, sal_True );
if ( rStrm.GetStreamCharSet() == RTL_TEXTENCODING_UNICODE )
rStrm << sal_Unicode(0);
else
rStrm << sal_Char(0);
- return BOOL( rStrm.GetError() == SVSTREAM_OK );
+ return sal_Bool( rStrm.GetError() == SVSTREAM_OK );
}
}
if( nFmt == SOT_FORMATSTR_ID_HTML )
{
if( Doc2HTML( rStrm, rBaseURL ) )
- return TRUE;
+ return sal_True;
}
if( nFmt == FORMAT_RTF )
{
if( Doc2RTF( rStrm ) )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return false;
}
-void ScImportExport::WriteUnicodeOrByteString( SvStream& rStrm, const String& rString, BOOL bZero )
+void ScImportExport::WriteUnicodeOrByteString( SvStream& rStrm, const String& rString, sal_Bool bZero )
{
rtl_TextEncoding eEnc = rStrm.GetStreamCharSet();
if ( eEnc == RTL_TEXTENCODING_UNICODE )
@@ -575,10 +575,10 @@ static const sal_Unicode* lcl_ScanString( const sal_Unicode* p, String& rString,
sal_Unicode cStr, DoubledQuoteMode eMode )
{
p++; //! jump over opening quote
- BOOL bCont;
+ sal_Bool bCont;
do
{
- bCont = FALSE;
+ bCont = false;
const sal_Unicode* p0 = p;
for( ;; )
{
@@ -596,7 +596,7 @@ static const sal_Unicode* lcl_ScanString( const sal_Unicode* p, String& rString,
break;
case DQM_ESCAPE :
p++; // one for us (breaking for-loop)
- bCont = TRUE; // and more
+ bCont = sal_True; // and more
break;
case DQM_CONCAT :
if ( p0+1 < p )
@@ -770,18 +770,17 @@ inline void lcl_WriteSimpleString( SvStream& rStrm, const String& rString )
//////////////////////////////////////////////////////////////////////////////
-BOOL ScImportExport::Text2Doc( SvStream& rStrm )
+sal_Bool ScImportExport::Text2Doc( SvStream& rStrm )
{
- BOOL bOk = TRUE;
+ sal_Bool bOk = sal_True;
SCCOL nStartCol = aRange.aStart.Col();
SCROW nStartRow = aRange.aStart.Row();
SCCOL nEndCol = aRange.aEnd.Col();
SCROW nEndRow = aRange.aEnd.Row();
- ULONG nOldPos = rStrm.Tell();
- if ( rStrm.GetStreamCharSet() == RTL_TEXTENCODING_UNICODE )
- rStrm.StartReadingUnicodeText();
- BOOL bData = BOOL( !bSingle );
+ sal_uLong nOldPos = rStrm.Tell();
+ rStrm.StartReadingUnicodeText( rStrm.GetStreamCharSet() );
+ sal_Bool bData = sal_Bool( !bSingle );
if( !bSingle)
bOk = StartPaste();
@@ -829,7 +828,7 @@ BOOL ScImportExport::Text2Doc( SvStream& rStrm )
pDoc->SetString( nCol, nRow, aRange.aStart.Tab(), aCell );
}
else // zuviele Spalten/Zeilen
- bOverflow = TRUE; // beim Import Warnung ausgeben
+ bOverflow = sal_True; // beim Import Warnung ausgeben
++nCol;
}
++nRow;
@@ -840,7 +839,7 @@ BOOL ScImportExport::Text2Doc( SvStream& rStrm )
aRange.aEnd.SetCol( nEndCol );
aRange.aEnd.SetRow( nEndRow );
bOk = StartPaste();
- bData = TRUE;
+ bData = sal_True;
}
else
break;
@@ -856,7 +855,7 @@ BOOL ScImportExport::Text2Doc( SvStream& rStrm )
static bool lcl_PutString(
- ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rStr, BYTE nColFormat,
+ ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rStr, sal_uInt8 nColFormat,
SvNumberFormatter* pFormatter, bool bDetectNumFormat,
::utl::TransliterationWrapper& rTransliteration, CalendarWrapper& rCalendar,
::utl::TransliterationWrapper* pSecondTransliteration, CalendarWrapper* pSecondCalendar )
@@ -900,12 +899,12 @@ static bool lcl_PutString(
}
else if ( nColFormat != SC_COL_STANDARD ) // Datumsformate
{
- const USHORT nMaxNumberParts = 7; // Y-M-D h:m:s.t
+ const sal_uInt16 nMaxNumberParts = 7; // Y-M-D h:m:s.t
xub_StrLen nLen = rStr.Len();
xub_StrLen nStart[nMaxNumberParts];
xub_StrLen nEnd[nMaxNumberParts];
- USHORT nDP, nMP, nYP;
+ sal_uInt16 nDP, nMP, nYP;
switch ( nColFormat )
{
case SC_COL_YMD: nDP = 2; nMP = 1; nYP = 0; break;
@@ -914,28 +913,28 @@ static bool lcl_PutString(
default: nDP = 0; nMP = 1; nYP = 2; break;
}
- USHORT nFound = 0;
- BOOL bInNum = FALSE;
+ sal_uInt16 nFound = 0;
+ sal_Bool bInNum = false;
for ( xub_StrLen nPos=0; nPos<nLen && (bInNum ||
nFound<nMaxNumberParts); nPos++ )
{
if (bInNum && nFound == 3 && nColFormat == SC_COL_YMD &&
nPos <= nStart[nFound]+2 && rStr.GetChar(nPos) == 'T')
- bInNum = FALSE; // ISO-8601: YYYY-MM-DDThh:mm...
+ bInNum = false; // ISO-8601: YYYY-MM-DDThh:mm...
else if ((((!bInNum && nFound==nMP) || (bInNum && nFound==nMP+1))
&& ScGlobal::pCharClass->isLetterNumeric( rStr, nPos))
|| ScGlobal::pCharClass->isDigit( rStr, nPos))
{
if (!bInNum)
{
- bInNum = TRUE;
+ bInNum = sal_True;
nStart[nFound] = nPos;
++nFound;
}
nEnd[nFound-1] = nPos;
}
else
- bInNum = FALSE;
+ bInNum = false;
}
if ( nFound == 1 )
@@ -952,13 +951,13 @@ static bool lcl_PutString(
// 8 digits: 4 for year, 2 each for day and month
// 5 or 7 digits: first field is shortened by 1
- BOOL bLongYear = ( nDateLen >= 7 );
- BOOL bShortFirst = ( nDateLen == 5 || nDateLen == 7 );
+ sal_Bool bLongYear = ( nDateLen >= 7 );
+ sal_Bool bShortFirst = ( nDateLen == 5 || nDateLen == 7 );
- USHORT nFieldStart = nDateStart;
- for (USHORT nPos=0; nPos<3; nPos++)
+ sal_uInt16 nFieldStart = nDateStart;
+ for (sal_uInt16 nPos=0; nPos<3; nPos++)
{
- USHORT nFieldEnd = nFieldStart + 1; // default: 2 digits
+ sal_uInt16 nFieldEnd = nFieldStart + 1; // default: 2 digits
if ( bLongYear && nPos == nYP )
nFieldEnd += 2; // 2 extra digits for long year
if ( bShortFirst && nPos == 0 )
@@ -975,9 +974,9 @@ static bool lcl_PutString(
if ( nFound >= 3 )
{
using namespace ::com::sun::star;
- BOOL bSecondCal = FALSE;
- USHORT nDay = (USHORT) rStr.Copy( nStart[nDP], nEnd[nDP]+1-nStart[nDP] ).ToInt32();
- USHORT nYear = (USHORT) rStr.Copy( nStart[nYP], nEnd[nYP]+1-nStart[nYP] ).ToInt32();
+ sal_Bool bSecondCal = false;
+ sal_uInt16 nDay = (sal_uInt16) rStr.Copy( nStart[nDP], nEnd[nDP]+1-nStart[nDP] ).ToInt32();
+ sal_uInt16 nYear = (sal_uInt16) rStr.Copy( nStart[nYP], nEnd[nYP]+1-nStart[nYP] ).ToInt32();
String aMStr = rStr.Copy( nStart[nMP], nEnd[nMP]+1-nStart[nMP] );
sal_Int16 nMonth = (sal_Int16) aMStr.ToInt32();
if (!nMonth)
@@ -1013,14 +1012,14 @@ static bool lcl_PutString(
pSecondTransliteration->isEqual( aMStr, xMonths[i].AbbrevName ) )
{
nMonth = sal::static_int_cast<sal_Int16>( i+1 );
- bSecondCal = TRUE;
+ bSecondCal = sal_True;
}
else if ( i == 8 && pSecondTransliteration->isEqual(
aMStr, aSepShortened ) )
{ // correct English abbreviation is SEPT,
// but data mostly contains SEP only
nMonth = sal::static_int_cast<sal_Int16>( i+1 );
- bSecondCal = TRUE;
+ bSecondCal = sal_True;
}
}
}
@@ -1076,12 +1075,12 @@ static bool lcl_PutString(
LanguageType eDocLang = eLatin; //! which language for date formats?
short nType = (nFound > 3 ? NUMBERFORMAT_DATETIME : NUMBERFORMAT_DATE);
- ULONG nFormat = pDocFormatter->GetStandardFormat( nType, eDocLang );
+ sal_uLong nFormat = pDocFormatter->GetStandardFormat( nType, eDocLang );
// maybe there is a special format including seconds or milliseconds
if (nFound > 5)
nFormat = pDocFormatter->GetStandardFormat( fDays, nFormat, nType, eDocLang);
- pDoc->PutCell( nCol, nRow, nTab, new ScValueCell(fDays), nFormat, FALSE );
+ pDoc->PutCell( nCol, nRow, nTab, new ScValueCell(fDays), nFormat, false );
return bMultiLine; // success
}
@@ -1128,18 +1127,17 @@ String lcl_GetFixed( const String& rLine, xub_StrLen nStart, xub_StrLen nNext, b
return rLine.Copy(nStart, nSpace-nStart);
}
-BOOL ScImportExport::ExtText2Doc( SvStream& rStrm )
+sal_Bool ScImportExport::ExtText2Doc( SvStream& rStrm )
{
if (!pExtOptions)
return Text2Doc( rStrm );
- ULONG nOldPos = rStrm.Tell();
+ sal_uLong nOldPos = rStrm.Tell();
rStrm.Seek( STREAM_SEEK_TO_END );
::std::auto_ptr<ScProgress> xProgress( new ScProgress( pDocSh,
ScGlobal::GetRscString( STR_LOAD_DOC ), rStrm.Tell() - nOldPos ));
rStrm.Seek( nOldPos );
- if ( rStrm.GetStreamCharSet() == RTL_TEXTENCODING_UNICODE )
- rStrm.StartReadingUnicodeText();
+ rStrm.StartReadingUnicodeText( rStrm.GetStreamCharSet() );
ScColumn::DoubleAllocSwitch aAllocSwitch(true);
@@ -1148,13 +1146,13 @@ BOOL ScImportExport::ExtText2Doc( SvStream& rStrm )
SCROW nStartRow = aRange.aStart.Row();
SCTAB nTab = aRange.aStart.Tab();
- BOOL bFixed = pExtOptions->IsFixedLen();
+ sal_Bool bFixed = pExtOptions->IsFixedLen();
const String& rSeps = pExtOptions->GetFieldSeps();
const sal_Unicode* pSeps = rSeps.GetBuffer();
- BOOL bMerge = pExtOptions->IsMergeSeps();
- USHORT nInfoCount = pExtOptions->GetInfoCount();
+ sal_Bool bMerge = pExtOptions->IsMergeSeps();
+ sal_uInt16 nInfoCount = pExtOptions->GetInfoCount();
const xub_StrLen* pColStart = pExtOptions->GetColStart();
- const BYTE* pColFormat = pExtOptions->GetColFormat();
+ const sal_uInt8* pColFormat = pExtOptions->GetColFormat();
long nSkipLines = pExtOptions->GetStartRow();
LanguageType eDocLang = pExtOptions->GetLanguage();
@@ -1181,7 +1179,7 @@ BOOL ScImportExport::ExtText2Doc( SvStream& rStrm )
}
String aLine, aCell;
- USHORT i;
+ sal_uInt16 i;
SCROW nRow = nStartRow;
while(--nSkipLines>0)
@@ -1203,7 +1201,7 @@ BOOL ScImportExport::ExtText2Doc( SvStream& rStrm )
bool bQuotedAsText = pExtOptions && pExtOptions->IsQuotedAsText();
- ULONG nOriginalStreamPos = rStrm.Tell();
+ sal_uLong nOriginalStreamPos = rStrm.Tell();
do
{
@@ -1224,11 +1222,11 @@ BOOL ScImportExport::ExtText2Doc( SvStream& rStrm )
// SC_COL_SKIP.
for ( i=0; i<nInfoCount && nCol <= MAXCOL+1; i++ )
{
- BYTE nFmt = pColFormat[i];
+ sal_uInt8 nFmt = pColFormat[i];
if (nFmt != SC_COL_SKIP) // sonst auch nCol nicht hochzaehlen
{
if (nCol > MAXCOL)
- bOverflow = TRUE; // display warning on import
+ bOverflow = sal_True; // display warning on import
else if (!bDetermineRange)
{
xub_StrLen nStart = pColStart[i];
@@ -1250,7 +1248,7 @@ BOOL ScImportExport::ExtText2Doc( SvStream& rStrm )
else // Nach Trennzeichen suchen
{
SCCOL nSourceCol = 0;
- USHORT nInfoStart = 0;
+ sal_uInt16 nInfoStart = 0;
const sal_Unicode* p = aLine.GetBuffer();
// Yes, the check is nCol<=MAXCOL+1, +1 because it is only an
// overflow if there is really data following to be put behind
@@ -1261,7 +1259,7 @@ BOOL ScImportExport::ExtText2Doc( SvStream& rStrm )
bool bIsQuoted = false;
p = ScImportExport::ScanNextFieldFromString( p, aCell, cStr, pSeps, bMerge, bIsQuoted );
- BYTE nFmt = SC_COL_STANDARD;
+ sal_uInt8 nFmt = SC_COL_STANDARD;
for ( i=nInfoStart; i<nInfoCount; i++ )
{
if ( pColStart[i] == nSourceCol + 1 ) // pColStart ist 1-basiert
@@ -1274,7 +1272,7 @@ BOOL ScImportExport::ExtText2Doc( SvStream& rStrm )
if ( nFmt != SC_COL_SKIP )
{
if (nCol > MAXCOL)
- bOverflow = TRUE; // display warning on import
+ bOverflow = sal_True; // display warning on import
else if (!bDetermineRange)
{
if (bIsQuoted && bQuotedAsText)
@@ -1303,7 +1301,7 @@ BOOL ScImportExport::ExtText2Doc( SvStream& rStrm )
++nRow;
if ( nRow > MAXROW )
{
- bOverflow = TRUE; // display warning on import
+ bOverflow = sal_True; // display warning on import
break; // for
}
}
@@ -1326,7 +1324,7 @@ BOOL ScImportExport::ExtText2Doc( SvStream& rStrm )
{
delete pEnglishTransliteration;
delete pEnglishCalendar;
- return FALSE;
+ return false;
}
}
@@ -1335,7 +1333,7 @@ BOOL ScImportExport::ExtText2Doc( SvStream& rStrm )
if (!StartPaste())
{
EndPaste();
- return FALSE;
+ return false;
}
}
@@ -1351,7 +1349,7 @@ BOOL ScImportExport::ExtText2Doc( SvStream& rStrm )
if (bRangeIsDetermined)
EndPaste();
- return TRUE;
+ return sal_True;
}
@@ -1424,7 +1422,7 @@ bool hasLineBreaksOrSeps( const String& rStr, sal_Unicode cSep )
}
-BOOL ScImportExport::Doc2Text( SvStream& rStrm )
+sal_Bool ScImportExport::Doc2Text( SvStream& rStrm )
{
SCCOL nCol;
SCROW nRow;
@@ -1520,14 +1518,14 @@ BOOL ScImportExport::Doc2Text( SvStream& rStrm )
}
}
- return BOOL( rStrm.GetError() == SVSTREAM_OK );
+ return sal_Bool( rStrm.GetError() == SVSTREAM_OK );
}
-BOOL ScImportExport::Sylk2Doc( SvStream& rStrm )
+sal_Bool ScImportExport::Sylk2Doc( SvStream& rStrm )
{
- BOOL bOk = TRUE;
- BOOL bMyDoc = FALSE;
+ sal_Bool bOk = sal_True;
+ sal_Bool bMyDoc = false;
SylkVersion eVersion = SYLK_OTHER;
// US-English separators for StringToDouble
@@ -1538,8 +1536,8 @@ BOOL ScImportExport::Sylk2Doc( SvStream& rStrm )
SCROW nStartRow = aRange.aStart.Row();
SCCOL nEndCol = aRange.aEnd.Col();
SCROW nEndRow = aRange.aEnd.Row();
- ULONG nOldPos = rStrm.Tell();
- BOOL bData = BOOL( !bSingle );
+ sal_uLong nOldPos = rStrm.Tell();
+ sal_Bool bData = sal_Bool( !bSingle );
SvULongs aFormats;
if( !bSingle)
@@ -1567,7 +1565,7 @@ BOOL ScImportExport::Sylk2Doc( SvStream& rStrm )
if( cTag == 'C' ) // Content
{
if( *p++ != ';' )
- return FALSE;
+ return false;
while( *p )
{
sal_Unicode ch = *p++;
@@ -1601,15 +1599,15 @@ BOOL ScImportExport::Sylk2Doc( SvStream& rStrm )
nEndCol = nCol;
break;
}
- BOOL bText;
+ sal_Bool bText;
if( *p == '"' )
{
- bText = TRUE;
+ bText = sal_True;
aText.Erase();
p = lcl_ScanSylkString( p, aText, eVersion);
}
else
- bText = FALSE;
+ bText = false;
const sal_Unicode* q = p;
while( *q && *q != ';' )
q++;
@@ -1619,7 +1617,7 @@ BOOL ScImportExport::Sylk2Doc( SvStream& rStrm )
{
pDoc->PutCell( nCol, nRow, aRange.aStart.Tab(),
ScBaseCell::CreateTextCell( aText, pDoc),
- (BOOL) TRUE);
+ (sal_Bool) sal_True);
}
else
{
@@ -1663,7 +1661,7 @@ BOOL ScImportExport::Sylk2Doc( SvStream& rStrm )
if ( ch == 'M' )
{
ScMarkData aMark;
- aMark.SelectTable( aPos.Tab(), TRUE );
+ aMark.SelectTable( aPos.Tab(), sal_True );
pDoc->InsertMatrixFormula( nCol, nRow, nRefCol,
nRefRow, aMark, EMPTY_STRING, pCode );
}
@@ -1686,7 +1684,7 @@ BOOL ScImportExport::Sylk2Doc( SvStream& rStrm )
else if( cTag == 'F' ) // Format
{
if( *p++ != ';' )
- return FALSE;
+ return false;
sal_Int32 nFormat = -1;
while( *p )
{
@@ -1728,7 +1726,7 @@ BOOL ScImportExport::Sylk2Doc( SvStream& rStrm )
}
if ( 0 <= nFormat && nFormat < aFormats.Count() )
{
- ULONG nKey = aFormats[(USHORT)nFormat];
+ sal_uLong nKey = aFormats[(sal_uInt16)nFormat];
pDoc->ApplyAttr( nCol, nRow, aRange.aStart.Tab(),
SfxUInt32Item( ATTR_VALUE_FORMAT, nKey ) );
}
@@ -1775,7 +1773,7 @@ BOOL ScImportExport::Sylk2Doc( SvStream& rStrm )
aRange.aEnd.SetCol( nEndCol );
aRange.aEnd.SetRow( nEndRow );
bOk = StartPaste();
- bData = TRUE;
+ bData = sal_True;
}
else
break;
@@ -1786,7 +1784,7 @@ BOOL ScImportExport::Sylk2Doc( SvStream& rStrm )
}
-BOOL ScImportExport::Doc2Sylk( SvStream& rStrm )
+sal_Bool ScImportExport::Doc2Sylk( SvStream& rStrm )
{
SCCOL nCol;
SCROW nRow;
@@ -1806,7 +1804,7 @@ BOOL ScImportExport::Doc2Sylk( SvStream& rStrm )
{
String aBufStr;
double nVal;
- BOOL bForm = FALSE;
+ sal_Bool bForm = false;
SCROW r = nRow - nStartRow + 1;
SCCOL c = nCol - nStartCol + 1;
ScBaseCell* pCell;
@@ -1827,7 +1825,7 @@ BOOL ScImportExport::Doc2Sylk( SvStream& rStrm )
aValStr = ::rtl::math::doubleToUString( nVal,
rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', TRUE );
+ rtl_math_DecimalPlaces_Max, '.', sal_True );
aBufStr.AssignAscii(RTL_CONSTASCII_STRINGPARAM( "C;X" ));
aBufStr += String::CreateFromInt32( c );
@@ -1926,35 +1924,35 @@ BOOL ScImportExport::Doc2Sylk( SvStream& rStrm )
}
lcl_WriteSimpleString( rStrm, String( 'E' ) );
WriteUnicodeOrByteEndl( rStrm );
- return BOOL( rStrm.GetError() == SVSTREAM_OK );
+ return sal_Bool( rStrm.GetError() == SVSTREAM_OK );
}
-BOOL ScImportExport::Doc2HTML( SvStream& rStrm, const String& rBaseURL )
+sal_Bool ScImportExport::Doc2HTML( SvStream& rStrm, const String& rBaseURL )
{
// CharSet is ignored in ScExportHTML, read from Load/Save HTML options
ScFormatFilter::Get().ScExportHTML( rStrm, rBaseURL, pDoc, aRange, RTL_TEXTENCODING_DONTKNOW, bAll,
aStreamPath, aNonConvertibleChars );
- return BOOL( rStrm.GetError() == SVSTREAM_OK );
+ return sal_Bool( rStrm.GetError() == SVSTREAM_OK );
}
-BOOL ScImportExport::Doc2RTF( SvStream& rStrm )
+sal_Bool ScImportExport::Doc2RTF( SvStream& rStrm )
{
// CharSet is ignored in ScExportRTF
ScFormatFilter::Get().ScExportRTF( rStrm, pDoc, aRange, RTL_TEXTENCODING_DONTKNOW );
- return BOOL( rStrm.GetError() == SVSTREAM_OK );
+ return sal_Bool( rStrm.GetError() == SVSTREAM_OK );
}
-BOOL ScImportExport::Doc2Dif( SvStream& rStrm )
+sal_Bool ScImportExport::Doc2Dif( SvStream& rStrm )
{
// for DIF in the clipboard, IBM_850 is always used
ScFormatFilter::Get().ScExportDif( rStrm, pDoc, aRange, RTL_TEXTENCODING_IBM_850 );
- return TRUE;
+ return sal_True;
}
-BOOL ScImportExport::Dif2Doc( SvStream& rStrm )
+sal_Bool ScImportExport::Dif2Doc( SvStream& rStrm )
{
SCTAB nTab = aRange.aStart.Tab();
ScDocument* pImportDoc = new ScDocument( SCDOCMODE_UNDO );
@@ -1973,12 +1971,12 @@ BOOL ScImportExport::Dif2Doc( SvStream& rStrm )
nEndRow = aRange.aStart.Row();
aRange.aEnd = ScAddress( nEndCol, nEndRow, nTab );
- BOOL bOk = StartPaste();
+ sal_Bool bOk = StartPaste();
if (bOk)
{
- USHORT nFlags = IDF_ALL & ~IDF_STYLES;
+ sal_uInt16 nFlags = IDF_ALL & ~IDF_STYLES;
pDoc->DeleteAreaTab( aRange, nFlags );
- pImportDoc->CopyToDocument( aRange, nFlags, FALSE, pDoc );
+ pImportDoc->CopyToDocument( aRange, nFlags, false, pDoc );
EndPaste();
}
@@ -1988,7 +1986,7 @@ BOOL ScImportExport::Dif2Doc( SvStream& rStrm )
}
-BOOL ScImportExport::RTF2Doc( SvStream& rStrm, const String& rBaseURL )
+sal_Bool ScImportExport::RTF2Doc( SvStream& rStrm, const String& rBaseURL )
{
ScEEAbsImport *pImp = ScFormatFilter::Get().CreateRTFImport( pDoc, aRange );
if (!pImp)
@@ -1996,10 +1994,10 @@ BOOL ScImportExport::RTF2Doc( SvStream& rStrm, const String& rBaseURL )
pImp->Read( rStrm, rBaseURL );
aRange = pImp->GetRange();
- BOOL bOk = StartPaste();
+ sal_Bool bOk = StartPaste();
if (bOk)
{
- USHORT nFlags = IDF_ALL & ~IDF_STYLES;
+ sal_uInt16 nFlags = IDF_ALL & ~IDF_STYLES;
pDoc->DeleteAreaTab( aRange, nFlags );
pImp->WriteToDocument();
EndPaste();
@@ -2009,15 +2007,15 @@ BOOL ScImportExport::RTF2Doc( SvStream& rStrm, const String& rBaseURL )
}
-BOOL ScImportExport::HTML2Doc( SvStream& rStrm, const String& rBaseURL )
+sal_Bool ScImportExport::HTML2Doc( SvStream& rStrm, const String& rBaseURL )
{
- ScEEAbsImport *pImp = ScFormatFilter::Get().CreateHTMLImport( pDoc, rBaseURL, aRange, TRUE);
+ ScEEAbsImport *pImp = ScFormatFilter::Get().CreateHTMLImport( pDoc, rBaseURL, aRange, sal_True);
if (!pImp)
return false;
pImp->Read( rStrm, rBaseURL );
aRange = pImp->GetRange();
- BOOL bOk = StartPaste();
+ sal_Bool bOk = StartPaste();
if (bOk)
{
// ScHTMLImport may call ScDocument::InitDrawLayer, resulting in
@@ -2025,7 +2023,7 @@ BOOL ScImportExport::HTML2Doc( SvStream& rStrm, const String& rBaseURL )
if (pDocSh)
pDocSh->MakeDrawLayer();
- USHORT nFlags = IDF_ALL & ~IDF_STYLES;
+ sal_uInt16 nFlags = IDF_ALL & ~IDF_STYLES;
pDoc->DeleteAreaTab( aRange, nFlags );
if (pExtOptions)
@@ -2058,21 +2056,21 @@ class ScFormatFilterMissing : public ScFormatFilterPlugin {
virtual FltError ScImportExcel( SfxMedium&, ScDocument*, const EXCIMPFORMAT ) RETURN_ERROR
virtual FltError ScImportStarCalc10( SvStream&, ScDocument* ) RETURN_ERROR
virtual FltError ScImportDif( SvStream&, ScDocument*, const ScAddress&,
- const CharSet, UINT32 ) RETURN_ERROR
+ const CharSet, sal_uInt32 ) RETURN_ERROR
virtual FltError ScImportRTF( SvStream&, const String&, ScDocument*, ScRange& ) RETURN_ERROR
- virtual FltError ScImportHTML( SvStream&, const String&, ScDocument*, ScRange&, double, BOOL, SvNumberFormatter*, bool ) RETURN_ERROR
+ virtual FltError ScImportHTML( SvStream&, const String&, ScDocument*, ScRange&, double, sal_Bool, SvNumberFormatter*, bool ) RETURN_ERROR
virtual ScEEAbsImport *CreateRTFImport( ScDocument*, const ScRange& ) { return NULL; }
- virtual ScEEAbsImport *CreateHTMLImport( ScDocument*, const String&, const ScRange&, BOOL ) { return NULL; }
+ virtual ScEEAbsImport *CreateHTMLImport( ScDocument*, const String&, const ScRange&, sal_Bool ) { return NULL; }
virtual String GetHTMLRangeNameList( ScDocument*, const String& ) { return String(); }
#if ENABLE_LOTUS123_EXPORT
virtual FltError ScExportLotus123( SvStream&, ScDocument*, ExportFormatLotus, CharSet ) RETURN_ERROR
#endif
virtual FltError ScExportExcel5( SfxMedium&, ScDocument*, ExportFormatExcel, CharSet ) RETURN_ERROR
- virtual FltError ScExportDif( SvStream&, ScDocument*, const ScAddress&, const CharSet, UINT32 ) RETURN_ERROR
- virtual FltError ScExportDif( SvStream&, ScDocument*, const ScRange&, const CharSet, UINT32 ) RETURN_ERROR
- virtual FltError ScExportHTML( SvStream&, const String&, ScDocument*, const ScRange&, const CharSet, BOOL,
+ virtual FltError ScExportDif( SvStream&, ScDocument*, const ScAddress&, const CharSet, sal_uInt32 ) RETURN_ERROR
+ virtual FltError ScExportDif( SvStream&, ScDocument*, const ScRange&, const CharSet, sal_uInt32 ) RETURN_ERROR
+ virtual FltError ScExportHTML( SvStream&, const String&, ScDocument*, const ScRange&, const CharSet, sal_Bool,
const String&, String& ) RETURN_ERROR
virtual FltError ScExportRTF( SvStream&, ScDocument*, const ScRange&, const CharSet ) RETURN_ERROR
};
diff --git a/sc/source/ui/docshell/olinefun.cxx b/sc/source/ui/docshell/olinefun.cxx
index dfbe7ed24fe0..6d35207b78ce 100644
--- a/sc/source/ui/docshell/olinefun.cxx
+++ b/sc/source/ui/docshell/olinefun.cxx
@@ -65,11 +65,11 @@ void lcl_InvalidateOutliner( SfxBindings* pBindings )
//! PaintWidthHeight zur DocShell verschieben?
void lcl_PaintWidthHeight( ScDocShell& rDocShell, SCTAB nTab,
- BOOL bColumns, SCCOLROW nStart, SCCOLROW nEnd )
+ sal_Bool bColumns, SCCOLROW nStart, SCCOLROW nEnd )
{
ScDocument* pDoc = rDocShell.GetDocument();
- USHORT nParts = PAINT_GRID;
+ sal_uInt16 nParts = PAINT_GRID;
SCCOL nStartCol = 0;
SCROW nStartRow = 0;
SCCOL nEndCol = MAXCOL; // fuer Test auf Merge
@@ -97,9 +97,9 @@ void lcl_PaintWidthHeight( ScDocShell& rDocShell, SCTAB nTab,
//------------------------------------------------------------------------
-BOOL ScOutlineDocFunc::MakeOutline( const ScRange& rRange, BOOL bColumns, BOOL bRecord, BOOL bApi )
+sal_Bool ScOutlineDocFunc::MakeOutline( const ScRange& rRange, sal_Bool bColumns, sal_Bool bRecord, sal_Bool bApi )
{
- BOOL bSuccess = FALSE;
+ sal_Bool bSuccess = false;
SCCOL nStartCol = rRange.aStart.Col();
SCROW nStartRow = rRange.aStart.Row();
SCCOL nEndCol = rRange.aEnd.Col();
@@ -107,19 +107,19 @@ BOOL ScOutlineDocFunc::MakeOutline( const ScRange& rRange, BOOL bColumns, BOOL b
SCTAB nTab = rRange.aStart.Tab();
ScDocument* pDoc = rDocShell.GetDocument();
- ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab, TRUE );
+ ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab, sal_True );
ScOutlineTable* pUndoTab = NULL;
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = FALSE;
+ bRecord = false;
if (bRecord)
pUndoTab = new ScOutlineTable( *pTable );
ScOutlineArray* pArray = bColumns ? pTable->GetColArray() : pTable->GetRowArray();
- BOOL bRes;
- BOOL bSize = FALSE;
+ sal_Bool bRes;
+ sal_Bool bSize = false;
if ( bColumns )
bRes = pArray->Insert( nStartCol, nEndCol, bSize );
else
@@ -132,13 +132,13 @@ BOOL ScOutlineDocFunc::MakeOutline( const ScRange& rRange, BOOL bColumns, BOOL b
rDocShell.GetUndoManager()->AddUndoAction(
new ScUndoMakeOutline( &rDocShell,
nStartCol,nStartRow,nTab,nEndCol,nEndRow,nTab,
- pUndoTab, bColumns, TRUE ) );
+ pUndoTab, bColumns, sal_True ) );
}
if (pDoc->IsStreamValid(nTab))
- pDoc->SetStreamValid(nTab, FALSE);
+ pDoc->SetStreamValid(nTab, false);
- USHORT nParts = 0; // Datenbereich nicht geaendert
+ sal_uInt16 nParts = 0; // Datenbereich nicht geaendert
if ( bColumns )
nParts |= PAINT_TOP;
else
@@ -149,7 +149,7 @@ BOOL ScOutlineDocFunc::MakeOutline( const ScRange& rRange, BOOL bColumns, BOOL b
rDocShell.PostPaint( 0,0,nTab, MAXCOL,MAXROW,nTab, nParts );
rDocShell.SetDocumentModified();
lcl_InvalidateOutliner( rDocShell.GetViewBindings() );
- bSuccess = TRUE;
+ bSuccess = sal_True;
}
else
{
@@ -161,9 +161,9 @@ BOOL ScOutlineDocFunc::MakeOutline( const ScRange& rRange, BOOL bColumns, BOOL b
return bSuccess;
}
-BOOL ScOutlineDocFunc::RemoveOutline( const ScRange& rRange, BOOL bColumns, BOOL bRecord, BOOL bApi )
+sal_Bool ScOutlineDocFunc::RemoveOutline( const ScRange& rRange, sal_Bool bColumns, sal_Bool bRecord, sal_Bool bApi )
{
- BOOL bDone = FALSE;
+ sal_Bool bDone = false;
SCCOL nStartCol = rRange.aStart.Col();
SCROW nStartRow = rRange.aStart.Row();
@@ -174,7 +174,7 @@ BOOL ScOutlineDocFunc::RemoveOutline( const ScRange& rRange, BOOL bColumns, BOOL
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = FALSE;
+ bRecord = false;
ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab );
if (pTable)
{
@@ -184,8 +184,8 @@ BOOL ScOutlineDocFunc::RemoveOutline( const ScRange& rRange, BOOL bColumns, BOOL
ScOutlineArray* pArray = bColumns ? pTable->GetColArray() : pTable->GetRowArray();
- BOOL bRes;
- BOOL bSize = FALSE;
+ sal_Bool bRes;
+ sal_Bool bSize = false;
if ( bColumns )
bRes = pArray->Remove( nStartCol, nEndCol, bSize );
else
@@ -198,13 +198,13 @@ BOOL ScOutlineDocFunc::RemoveOutline( const ScRange& rRange, BOOL bColumns, BOOL
rDocShell.GetUndoManager()->AddUndoAction(
new ScUndoMakeOutline( &rDocShell,
nStartCol,nStartRow,nTab, nEndCol,nEndRow,nTab,
- pUndoTab, bColumns, FALSE ) );
+ pUndoTab, bColumns, false ) );
}
if (pDoc->IsStreamValid(nTab))
- pDoc->SetStreamValid(nTab, FALSE);
+ pDoc->SetStreamValid(nTab, false);
- USHORT nParts = 0; // Datenbereich nicht geaendert
+ sal_uInt16 nParts = 0; // Datenbereich nicht geaendert
if ( bColumns )
nParts |= PAINT_TOP;
else
@@ -214,7 +214,7 @@ BOOL ScOutlineDocFunc::RemoveOutline( const ScRange& rRange, BOOL bColumns, BOOL
rDocShell.PostPaint( 0,0,nTab, MAXCOL,MAXROW,nTab, nParts );
rDocShell.SetDocumentModified();
- bDone = TRUE;
+ bDone = sal_True;
lcl_InvalidateOutliner( rDocShell.GetViewBindings() );
// es wird nicht wieder eingeblendet -> kein UpdatePageBreaks
@@ -229,13 +229,13 @@ BOOL ScOutlineDocFunc::RemoveOutline( const ScRange& rRange, BOOL bColumns, BOOL
return bDone;
}
-BOOL ScOutlineDocFunc::RemoveAllOutlines( SCTAB nTab, BOOL bRecord, BOOL bApi )
+sal_Bool ScOutlineDocFunc::RemoveAllOutlines( SCTAB nTab, sal_Bool bRecord, sal_Bool bApi )
{
- BOOL bSuccess = FALSE;
+ sal_Bool bSuccess = false;
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = FALSE;
+ bRecord = false;
ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab );
if (pTable)
{
@@ -250,9 +250,9 @@ BOOL ScOutlineDocFunc::RemoveAllOutlines( SCTAB nTab, BOOL bRecord, BOOL bApi )
SCROW nEndRow = nRow2;
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, nTab, nTab, TRUE, TRUE );
- pDoc->CopyToDocument( nStartCol, 0, nTab, nEndCol, MAXROW, nTab, IDF_NONE, FALSE, pUndoDoc );
- pDoc->CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, IDF_NONE, FALSE, pUndoDoc );
+ pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_True, sal_True );
+ pDoc->CopyToDocument( nStartCol, 0, nTab, nEndCol, MAXROW, nTab, IDF_NONE, false, pUndoDoc );
+ pDoc->CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, IDF_NONE, false, pUndoDoc );
ScOutlineTable* pUndoTab = new ScOutlineTable( *pTable );
@@ -263,20 +263,20 @@ BOOL ScOutlineDocFunc::RemoveAllOutlines( SCTAB nTab, BOOL bRecord, BOOL bApi )
pUndoDoc, pUndoTab ) );
}
- SelectLevel( nTab, TRUE, pTable->GetColArray()->GetDepth(), FALSE, FALSE, bApi );
- SelectLevel( nTab, FALSE, pTable->GetRowArray()->GetDepth(), FALSE, FALSE, bApi );
+ SelectLevel( nTab, sal_True, pTable->GetColArray()->GetDepth(), false, false, bApi );
+ SelectLevel( nTab, false, pTable->GetRowArray()->GetDepth(), false, false, bApi );
pDoc->SetOutlineTable( nTab, NULL );
pDoc->UpdatePageBreaks( nTab );
if (pDoc->IsStreamValid(nTab))
- pDoc->SetStreamValid(nTab, FALSE);
+ pDoc->SetStreamValid(nTab, false);
rDocShell.PostPaint( 0,0,nTab, MAXCOL,MAXROW,nTab,
PAINT_GRID | PAINT_LEFT | PAINT_TOP | PAINT_SIZE );
rDocShell.SetDocumentModified();
lcl_InvalidateOutliner( rDocShell.GetViewBindings() );
- bSuccess = TRUE;
+ bSuccess = sal_True;
}
else if (!bApi)
Sound::Beep();
@@ -286,7 +286,7 @@ BOOL ScOutlineDocFunc::RemoveAllOutlines( SCTAB nTab, BOOL bRecord, BOOL bApi )
//------------------------------------------------------------------------
-BOOL ScOutlineDocFunc::AutoOutline( const ScRange& rRange, BOOL bRecord, BOOL bApi )
+sal_Bool ScOutlineDocFunc::AutoOutline( const ScRange& rRange, sal_Bool bRecord, sal_Bool bApi )
{
SCCOL nStartCol = rRange.aStart.Col();
SCROW nStartRow = rRange.aStart.Row();
@@ -297,7 +297,7 @@ BOOL ScOutlineDocFunc::AutoOutline( const ScRange& rRange, BOOL bRecord, BOOL bA
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = FALSE;
+ bRecord = false;
ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab );
ScDocument* pUndoDoc = NULL;
@@ -318,14 +318,14 @@ BOOL ScOutlineDocFunc::AutoOutline( const ScRange& rRange, BOOL bRecord, BOOL bA
SCROW nOutEndRow = nRow2;
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, nTab, nTab, TRUE, TRUE );
- pDoc->CopyToDocument( nOutStartCol, 0, nTab, nOutEndCol, MAXROW, nTab, IDF_NONE, FALSE, pUndoDoc );
- pDoc->CopyToDocument( 0, nOutStartRow, nTab, MAXCOL, nOutEndRow, nTab, IDF_NONE, FALSE, pUndoDoc );
+ pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_True, sal_True );
+ pDoc->CopyToDocument( nOutStartCol, 0, nTab, nOutEndCol, MAXROW, nTab, IDF_NONE, false, pUndoDoc );
+ pDoc->CopyToDocument( 0, nOutStartRow, nTab, MAXCOL, nOutEndRow, nTab, IDF_NONE, false, pUndoDoc );
}
// einblenden
- SelectLevel( nTab, TRUE, pTable->GetColArray()->GetDepth(), FALSE, FALSE, bApi );
- SelectLevel( nTab, FALSE, pTable->GetRowArray()->GetDepth(), FALSE, FALSE, bApi );
+ SelectLevel( nTab, sal_True, pTable->GetColArray()->GetDepth(), false, false, bApi );
+ SelectLevel( nTab, false, pTable->GetRowArray()->GetDepth(), false, false, bApi );
pDoc->SetOutlineTable( nTab, NULL );
}
@@ -341,30 +341,30 @@ BOOL ScOutlineDocFunc::AutoOutline( const ScRange& rRange, BOOL bRecord, BOOL bA
}
if (pDoc->IsStreamValid(nTab))
- pDoc->SetStreamValid(nTab, FALSE);
+ pDoc->SetStreamValid(nTab, false);
rDocShell.PostPaint( 0,0,nTab, MAXCOL,MAXROW,nTab, PAINT_LEFT | PAINT_TOP | PAINT_SIZE );
rDocShell.SetDocumentModified();
lcl_InvalidateOutliner( rDocShell.GetViewBindings() );
- return TRUE;
+ return sal_True;
}
//------------------------------------------------------------------------
-BOOL ScOutlineDocFunc::SelectLevel( SCTAB nTab, BOOL bColumns, USHORT nLevel,
- BOOL bRecord, BOOL bPaint, BOOL /* bApi */ )
+sal_Bool ScOutlineDocFunc::SelectLevel( SCTAB nTab, sal_Bool bColumns, sal_uInt16 nLevel,
+ sal_Bool bRecord, sal_Bool bPaint, sal_Bool /* bApi */ )
{
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = FALSE;
+ bRecord = false;
ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab ); // ist schon da
if (!pTable)
- return FALSE;
+ return false;
ScOutlineArray* pArray = bColumns ? pTable->GetColArray() : pTable->GetRowArray();
if (!pArray)
- return FALSE;
+ return false;
SCCOLROW nStart, nEnd;
pArray->GetRange( nStart, nEnd );
@@ -375,15 +375,15 @@ BOOL ScOutlineDocFunc::SelectLevel( SCTAB nTab, BOOL bColumns, USHORT nLevel,
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
if (bColumns)
{
- pUndoDoc->InitUndo( pDoc, nTab, nTab, TRUE, FALSE );
+ pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_True, false );
pDoc->CopyToDocument( static_cast<SCCOL>(nStart), 0, nTab,
- static_cast<SCCOL>(nEnd), MAXROW, nTab, IDF_NONE, FALSE,
+ static_cast<SCCOL>(nEnd), MAXROW, nTab, IDF_NONE, false,
pUndoDoc );
}
else
{
- pUndoDoc->InitUndo( pDoc, nTab, nTab, FALSE, TRUE );
- pDoc->CopyToDocument( 0, nStart, nTab, MAXCOL, nEnd, nTab, IDF_NONE, FALSE, pUndoDoc );
+ pUndoDoc->InitUndo( pDoc, nTab, nTab, false, sal_True );
+ pDoc->CopyToDocument( 0, nStart, nTab, MAXCOL, nEnd, nTab, IDF_NONE, false, pUndoDoc );
}
rDocShell.GetUndoManager()->AddUndoAction(
@@ -398,21 +398,21 @@ BOOL ScOutlineDocFunc::SelectLevel( SCTAB nTab, BOOL bColumns, USHORT nLevel,
ScOutlineEntry* pEntry;
while ((pEntry=aIter.GetNext()) != NULL)
{
- USHORT nThisLevel = aIter.LastLevel();
- BOOL bShow = (nThisLevel < nLevel);
+ sal_uInt16 nThisLevel = aIter.LastLevel();
+ sal_Bool bShow = (nThisLevel < nLevel);
if (bShow) // einblenden
{
- pEntry->SetHidden( FALSE );
- pEntry->SetVisible( TRUE );
+ pEntry->SetHidden( false );
+ pEntry->SetVisible( sal_True );
}
else if ( nThisLevel == nLevel ) // ausblenden
{
- pEntry->SetHidden( TRUE );
- pEntry->SetVisible( TRUE );
+ pEntry->SetHidden( sal_True );
+ pEntry->SetVisible( sal_True );
}
else // verdeckt
{
- pEntry->SetVisible( FALSE );
+ pEntry->SetVisible( false );
}
SCCOLROW nThisStart = pEntry->GetStart();
@@ -436,14 +436,14 @@ BOOL ScOutlineDocFunc::SelectLevel( SCTAB nTab, BOOL bColumns, USHORT nLevel,
rDocShell.SetDocumentModified();
lcl_InvalidateOutliner( rDocShell.GetViewBindings() );
- return TRUE;
+ return sal_True;
}
//------------------------------------------------------------------------
-BOOL ScOutlineDocFunc::ShowMarkedOutlines( const ScRange& rRange, BOOL bRecord, BOOL bApi )
+sal_Bool ScOutlineDocFunc::ShowMarkedOutlines( const ScRange& rRange, sal_Bool bRecord, sal_Bool bApi )
{
- BOOL bDone = FALSE;
+ sal_Bool bDone = false;
SCCOL nStartCol = rRange.aStart.Col();
SCROW nStartRow = rRange.aStart.Row();
@@ -454,7 +454,7 @@ BOOL ScOutlineDocFunc::ShowMarkedOutlines( const ScRange& rRange, BOOL bRecord,
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = FALSE;
+ bRecord = false;
ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab );
if (pTable)
@@ -471,14 +471,14 @@ BOOL ScOutlineDocFunc::ShowMarkedOutlines( const ScRange& rRange, BOOL bRecord,
{
ScOutlineTable* pUndoTab = new ScOutlineTable( *pTable );
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, nTab, nTab, TRUE, TRUE );
- pDoc->CopyToDocument( nStartCol, 0, nTab, nEndCol, MAXROW, nTab, IDF_NONE, FALSE, pUndoDoc );
- pDoc->CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, IDF_NONE, FALSE, pUndoDoc );
+ pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_True, sal_True );
+ pDoc->CopyToDocument( nStartCol, 0, nTab, nEndCol, MAXROW, nTab, IDF_NONE, false, pUndoDoc );
+ pDoc->CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, IDF_NONE, false, pUndoDoc );
rDocShell.GetUndoManager()->AddUndoAction(
new ScUndoOutlineBlock( &rDocShell,
nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab,
- pUndoDoc, pUndoTab, TRUE ) );
+ pUndoDoc, pUndoTab, sal_True ) );
}
// Spalten
@@ -493,14 +493,14 @@ BOOL ScOutlineDocFunc::ShowMarkedOutlines( const ScRange& rRange, BOOL bRecord,
nEnd = pEntry->GetEnd();
if ( nStart>=nStartCol && nEnd<=nEndCol )
{
- pEntry->SetHidden( FALSE );
- pEntry->SetVisible( TRUE );
+ pEntry->SetHidden( false );
+ pEntry->SetVisible( sal_True );
if (nStart<nMin) nMin=nStart;
if (nEnd>nMax) nMax=nEnd;
}
}
for ( i=nMin; i<=nMax; i++ )
- pDoc->ShowCol( static_cast<SCCOL>(i), nTab, TRUE );
+ pDoc->ShowCol( static_cast<SCCOL>(i), nTab, sal_True );
// Zeilen
@@ -515,22 +515,22 @@ BOOL ScOutlineDocFunc::ShowMarkedOutlines( const ScRange& rRange, BOOL bRecord,
nEnd = pEntry->GetEnd();
if ( nStart>=nStartRow && nEnd<=nEndRow )
{
- pEntry->SetHidden( FALSE );
- pEntry->SetVisible( TRUE );
+ pEntry->SetHidden( false );
+ pEntry->SetVisible( sal_True );
if (nStart<nMin) nMin=nStart;
if (nEnd>nMax) nMax=nEnd;
}
}
for ( i=nMin; i<=nMax; i++ )
if ( !pDoc->RowFiltered( i,nTab ) ) // weggefilterte nicht einblenden
- pDoc->ShowRow( i, nTab, TRUE );
+ pDoc->ShowRow( i, nTab, sal_True );
pDoc->SetDrawPageSize(nTab);
pDoc->UpdatePageBreaks( nTab );
rDocShell.PostPaint( 0,0,nTab, MAXCOL,MAXROW,nTab, PAINT_GRID | PAINT_LEFT | PAINT_TOP );
rDocShell.SetDocumentModified();
- bDone = TRUE;
+ bDone = sal_True;
lcl_InvalidateOutliner( rDocShell.GetViewBindings() );
}
@@ -541,9 +541,9 @@ BOOL ScOutlineDocFunc::ShowMarkedOutlines( const ScRange& rRange, BOOL bRecord,
return bDone;
}
-BOOL ScOutlineDocFunc::HideMarkedOutlines( const ScRange& rRange, BOOL bRecord, BOOL bApi )
+sal_Bool ScOutlineDocFunc::HideMarkedOutlines( const ScRange& rRange, sal_Bool bRecord, sal_Bool bApi )
{
- BOOL bDone = FALSE;
+ sal_Bool bDone = false;
SCCOL nStartCol = rRange.aStart.Col();
SCROW nStartRow = rRange.aStart.Row();
@@ -554,18 +554,18 @@ BOOL ScOutlineDocFunc::HideMarkedOutlines( const ScRange& rRange, BOOL bRecord,
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = FALSE;
+ bRecord = false;
ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab );
if (pTable)
{
ScOutlineEntry* pEntry;
- USHORT nColLevel;
- USHORT nRowLevel;
- USHORT nCount;
+ sal_uInt16 nColLevel;
+ sal_uInt16 nRowLevel;
+ sal_uInt16 nCount;
SCCOLROW nStart;
SCCOLROW nEnd;
- USHORT i;
+ sal_uInt16 i;
SCCOLROW nEffStartCol = nStartCol;
SCCOLROW nEffEndCol = nEndCol;
@@ -582,16 +582,16 @@ BOOL ScOutlineDocFunc::HideMarkedOutlines( const ScRange& rRange, BOOL bRecord,
{
ScOutlineTable* pUndoTab = new ScOutlineTable( *pTable );
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, nTab, nTab, TRUE, TRUE );
+ pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_True, sal_True );
pDoc->CopyToDocument( static_cast<SCCOL>(nEffStartCol), 0, nTab,
static_cast<SCCOL>(nEffEndCol), MAXROW, nTab, IDF_NONE,
- FALSE, pUndoDoc );
- pDoc->CopyToDocument( 0, nEffStartRow, nTab, MAXCOL, nEffEndRow, nTab, IDF_NONE, FALSE, pUndoDoc );
+ false, pUndoDoc );
+ pDoc->CopyToDocument( 0, nEffStartRow, nTab, MAXCOL, nEffEndRow, nTab, IDF_NONE, false, pUndoDoc );
rDocShell.GetUndoManager()->AddUndoAction(
new ScUndoOutlineBlock( &rDocShell,
nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab,
- pUndoDoc, pUndoTab, FALSE ) );
+ pUndoDoc, pUndoTab, false ) );
}
// Spalten
@@ -604,7 +604,7 @@ BOOL ScOutlineDocFunc::HideMarkedOutlines( const ScRange& rRange, BOOL bRecord,
nEnd = pEntry->GetEnd();
if ( static_cast<SCCOLROW>(nStartCol)<=nEnd && static_cast<SCCOLROW>(nEndCol)>=nStart )
- HideOutline( nTab, TRUE, nColLevel, i, FALSE, FALSE, bApi );
+ HideOutline( nTab, sal_True, nColLevel, i, false, false, bApi );
}
// Zeilen
@@ -617,7 +617,7 @@ BOOL ScOutlineDocFunc::HideMarkedOutlines( const ScRange& rRange, BOOL bRecord,
nEnd = pEntry->GetEnd();
if ( nStartRow<=nEnd && nEndRow>=nStart )
- HideOutline( nTab, FALSE, nRowLevel, i, FALSE, FALSE, bApi );
+ HideOutline( nTab, false, nRowLevel, i, false, false, bApi );
}
pDoc->UpdatePageBreaks( nTab );
@@ -625,7 +625,7 @@ BOOL ScOutlineDocFunc::HideMarkedOutlines( const ScRange& rRange, BOOL bRecord,
rDocShell.PostPaint( 0,0,nTab, MAXCOL,MAXROW,nTab, PAINT_GRID | PAINT_LEFT | PAINT_TOP );
rDocShell.SetDocumentModified();
- bDone = TRUE;
+ bDone = sal_True;
lcl_InvalidateOutliner( rDocShell.GetViewBindings() );
}
@@ -638,12 +638,12 @@ BOOL ScOutlineDocFunc::HideMarkedOutlines( const ScRange& rRange, BOOL bRecord,
//------------------------------------------------------------------------
-BOOL ScOutlineDocFunc::ShowOutline( SCTAB nTab, BOOL bColumns, USHORT nLevel, USHORT nEntry,
- BOOL bRecord, BOOL bPaint, BOOL /* bApi */ )
+sal_Bool ScOutlineDocFunc::ShowOutline( SCTAB nTab, sal_Bool bColumns, sal_uInt16 nLevel, sal_uInt16 nEntry,
+ sal_Bool bRecord, sal_Bool bPaint, sal_Bool /* bApi */ )
{
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = FALSE;
+ bRecord = false;
ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab );
ScOutlineArray* pArray = bColumns ? pTable->GetColArray() : pTable->GetRowArray();
@@ -656,35 +656,35 @@ BOOL ScOutlineDocFunc::ShowOutline( SCTAB nTab, BOOL bColumns, USHORT nLevel, US
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
if (bColumns)
{
- pUndoDoc->InitUndo( pDoc, nTab, nTab, TRUE, FALSE );
+ pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_True, false );
pDoc->CopyToDocument( static_cast<SCCOL>(nStart), 0, nTab,
- static_cast<SCCOL>(nEnd), MAXROW, nTab, IDF_NONE, FALSE,
+ static_cast<SCCOL>(nEnd), MAXROW, nTab, IDF_NONE, false,
pUndoDoc );
}
else
{
- pUndoDoc->InitUndo( pDoc, nTab, nTab, FALSE, TRUE );
- pDoc->CopyToDocument( 0, nStart, nTab, MAXCOL, nEnd, nTab, IDF_NONE, FALSE, pUndoDoc );
+ pUndoDoc->InitUndo( pDoc, nTab, nTab, false, sal_True );
+ pDoc->CopyToDocument( 0, nStart, nTab, MAXCOL, nEnd, nTab, IDF_NONE, false, pUndoDoc );
}
rDocShell.GetUndoManager()->AddUndoAction(
new ScUndoDoOutline( &rDocShell,
nStart, nEnd, nTab, pUndoDoc, //! start und end berechnen
- bColumns, nLevel, nEntry, TRUE ) );
+ bColumns, nLevel, nEntry, sal_True ) );
}
//! HideCursor();
pDoc->InitializeNoteCaptions(nTab);
- pEntry->SetHidden(FALSE);
+ pEntry->SetHidden(false);
SCCOLROW i;
for ( i = nStart; i <= nEnd; i++ )
{
if ( bColumns )
- pDoc->ShowCol( static_cast<SCCOL>(i), nTab, TRUE );
+ pDoc->ShowCol( static_cast<SCCOL>(i), nTab, sal_True );
else
if ( !pDoc->RowFiltered( i,nTab ) ) // weggefilterte nicht einblenden
- pDoc->ShowRow( i, nTab, TRUE );
+ pDoc->ShowRow( i, nTab, sal_True );
}
ScSubOutlineIterator aIter( pArray, nLevel, nEntry );
@@ -697,14 +697,14 @@ BOOL ScOutlineDocFunc::ShowOutline( SCTAB nTab, BOOL bColumns, USHORT nLevel, US
for ( i = nSubStart; i <= nSubEnd; i++ )
{
if ( bColumns )
- pDoc->ShowCol( static_cast<SCCOL>(i), nTab, FALSE );
+ pDoc->ShowCol( static_cast<SCCOL>(i), nTab, false );
else
- pDoc->ShowRow( i, nTab, FALSE );
+ pDoc->ShowRow( i, nTab, false );
}
}
}
- pArray->SetVisibleBelow( nLevel, nEntry, TRUE, TRUE );
+ pArray->SetVisibleBelow( nLevel, nEntry, sal_True, sal_True );
pDoc->SetDrawPageSize(nTab);
pDoc->InvalidatePageBreaks(nTab);
@@ -721,15 +721,15 @@ BOOL ScOutlineDocFunc::ShowOutline( SCTAB nTab, BOOL bColumns, USHORT nLevel, US
lcl_InvalidateOutliner( rDocShell.GetViewBindings() );
- return TRUE; //! immer ???
+ return sal_True; //! immer ???
}
-BOOL ScOutlineDocFunc::HideOutline( SCTAB nTab, BOOL bColumns, USHORT nLevel, USHORT nEntry,
- BOOL bRecord, BOOL bPaint, BOOL /* bApi */ )
+sal_Bool ScOutlineDocFunc::HideOutline( SCTAB nTab, sal_Bool bColumns, sal_uInt16 nLevel, sal_uInt16 nEntry,
+ sal_Bool bRecord, sal_Bool bPaint, sal_Bool /* bApi */ )
{
ScDocument* pDoc = rDocShell.GetDocument();
if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = FALSE;
+ bRecord = false;
ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab );
ScOutlineArray* pArray = bColumns ? pTable->GetColArray() : pTable->GetRowArray();
@@ -742,37 +742,37 @@ BOOL ScOutlineDocFunc::HideOutline( SCTAB nTab, BOOL bColumns, USHORT nLevel, US
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
if (bColumns)
{
- pUndoDoc->InitUndo( pDoc, nTab, nTab, TRUE, FALSE );
+ pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_True, false );
pDoc->CopyToDocument( static_cast<SCCOL>(nStart), 0, nTab,
- static_cast<SCCOL>(nEnd), MAXROW, nTab, IDF_NONE, FALSE,
+ static_cast<SCCOL>(nEnd), MAXROW, nTab, IDF_NONE, false,
pUndoDoc );
}
else
{
- pUndoDoc->InitUndo( pDoc, nTab, nTab, FALSE, TRUE );
- pDoc->CopyToDocument( 0, nStart, nTab, MAXCOL, nEnd, nTab, IDF_NONE, FALSE, pUndoDoc );
+ pUndoDoc->InitUndo( pDoc, nTab, nTab, false, sal_True );
+ pDoc->CopyToDocument( 0, nStart, nTab, MAXCOL, nEnd, nTab, IDF_NONE, false, pUndoDoc );
}
rDocShell.GetUndoManager()->AddUndoAction(
new ScUndoDoOutline( &rDocShell,
nStart, nEnd, nTab, pUndoDoc,
- bColumns, nLevel, nEntry, FALSE ) );
+ bColumns, nLevel, nEntry, false ) );
}
//! HideCursor();
pDoc->InitializeNoteCaptions(nTab);
- pEntry->SetHidden(TRUE);
+ pEntry->SetHidden(true);
SCCOLROW i;
for ( i = nStart; i <= nEnd; i++ )
{
if ( bColumns )
- pDoc->ShowCol( static_cast<SCCOL>(i), nTab, FALSE );
+ pDoc->ShowCol( static_cast<SCCOL>(i), nTab, false );
else
- pDoc->ShowRow( i, nTab, FALSE );
+ pDoc->ShowRow( i, nTab, false );
}
- pArray->SetVisibleBelow( nLevel, nEntry, FALSE );
+ pArray->SetVisibleBelow( nLevel, nEntry, false );
pDoc->SetDrawPageSize(nTab);
pDoc->InvalidatePageBreaks(nTab);
@@ -789,7 +789,7 @@ BOOL ScOutlineDocFunc::HideOutline( SCTAB nTab, BOOL bColumns, USHORT nLevel, US
lcl_InvalidateOutliner( rDocShell.GetViewBindings() );
- return TRUE; //! immer ???
+ return sal_True; //! immer ???
}
diff --git a/sc/source/ui/docshell/pagedata.cxx b/sc/source/ui/docshell/pagedata.cxx
index e87c2322a228..b3ec3e31d010 100644
--- a/sc/source/ui/docshell/pagedata.cxx
+++ b/sc/source/ui/docshell/pagedata.cxx
@@ -43,7 +43,7 @@ ScPrintRangeData::ScPrintRangeData()
nPagesX = nPagesY = 0;
pPageEndX = NULL;
pPageEndY = NULL;
- bTopDown = bAutomatic = TRUE;
+ bTopDown = bAutomatic = sal_True;
nFirstPage = 1;
}
@@ -109,18 +109,18 @@ ScPrintRangeData& ScPageBreakData::GetData(size_t nPos)
return pData[nPos];
}
-BOOL ScPageBreakData::IsEqual( const ScPageBreakData& rOther ) const
+sal_Bool ScPageBreakData::IsEqual( const ScPageBreakData& rOther ) const
{
if ( nUsed != rOther.nUsed )
- return FALSE;
+ return false;
- for (USHORT i=0; i<nUsed; i++)
+ for (sal_uInt16 i=0; i<nUsed; i++)
if ( pData[i].GetPrintRange() != rOther.pData[i].GetPrintRange() )
- return FALSE;
+ return false;
//! ScPrintRangeData komplett vergleichen ??
- return TRUE;
+ return sal_True;
}
void ScPageBreakData::AddPages()
@@ -128,7 +128,7 @@ void ScPageBreakData::AddPages()
if ( nUsed > 1 )
{
long nPage = pData[0].GetFirstPage();
- for (USHORT i=0; sal::static_int_cast<size_t>(i+1)<nUsed; i++)
+ for (sal_uInt16 i=0; sal::static_int_cast<size_t>(i+1)<nUsed; i++)
{
nPage += ((long)pData[i].GetPagesX())*pData[i].GetPagesY();
pData[i+1].SetFirstPage( nPage );
diff --git a/sc/source/ui/docshell/pntlock.cxx b/sc/source/ui/docshell/pntlock.cxx
index 0450f7c67a0d..2ca47820eb6d 100644
--- a/sc/source/ui/docshell/pntlock.cxx
+++ b/sc/source/ui/docshell/pntlock.cxx
@@ -35,12 +35,12 @@
//------------------------------------------------------------------------
-ScPaintLockData::ScPaintLockData(USHORT nNewMode) :
+ScPaintLockData::ScPaintLockData(sal_uInt16 nNewMode) :
nMode( nNewMode ),
nLevel( 0 ),
nDocLevel( 0 ),
nParts( 0 ),
- bModified( FALSE )
+ bModified( false )
{
}
@@ -48,7 +48,7 @@ ScPaintLockData::~ScPaintLockData()
{
}
-void ScPaintLockData::AddRange( const ScRange& rRange, USHORT nP )
+void ScPaintLockData::AddRange( const ScRange& rRange, sal_uInt16 nP )
{
if (!xRangeList.Is())
xRangeList = new ScRangeList;
diff --git a/sc/source/ui/docshell/servobj.cxx b/sc/source/ui/docshell/servobj.cxx
index d96f9101b858..6bd9f6d629bf 100644
--- a/sc/source/ui/docshell/servobj.cxx
+++ b/sc/source/ui/docshell/servobj.cxx
@@ -46,7 +46,7 @@ using namespace formula;
// -----------------------------------------------------------------------
-BOOL lcl_FillRangeFromName( ScRange& rRange, ScDocShell* pDocSh, const String& rName )
+sal_Bool lcl_FillRangeFromName( ScRange& rRange, ScDocShell* pDocSh, const String& rName )
{
if (pDocSh)
{
@@ -58,11 +58,11 @@ BOOL lcl_FillRangeFromName( ScRange& rRange, ScDocShell* pDocSh, const String& r
if (pData)
{
if ( pData->IsValidReference( rRange ) )
- return TRUE;
+ return sal_True;
}
}
}
- return FALSE;
+ return false;
}
ScServerObjectSvtListenerForwarder::ScServerObjectSvtListenerForwarder(
@@ -84,7 +84,7 @@ void ScServerObjectSvtListenerForwarder::Notify( SvtBroadcaster& /* rBC */, cons
ScServerObject::ScServerObject( ScDocShell* pShell, const String& rItem ) :
aForwarder( this ),
pDocSh( pShell ),
- bRefreshListener( FALSE )
+ bRefreshListener( false )
{
// parse item string
@@ -148,12 +148,12 @@ void ScServerObject::EndListeningAll()
SfxListener::EndListeningAll();
}
-BOOL ScServerObject::GetData(
+sal_Bool ScServerObject::GetData(
::com::sun::star::uno::Any & rData /*out param*/,
- const String & rMimeType, BOOL /* bSynchron */ )
+ const String & rMimeType, sal_Bool /* bSynchron */ )
{
if (!pDocSh)
- return FALSE;
+ return false;
// named ranges may have changed -> update aRange
if ( aItemStr.Len() )
@@ -162,7 +162,7 @@ BOOL ScServerObject::GetData(
if ( lcl_FillRangeFromName( aNew, pDocSh, aItemStr ) && aNew != aRange )
{
aRange = aNew;
- bRefreshListener = TRUE;
+ bRefreshListener = sal_True;
}
}
@@ -174,7 +174,7 @@ BOOL ScServerObject::GetData(
pDocSh->GetDocument()->StartListeningArea( aRange, &aForwarder );
StartListening(*pDocSh);
StartListening(*SFX_APP());
- bRefreshListener = FALSE;
+ bRefreshListener = false;
}
String aDdeTextFmt = pDocSh->GetDdeTextFmt();
@@ -184,7 +184,7 @@ BOOL ScServerObject::GetData(
{
ScImportExport aObj( pDoc, aRange );
if( aDdeTextFmt.GetChar(0) == 'F' )
- aObj.SetFormulas( TRUE );
+ aObj.SetFormulas( sal_True );
if( aDdeTextFmt.EqualsAscii( "SYLK" ) ||
aDdeTextFmt.EqualsAscii( "FSYLK" ) )
{
@@ -214,7 +214,7 @@ BOOL ScServerObject::GetData(
void ScServerObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- BOOL bDataChanged = FALSE;
+ sal_Bool bDataChanged = false;
// DocShell can't be tested via type info, because SFX_HINT_DYING comes from the dtor
if ( &rBC == pDocSh )
@@ -235,7 +235,7 @@ void ScServerObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
// check if named range was modified
ScRange aNew;
if ( lcl_FillRangeFromName( aNew, pDocSh, aItemStr ) && aNew != aRange )
- bDataChanged = TRUE;
+ bDataChanged = sal_True;
}
}
else
@@ -244,25 +244,25 @@ void ScServerObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
const ScHint* pScHint = PTR_CAST( ScHint, &rHint );
if( pScHint && (pScHint->GetId() & (SC_HINT_DATACHANGED | SC_HINT_DYING)) )
- bDataChanged = TRUE;
+ bDataChanged = sal_True;
else if (rHint.ISA(ScAreaChangedHint)) // position of broadcaster changed
{
ScRange aNewRange = ((const ScAreaChangedHint&)rHint).GetRange();
if ( aRange != aNewRange )
{
- bRefreshListener = TRUE;
- bDataChanged = TRUE;
+ bRefreshListener = sal_True;
+ bDataChanged = sal_True;
}
}
else if (rHint.ISA(SfxSimpleHint))
{
- ULONG nId = ((const SfxSimpleHint&)rHint).GetId();
+ sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId();
if (nId == SFX_HINT_DYING)
{
// If the range is being deleted, listening must be restarted
// after the deletion is complete (done in GetData)
- bRefreshListener = TRUE;
- bDataChanged = TRUE;
+ bRefreshListener = sal_True;
+ bDataChanged = sal_True;
}
}
}
diff --git a/sc/source/ui/docshell/sizedev.cxx b/sc/source/ui/docshell/sizedev.cxx
index 3171fa8164ae..19dc2843470e 100644
--- a/sc/source/ui/docshell/sizedev.cxx
+++ b/sc/source/ui/docshell/sizedev.cxx
@@ -43,11 +43,11 @@
ScSizeDeviceProvider::ScSizeDeviceProvider( ScDocShell* pDocSh )
{
- BOOL bTextWysiwyg = SC_MOD()->GetInputOptions().GetTextWysiwyg();
+ sal_Bool bTextWysiwyg = SC_MOD()->GetInputOptions().GetTextWysiwyg();
if ( bTextWysiwyg )
{
pDevice = pDocSh->GetPrinter();
- bOwner = FALSE;
+ bOwner = false;
aOldMapMode = pDevice->GetMapMode();
pDevice->SetMapMode( MAP_PIXEL ); // GetNeededSize needs pixel MapMode
@@ -57,7 +57,7 @@ ScSizeDeviceProvider::ScSizeDeviceProvider( ScDocShell* pDocSh )
{
pDevice = new VirtualDevice;
pDevice->SetDigitLanguage( SC_MOD()->GetOptDigitLanguage() );
- bOwner = TRUE;
+ bOwner = sal_True;
}
Point aLogic = pDevice->LogicToPixel( Point(1000,1000), MAP_TWIP );
diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx
index aad15c30feb7..b962bcfd37e1 100644
--- a/sc/source/ui/docshell/tablink.cxx
+++ b/sc/source/ui/docshell/tablink.cxx
@@ -79,34 +79,34 @@ TYPEINIT1(ScTableLink, ::sfx2::SvBaseLink);
ScTableLink::ScTableLink(ScDocShell* pDocSh, const String& rFile,
const String& rFilter, const String& rOpt,
- ULONG nRefresh ):
+ sal_uLong nRefresh ):
::sfx2::SvBaseLink(sfx2::LINKUPDATE_ONCALL,FORMAT_FILE),
ScRefreshTimer( nRefresh ),
pImpl( new TableLink_Impl ),
aFileName(rFile),
aFilterName(rFilter),
aOptions(rOpt),
- bInCreate( FALSE ),
- bInEdit( FALSE ),
- bAddUndo( TRUE ),
- bDoPaint( TRUE )
+ bInCreate( false ),
+ bInEdit( false ),
+ bAddUndo( sal_True ),
+ bDoPaint( sal_True )
{
pImpl->m_pDocSh = pDocSh;
}
ScTableLink::ScTableLink(SfxObjectShell* pShell, const String& rFile,
const String& rFilter, const String& rOpt,
- ULONG nRefresh ):
+ sal_uLong nRefresh ):
::sfx2::SvBaseLink(sfx2::LINKUPDATE_ONCALL,FORMAT_FILE),
ScRefreshTimer( nRefresh ),
pImpl( new TableLink_Impl ),
aFileName(rFile),
aFilterName(rFilter),
aOptions(rOpt),
- bInCreate( FALSE ),
- bInEdit( FALSE ),
- bAddUndo( TRUE ),
- bDoPaint( TRUE )
+ bInCreate( false ),
+ bInEdit( false ),
+ bAddUndo( sal_True ),
+ bDoPaint( sal_True )
{
pImpl->m_pDocSh = static_cast< ScDocShell* >( pShell );
SetRefreshHandler( LINK( this, ScTableLink, RefreshHdl ) );
@@ -137,7 +137,7 @@ void ScTableLink::Edit( Window* pParent, const Link& rEndEditHdl )
if (pParent)
Application::SetDefDialogParent(pParent);
- bInEdit = TRUE;
+ bInEdit = sal_True;
SvBaseLink::Edit( pParent, LINK( this, ScTableLink, TableEndEditHdl ) );
}
@@ -164,14 +164,14 @@ void ScTableLink::Closed()
{
// Verknuepfung loeschen: Undo
ScDocument* pDoc = pImpl->m_pDocSh->GetDocument();
- BOOL bUndo (pDoc->IsUndoEnabled());
+ sal_Bool bUndo (pDoc->IsUndoEnabled());
if (bAddUndo && bUndo)
{
pImpl->m_pDocSh->GetUndoManager()->AddUndoAction(
new ScUndoRemoveLink( pImpl->m_pDocSh, aFileName ) );
- bAddUndo = FALSE; // nur einmal
+ bAddUndo = false; // nur einmal
}
// Verbindung wird im dtor aufgehoben
@@ -179,30 +179,30 @@ void ScTableLink::Closed()
SvBaseLink::Closed();
}
-BOOL ScTableLink::IsUsed() const
+sal_Bool ScTableLink::IsUsed() const
{
return pImpl->m_pDocSh->GetDocument()->HasLink( aFileName, aFilterName, aOptions );
}
-BOOL ScTableLink::Refresh(const String& rNewFile, const String& rNewFilter,
- const String* pNewOptions, ULONG nNewRefresh )
+sal_Bool ScTableLink::Refresh(const String& rNewFile, const String& rNewFilter,
+ const String* pNewOptions, sal_uLong nNewRefresh )
{
// Dokument laden
if (!rNewFile.Len() || !rNewFilter.Len())
- return FALSE;
+ return false;
String aNewUrl( ScGlobal::GetAbsDocName( rNewFile, pImpl->m_pDocSh ) );
- BOOL bNewUrlName = (aNewUrl != aFileName);
+ sal_Bool bNewUrlName = (aNewUrl != aFileName);
const SfxFilter* pFilter = pImpl->m_pDocSh->GetFactory().GetFilterContainer()->GetFilter4FilterName(rNewFilter);
if (!pFilter)
- return FALSE;
+ return false;
ScDocument* pDoc = pImpl->m_pDocSh->GetDocument();
- pDoc->SetInLinkUpdate( TRUE );
+ pDoc->SetInLinkUpdate( sal_True );
- BOOL bUndo(pDoc->IsUndoEnabled());
+ sal_Bool bUndo(pDoc->IsUndoEnabled());
// wenn neuer Filter ausgewaehlt wurde, Optionen vergessen
if ( rNewFilter != aFilterName )
@@ -215,13 +215,14 @@ BOOL ScTableLink::Refresh(const String& rNewFile, const String& rNewFilter,
if ( aOptions.Len() )
pSet->Put( SfxStringItem( SID_FILE_FILTEROPTIONS, aOptions ) );
- SfxMedium* pMed = new SfxMedium(aNewUrl, STREAM_STD_READ, FALSE, pFilter, pSet);
+ SfxMedium* pMed = new SfxMedium(aNewUrl, STREAM_STD_READ, false, pFilter, pSet);
if ( bInEdit ) // only if using the edit dialog,
- pMed->UseInteractionHandler( TRUE ); // enable the filter options dialog
+ pMed->UseInteractionHandler( sal_True ); // enable the filter options dialog
+ // aRef->DoClose() will be called explicitly, but it is still more safe to use SfxObjectShellLock here
ScDocShell* pSrcShell = new ScDocShell(SFX_CREATE_MODE_INTERNAL);
- SfxObjectShellRef aRef = pSrcShell;
+ SfxObjectShellLock aRef = pSrcShell;
pSrcShell->DoLoad(pMed);
// Optionen koennten gesetzt worden sein
@@ -232,7 +233,7 @@ BOOL ScTableLink::Refresh(const String& rNewFile, const String& rNewFilter,
// Undo...
ScDocument* pUndoDoc = NULL;
- BOOL bFirst = TRUE;
+ sal_Bool bFirst = sal_True;
if (bAddUndo && bUndo)
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
@@ -240,18 +241,18 @@ BOOL ScTableLink::Refresh(const String& rNewFile, const String& rNewFilter,
ScDocShellModificator aModificator( *pImpl->m_pDocSh );
- BOOL bNotFound = FALSE;
+ sal_Bool bNotFound = false;
ScDocument* pSrcDoc = pSrcShell->GetDocument();
// from text filters that don't set the table name,
// use the one table regardless of link table name
- BOOL bAutoTab = (pSrcDoc->GetTableCount() == 1) &&
+ sal_Bool bAutoTab = (pSrcDoc->GetTableCount() == 1) &&
ScDocShell::HasAutomaticTableName( rNewFilter );
SCTAB nCount = pDoc->GetTableCount();
for (SCTAB nTab=0; nTab<nCount; nTab++)
{
- BYTE nMode = pDoc->GetLinkMode(nTab);
+ sal_uInt8 nMode = pDoc->GetLinkMode(nTab);
if (nMode && pDoc->GetLinkDoc(nTab)==aFileName)
{
String aTabName = pDoc->GetLinkTab(nTab);
@@ -261,12 +262,12 @@ BOOL ScTableLink::Refresh(const String& rNewFile, const String& rNewFilter,
if (bAddUndo && bUndo)
{
if (bFirst)
- pUndoDoc->InitUndo( pDoc, nTab, nTab, TRUE, TRUE );
+ pUndoDoc->InitUndo( pDoc, nTab, nTab, sal_True, sal_True );
else
- pUndoDoc->AddUndoTab( nTab, nTab, TRUE, TRUE );
- bFirst = FALSE;
+ pUndoDoc->AddUndoTab( nTab, nTab, sal_True, sal_True );
+ bFirst = false;
ScRange aRange(0,0,nTab,MAXCOL,MAXROW,nTab);
- pDoc->CopyToDocument(aRange, IDF_ALL, FALSE, pUndoDoc);
+ pDoc->CopyToDocument(aRange, IDF_ALL, false, pUndoDoc);
pUndoDoc->TransferDrawPage( pDoc, nTab, nTab );
pUndoDoc->SetLink( nTab, nMode, aFileName, aFilterName,
aOptions, aTabName, GetRefreshDelay() );
@@ -283,7 +284,7 @@ BOOL ScTableLink::Refresh(const String& rNewFile, const String& rNewFilter,
{
pDoc->RenameTab( nTab,
ScGlobal::GetDocTabName( aNewUrl, aTabName ),
- FALSE, TRUE ); // kein RefUpdate, kein ValidTabName
+ false, sal_True ); // kein RefUpdate, kein ValidTabName
}
}
@@ -304,7 +305,7 @@ BOOL ScTableLink::Refresh(const String& rNewFile, const String& rNewFilter,
}
if (bFound)
- pDoc->TransferTab( pSrcDoc, nSrcTab, nTab, FALSE, // nicht neu einfuegen
+ pDoc->TransferTab( pSrcDoc, nSrcTab, nTab, false, // nicht neu einfuegen
(nMode == SC_LINK_VALUE) ); // nur Werte?
else
{
@@ -382,7 +383,7 @@ BOOL ScTableLink::Refresh(const String& rNewFile, const String& rNewFilter,
pDoc->SetString( 1,2,nTab, aTabName );
}
- bNotFound = TRUE;
+ bNotFound = sal_True;
}
if ( bNewUrlName || rNewFilter != aFilterName ||
@@ -426,7 +427,7 @@ BOOL ScTableLink::Refresh(const String& rNewFile, const String& rNewFilter,
//! Fehler ausgeben ?
}
- pDoc->SetInLinkUpdate( FALSE );
+ pDoc->SetInLinkUpdate( false );
// notify Uno objects (for XRefreshListener)
//! also notify Uno objects if file name was changed!
@@ -434,7 +435,7 @@ BOOL ScTableLink::Refresh(const String& rNewFile, const String& rNewFilter,
aHint.SetSheetLink( aFileName );
pDoc->BroadcastUno( aHint );
- return TRUE;
+ return sal_True;
}
IMPL_LINK( ScTableLink, RefreshHdl, ScTableLink*, EMPTYARG )
@@ -447,7 +448,7 @@ IMPL_LINK( ScTableLink, TableEndEditHdl, ::sfx2::SvBaseLink*, pLink )
{
if ( pImpl->m_aEndEditLink.IsSet() )
pImpl->m_aEndEditLink.Call( pLink );
- bInEdit = FALSE;
+ bInEdit = false;
Application::SetDefDialogParent( pImpl->m_pOldParent );
return 0;
}
@@ -458,15 +459,15 @@ String ScDocumentLoader::GetOptions( SfxMedium& rMedium )
{
SfxItemSet* pSet = rMedium.GetItemSet();
const SfxPoolItem* pItem;
- if ( pSet && SFX_ITEM_SET == pSet->GetItemState( SID_FILE_FILTEROPTIONS, TRUE, &pItem ) )
+ if ( pSet && SFX_ITEM_SET == pSet->GetItemState( SID_FILE_FILTEROPTIONS, sal_True, &pItem ) )
return ((const SfxStringItem*)pItem)->GetValue();
return EMPTY_STRING;
}
-BOOL ScDocumentLoader::GetFilterName( const String& rFileName,
+sal_Bool ScDocumentLoader::GetFilterName( const String& rFileName,
String& rFilter, String& rOptions,
- BOOL bWithContent, BOOL bWithInteraction )
+ sal_Bool bWithContent, sal_Bool bWithInteraction )
{
TypeId aScType = TYPE(ScDocShell);
SfxObjectShell* pDocSh = SfxObjectShell::GetFirst( &aScType );
@@ -479,7 +480,7 @@ BOOL ScDocumentLoader::GetFilterName( const String& rFileName,
{
rFilter = pMed->GetFilter()->GetFilterName();
rOptions = GetOptions(*pMed);
- return TRUE;
+ return sal_True;
}
}
pDocSh = SfxObjectShell::GetNext( *pDocSh, &aScType );
@@ -488,16 +489,16 @@ BOOL ScDocumentLoader::GetFilterName( const String& rFileName,
INetURLObject aUrl( rFileName );
INetProtocol eProt = aUrl.GetProtocol();
if ( eProt == INET_PROT_NOT_VALID ) // invalid URL?
- return FALSE; // abort without creating a medium
+ return false; // abort without creating a medium
// Filter-Detection
const SfxFilter* pSfxFilter = NULL;
- SfxMedium* pMedium = new SfxMedium( rFileName, STREAM_STD_READ, FALSE );
+ SfxMedium* pMedium = new SfxMedium( rFileName, STREAM_STD_READ, false );
if ( pMedium->GetError() == ERRCODE_NONE )
{
if ( bWithInteraction )
- pMedium->UseInteractionHandler(TRUE); // #i73992# no longer called from GuessFilter
+ pMedium->UseInteractionHandler(sal_True); // #i73992# no longer called from GuessFilter
SfxFilterMatcher aMatcher( String::CreateFromAscii("scalc") );
if( bWithContent )
@@ -506,7 +507,7 @@ BOOL ScDocumentLoader::GetFilterName( const String& rFileName,
aMatcher.GuessFilterIgnoringContent( *pMedium, &pSfxFilter );
}
- BOOL bOK = FALSE;
+ sal_Bool bOK = false;
if ( pMedium->GetError() == ERRCODE_NONE )
{
if ( pSfxFilter )
@@ -531,12 +532,12 @@ void ScDocumentLoader::RemoveAppPrefix( String& rFilterName )
ScDocumentLoader::ScDocumentLoader( const String& rFileName,
String& rFilterName, String& rOptions,
- UINT32 nRekCnt, BOOL bWithInteraction ) :
+ sal_uInt32 nRekCnt, sal_Bool bWithInteraction ) :
pDocShell(0),
pMedium(0)
{
if ( !rFilterName.Len() )
- GetFilterName( rFileName, rFilterName, rOptions, TRUE, bWithInteraction );
+ GetFilterName( rFileName, rFilterName, rOptions, sal_True, bWithInteraction );
const SfxFilter* pFilter = ScDocShell::Factory().GetFilterContainer()->GetFilter4FilterName( rFilterName );
@@ -545,12 +546,12 @@ ScDocumentLoader::ScDocumentLoader( const String& rFileName,
if ( rOptions.Len() )
pSet->Put( SfxStringItem( SID_FILE_FILTEROPTIONS, rOptions ) );
- pMedium = new SfxMedium( rFileName, STREAM_STD_READ, FALSE, pFilter, pSet );
+ pMedium = new SfxMedium( rFileName, STREAM_STD_READ, false, pFilter, pSet );
if ( pMedium->GetError() != ERRCODE_NONE )
return ;
if ( bWithInteraction )
- pMedium->UseInteractionHandler( TRUE ); // to enable the filter options dialog
+ pMedium->UseInteractionHandler( sal_True ); // to enable the filter options dialog
pDocShell = new ScDocShell( SFX_CREATE_MODE_INTERNAL );
aRef = pDocShell;
@@ -600,12 +601,12 @@ ScDocument* ScDocumentLoader::GetDocument()
return pDocShell ? pDocShell->GetDocument() : 0;
}
-BOOL ScDocumentLoader::IsError() const
+sal_Bool ScDocumentLoader::IsError() const
{
if ( pDocShell && pMedium )
return pMedium->GetError() != ERRCODE_NONE;
else
- return TRUE;
+ return sal_True;
}
String ScDocumentLoader::GetTitle() const
diff --git a/sc/source/ui/docshell/tpstat.cxx b/sc/source/ui/docshell/tpstat.cxx
index 32a45998827e..0c9dcef4606f 100644
--- a/sc/source/ui/docshell/tpstat.cxx
+++ b/sc/source/ui/docshell/tpstat.cxx
@@ -86,9 +86,9 @@ ScDocStatPage::~ScDocStatPage()
//------------------------------------------------------------------------
-BOOL ScDocStatPage::FillItemSet( SfxItemSet& /* rSet */ )
+sal_Bool ScDocStatPage::FillItemSet( SfxItemSet& /* rSet */ )
{
- return FALSE;
+ return false;
}
//------------------------------------------------------------------------