summaryrefslogtreecommitdiff
path: root/sc/source/core/data/documen8.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/core/data/documen8.cxx')
-rw-r--r--sc/source/core/data/documen8.cxx321
1 files changed, 166 insertions, 155 deletions
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index 0b525317ea12..cec0c0c45ca0 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -96,6 +96,7 @@
#include "charthelper.hxx"
#include "macromgr.hxx"
#include "dpobject.hxx"
+#include "docuno.hxx"
#define GET_SCALEVALUE(set,id) ((const SfxUInt16Item&)(set.Get( id ))).GetValue()
@@ -125,7 +126,7 @@ void ScDocument::ImplDeleteOptions()
//------------------------------------------------------------------------
-SfxPrinter* ScDocument::GetPrinter(BOOL bCreateIfNotExist)
+SfxPrinter* ScDocument::GetPrinter(sal_Bool bCreateIfNotExist)
{
if ( !pPrinter && bCreateIfNotExist )
{
@@ -138,7 +139,7 @@ SfxPrinter* ScDocument::GetPrinter(BOOL bCreateIfNotExist)
NULL );
::utl::MiscCfg aMisc;
- USHORT nFlags = 0;
+ sal_uInt16 nFlags = 0;
if ( aMisc.IsPaperOrientationWarning() )
nFlags |= SFX_PRINTER_CHG_ORIENTATION;
if ( aMisc.IsPaperSizeWarning() )
@@ -174,7 +175,7 @@ void ScDocument::SetPrinter( SfxPrinter* pNewPrinter )
pPrinter->SetDigitLanguage( SC_MOD()->GetOptDigitLanguage() );
delete pOld;
}
- InvalidateTextWidth(NULL, NULL, FALSE); // in both cases
+ InvalidateTextWidth(NULL, NULL, false); // in both cases
}
//------------------------------------------------------------------------
@@ -189,7 +190,7 @@ void ScDocument::SetPrintOptions()
::utl::MiscCfg aMisc;
SfxItemSet aOptSet( pPrinter->GetOptions() );
- USHORT nFlags = 0;
+ sal_uInt16 nFlags = 0;
if ( aMisc.IsPaperOrientationWarning() )
nFlags |= SFX_PRINTER_CHG_ORIENTATION;
if ( aMisc.IsPaperSizeWarning() )
@@ -238,11 +239,11 @@ void ScDocument::ModifyStyleSheet( SfxStyleSheetBase& rStyleSheet,
{
case SFX_STYLE_FAMILY_PAGE:
{
- const USHORT nOldScale = GET_SCALEVALUE(rSet,ATTR_PAGE_SCALE);
- const USHORT nOldScaleToPages = GET_SCALEVALUE(rSet,ATTR_PAGE_SCALETOPAGES);
+ const sal_uInt16 nOldScale = GET_SCALEVALUE(rSet,ATTR_PAGE_SCALE);
+ const sal_uInt16 nOldScaleToPages = GET_SCALEVALUE(rSet,ATTR_PAGE_SCALETOPAGES);
rSet.Put( rChanges );
- const USHORT nNewScale = GET_SCALEVALUE(rSet,ATTR_PAGE_SCALE);
- const USHORT nNewScaleToPages = GET_SCALEVALUE(rSet,ATTR_PAGE_SCALETOPAGES);
+ const sal_uInt16 nNewScale = GET_SCALEVALUE(rSet,ATTR_PAGE_SCALE);
+ const sal_uInt16 nNewScaleToPages = GET_SCALEVALUE(rSet,ATTR_PAGE_SCALETOPAGES);
if ( (nOldScale != nNewScale) || (nOldScaleToPages != nNewScaleToPages) )
InvalidateTextWidth( rStyleSheet.GetName() );
@@ -250,7 +251,7 @@ void ScDocument::ModifyStyleSheet( SfxStyleSheetBase& rStyleSheet,
if( SvtLanguageOptions().IsCTLFontEnabled() )
{
const SfxPoolItem *pItem = NULL;
- if( rChanges.GetItemState(ATTR_WRITINGDIR, TRUE, &pItem ) == SFX_ITEM_SET )
+ if( rChanges.GetItemState(ATTR_WRITINGDIR, sal_True, &pItem ) == SFX_ITEM_SET )
ScChartHelper::DoUpdateAllCharts( this );
}
}
@@ -258,19 +259,19 @@ void ScDocument::ModifyStyleSheet( SfxStyleSheetBase& rStyleSheet,
case SFX_STYLE_FAMILY_PARA:
{
- BOOL bNumFormatChanged;
+ sal_Bool bNumFormatChanged;
if ( ScGlobal::CheckWidthInvalidate( bNumFormatChanged,
rSet, rChanges ) )
InvalidateTextWidth( NULL, NULL, bNumFormatChanged );
for (SCTAB nTab=0; nTab<=MAXTAB; ++nTab)
if (pTab[nTab] && pTab[nTab]->IsStreamValid())
- pTab[nTab]->SetStreamValid( FALSE );
+ pTab[nTab]->SetStreamValid( false );
- ULONG nOldFormat =
+ sal_uLong nOldFormat =
((const SfxUInt32Item*)&rSet.Get(
ATTR_VALUE_FORMAT ))->GetValue();
- ULONG nNewFormat =
+ sal_uLong nNewFormat =
((const SfxUInt32Item*)&rChanges.Get(
ATTR_VALUE_FORMAT ))->GetValue();
LanguageType eNewLang, eOldLang;
@@ -287,10 +288,10 @@ void ScDocument::ModifyStyleSheet( SfxStyleSheetBase& rStyleSheet,
// Dontcare - Default setzen
// Default - keine Aenderung
// ("keine Aenderung" geht nicht mit PutExtended, darum Schleife)
- for (USHORT nWhich = ATTR_PATTERN_START; nWhich <= ATTR_PATTERN_END; nWhich++)
+ for (sal_uInt16 nWhich = ATTR_PATTERN_START; nWhich <= ATTR_PATTERN_END; nWhich++)
{
const SfxPoolItem* pItem;
- SfxItemState eState = rChanges.GetItemState( nWhich, FALSE, &pItem );
+ SfxItemState eState = rChanges.GetItemState( nWhich, false, &pItem );
if ( eState == SFX_ITEM_SET )
rSet.Put( *pItem );
else if ( eState == SFX_ITEM_DONTCARE )
@@ -335,14 +336,14 @@ void ScDocument::InvalidateTextWidth( SCTAB nTab )
{
ScAddress aAdrFrom( 0, 0, nTab );
ScAddress aAdrTo ( MAXCOL, MAXROW, nTab );
- InvalidateTextWidth( &aAdrFrom, &aAdrTo, FALSE );
+ InvalidateTextWidth( &aAdrFrom, &aAdrTo, false );
}
//------------------------------------------------------------------------
-BOOL ScDocument::IsPageStyleInUse( const String& rStrPageStyle, SCTAB* pInTab )
+sal_Bool ScDocument::IsPageStyleInUse( const String& rStrPageStyle, SCTAB* pInTab )
{
- BOOL bInUse = FALSE;
+ sal_Bool bInUse = false;
const SCTAB nCount = GetTableCount();
SCTAB i;
@@ -357,30 +358,30 @@ BOOL ScDocument::IsPageStyleInUse( const String& rStrPageStyle, SCTAB* pInTab )
//------------------------------------------------------------------------
-BOOL ScDocument::RemovePageStyleInUse( const String& rStyle )
+sal_Bool ScDocument::RemovePageStyleInUse( const String& rStyle )
{
- BOOL bWasInUse = FALSE;
+ sal_Bool bWasInUse = false;
const SCTAB nCount = GetTableCount();
for ( SCTAB i=0; i<nCount && pTab[i]; i++ )
if ( pTab[i]->GetPageStyle() == rStyle )
{
- bWasInUse = TRUE;
+ bWasInUse = sal_True;
pTab[i]->SetPageStyle( ScGlobal::GetRscString(STR_STYLENAME_STANDARD) );
}
return bWasInUse;
}
-BOOL ScDocument::RenamePageStyleInUse( const String& rOld, const String& rNew )
+sal_Bool ScDocument::RenamePageStyleInUse( const String& rOld, const String& rNew )
{
- BOOL bWasInUse = FALSE;
+ sal_Bool bWasInUse = false;
const SCTAB nCount = GetTableCount();
for ( SCTAB i=0; i<nCount && pTab[i]; i++ )
if ( pTab[i]->GetPageStyle() == rOld )
{
- bWasInUse = TRUE;
+ bWasInUse = sal_True;
pTab[i]->SetPageStyle( rNew );
}
@@ -389,7 +390,7 @@ BOOL ScDocument::RenamePageStyleInUse( const String& rOld, const String& rNew )
//------------------------------------------------------------------------
-BYTE ScDocument::GetEditTextDirection(SCTAB nTab) const
+sal_uInt8 ScDocument::GetEditTextDirection(SCTAB nTab) const
{
EEHorizontalTextDirection eRet = EE_HTEXTDIR_DEFAULT;
@@ -408,7 +409,7 @@ BYTE ScDocument::GetEditTextDirection(SCTAB nTab) const
// else (invalid for EditEngine): keep "default"
}
- return sal::static_int_cast<BYTE>(eRet);
+ return sal::static_int_cast<sal_uInt8>(eRet);
}
ScMacroManager* ScDocument::GetMacroManager()
@@ -421,9 +422,9 @@ ScMacroManager* ScDocument::GetMacroManager()
//------------------------------------------------------------------------
void ScDocument::InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress* pAdrTo,
- BOOL bNumFormatChanged )
+ sal_Bool bNumFormatChanged )
{
- BOOL bBroadcast = (bNumFormatChanged && GetDocOptions().IsCalcAsShown() && !IsImportingXML() && !IsClipboard());
+ sal_Bool bBroadcast = (bNumFormatChanged && GetDocOptions().IsCalcAsShown() && !IsImportingXML() && !IsClipboard());
if ( pAdrFrom && !pAdrTo )
{
const SCTAB nTab = pAdrFrom->Tab();
@@ -447,14 +448,14 @@ void ScDocument::InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress
#define CALCMAX 1000 // Berechnungen
#define ABORT_EVENTS (INPUT_ANY & ~INPUT_TIMER & ~INPUT_OTHER)
-BOOL ScDocument::IdleCalcTextWidth() // TRUE = demnaechst wieder versuchen
+sal_Bool ScDocument::IdleCalcTextWidth() // sal_True = demnaechst wieder versuchen
{
// #i75610# if a printer hasn't been set or created yet, don't create one for this
- if ( bIdleDisabled || IsInLinkUpdate() || GetPrinter(FALSE) == NULL )
- return FALSE;
- bIdleDisabled = TRUE;
+ if ( bIdleDisabled || IsInLinkUpdate() || GetPrinter(false) == NULL )
+ return false;
+ bIdleDisabled = sal_True;
- const ULONG nStart = Time::GetSystemTicks();
+ const sal_uLong nStart = Time::GetSystemTicks();
OutputDevice* pDev = NULL;
MapMode aOldMap;
ScStyleSheet* pStyle = NULL;
@@ -465,7 +466,7 @@ BOOL ScDocument::IdleCalcTextWidth() // TRUE = demnaechst wieder vers
SCTAB nTab = aCurTextWidthCalcPos.Tab();
SCROW nRow = aCurTextWidthCalcPos.Row();
SCsCOL nCol = aCurTextWidthCalcPos.Col();
- BOOL bNeedMore= FALSE;
+ sal_Bool bNeedMore= false;
if ( !ValidRow(nRow) )
nRow = 0, nCol--;
@@ -479,7 +480,7 @@ BOOL ScDocument::IdleCalcTextWidth() // TRUE = demnaechst wieder vers
// Query-Box aufgemacht wird !!!
ScStyleSheetPool* pStylePool = xPoolHelper->GetStylePool();
- USHORT nOldMask = pStylePool->GetSearchMask();
+ sal_uInt16 nOldMask = pStylePool->GetSearchMask();
SfxStyleFamily eOldFam = pStylePool->GetSearchFamily();
pTable = pTab[nTab];
@@ -489,12 +490,12 @@ BOOL ScDocument::IdleCalcTextWidth() // TRUE = demnaechst wieder vers
DBG_ASSERT( pStyle, "Missing StyleSheet :-/" );
- BOOL bProgress = FALSE;
+ sal_Bool bProgress = false;
if ( pStyle && 0 == GET_SCALEVALUE(pStyle->GetItemSet(),ATTR_PAGE_SCALETOPAGES) )
{
- USHORT nRestart = 0;
- USHORT nZoom = 0;
- USHORT nCount = 0;
+ sal_uInt16 nRestart = 0;
+ sal_uInt16 nZoom = 0;
+ sal_uInt16 nCount = 0;
nZoom = GET_SCALEVALUE(pStyle->GetItemSet(),ATTR_PAGE_SCALE);
Fraction aZoomFract( nZoom, 100 );
@@ -522,23 +523,23 @@ BOOL ScDocument::IdleCalcTextWidth() // TRUE = demnaechst wieder vers
if ( !bProgress && pCell->GetCellType() == CELLTYPE_FORMULA
&& ((ScFormulaCell*)pCell)->GetDirty() )
{
- ScProgress::CreateInterpretProgress( this, FALSE );
- bProgress = TRUE;
+ ScProgress::CreateInterpretProgress( this, false );
+ bProgress = sal_True;
}
- USHORT nNewWidth = (USHORT)GetNeededSize( nCol, nRow, nTab,
+ sal_uInt16 nNewWidth = (sal_uInt16)GetNeededSize( nCol, nRow, nTab,
pDev, nPPTX, nPPTY,
- aZoomFract,aZoomFract, TRUE,
- TRUE ); // bTotalSize
+ aZoomFract,aZoomFract, sal_True,
+ sal_True ); // bTotalSize
pCell->SetTextWidth( nNewWidth );
- bNeedMore = TRUE;
+ bNeedMore = sal_True;
}
}
else
{
- BOOL bNewTab = FALSE;
+ sal_Bool bNewTab = false;
nRow = 0;
nCol--;
@@ -547,14 +548,14 @@ BOOL ScDocument::IdleCalcTextWidth() // TRUE = demnaechst wieder vers
{
nCol = MAXCOL;
nTab++;
- bNewTab = TRUE;
+ bNewTab = sal_True;
}
if ( !ValidTab(nTab) || !pTab[nTab] )
{
nTab = 0;
nRestart++;
- bNewTab = TRUE;
+ bNewTab = sal_True;
}
if ( nRestart < 2 )
@@ -619,7 +620,7 @@ BOOL ScDocument::IdleCalcTextWidth() // TRUE = demnaechst wieder vers
aCurTextWidthCalcPos.SetCol( (SCCOL)nCol );
pStylePool->SetSearchMask( eOldFam, nOldMask );
- bIdleDisabled = FALSE;
+ bIdleDisabled = false;
return bNeedMore;
}
@@ -629,18 +630,18 @@ BOOL ScDocument::IdleCalcTextWidth() // TRUE = demnaechst wieder vers
class ScSpellStatus
{
public:
- BOOL bModified;
+ sal_Bool bModified;
- ScSpellStatus() : bModified(FALSE) {};
+ ScSpellStatus() : bModified(false) {};
DECL_LINK (EventHdl, EditStatus*);
};
IMPL_LINK( ScSpellStatus, EventHdl, EditStatus *, pStatus )
{
- ULONG nStatus = pStatus->GetStatusWord();
+ sal_uLong nStatus = pStatus->GetStatusWord();
if ( nStatus & EE_STAT_WRONGWORDCHANGED )
- bModified = TRUE;
+ bModified = sal_True;
return 0;
}
@@ -656,16 +657,16 @@ IMPL_LINK( ScSpellStatus, EventHdl, EditStatus *, pStatus )
#define SPELL_MAXTEST_ALL 3
#define SPELL_MAXCELLS 256
-BOOL ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress& rSpellPos,
- USHORT nMaxTest )
+sal_Bool ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress& rSpellPos,
+ sal_uInt16 nMaxTest )
{
ScEditEngineDefaulter* pEngine = NULL; //! am Dokument speichern
SfxItemSet* pDefaults = NULL;
ScSpellStatus aStatus;
- USHORT nCellCount = 0; // Zellen insgesamt
- USHORT nTestCount = 0; // Aufrufe Spelling
- BOOL bChanged = FALSE; // Aenderungen?
+ sal_uInt16 nCellCount = 0; // Zellen insgesamt
+ sal_uInt16 nTestCount = 0; // Aufrufe Spelling
+ sal_Bool bChanged = false; // Aenderungen?
SCCOL nCol = rSpellRange.aStart.Col(); // iterator always starts on the left edge
SCROW nRow = rSpellPos.Row();
@@ -677,7 +678,7 @@ BOOL ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress& rSpe
if ( !pTab[nTab] )
{
// may happen for visible range
- return FALSE;
+ return false;
}
}
ScHorizontalCellIterator aIter( this, nTab,
@@ -717,9 +718,9 @@ BOOL ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress& rSpe
const ScPatternAttr* pPattern = GetPattern( nCol, nRow, nTab );
pPattern->FillEditItemSet( pDefaults );
- pEngine->SetDefaults( pDefaults, FALSE ); //! noetig ?
+ pEngine->SetDefaults( pDefaults, false ); //! noetig ?
- USHORT nCellLang = ((const SvxLanguageItem&)
+ sal_uInt16 nCellLang = ((const SvxLanguageItem&)
pPattern->GetItem(ATTR_FONT_LANGUAGE)).GetValue();
if ( nCellLang == LANGUAGE_SYSTEM )
nCellLang = Application::GetSettings().GetLanguage(); // never use SYSTEM for spelling
@@ -734,11 +735,11 @@ BOOL ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress& rSpe
else
pEngine->SetText( *((ScEditCell*)pCell)->GetData() );
- aStatus.bModified = FALSE;
+ aStatus.bModified = false;
pEngine->CompleteOnlineSpelling();
if ( aStatus.bModified ) // Fehler dazu oder weggekommen?
{
- BOOL bNeedEdit = TRUE; // Test auf einfachen Text
+ sal_Bool bNeedEdit = sal_True; // Test auf einfachen Text
if ( !pEngine->HasOnlineSpellErrors() )
{
ScEditAttrTester aTester( pEngine );
@@ -765,11 +766,11 @@ BOOL ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress& rSpe
// Seitenvorschau ist davon nicht betroffen
// (sollte jedenfalls nicht)
ScPaintHint aHint( ScRange( nCol, nRow, nTab ), PAINT_GRID );
- aHint.SetPrintFlag( FALSE );
+ aHint.SetPrintFlag( false );
pShell->Broadcast( aHint );
}
- bChanged = TRUE;
+ bChanged = sal_True;
}
if ( ++nTestCount >= nMaxTest ) // checked enough text?
@@ -811,24 +812,24 @@ BOOL ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress& rSpe
}
-BOOL ScDocument::ContinueOnlineSpelling()
+sal_Bool ScDocument::ContinueOnlineSpelling()
{
if ( bIdleDisabled || !pDocOptions->IsAutoSpell() || (pShell && pShell->IsReadOnly()) )
- return FALSE;
+ return false;
// #i48433# set bInsertingFromOtherDoc flag so there are no broadcasts when PutCell is called
// (same behavior as in RemoveAutoSpellObj: just transfer the broadcaster)
- BOOL bOldInserting = IsInsertingFromOtherDoc();
- SetInsertingFromOtherDoc( TRUE );
+ sal_Bool bOldInserting = IsInsertingFromOtherDoc();
+ SetInsertingFromOtherDoc( sal_True );
//! use one EditEngine for both calls
// first check visible range
- BOOL bResult = OnlineSpellInRange( aVisSpellRange, aVisSpellPos, SPELL_MAXTEST_VIS );
+ sal_Bool bResult = OnlineSpellInRange( aVisSpellRange, aVisSpellPos, SPELL_MAXTEST_VIS );
// during first pass through visible range, always continue
if ( nVisSpellState == VSPL_START )
- bResult = TRUE;
+ bResult = sal_True;
if (bResult)
{
@@ -857,13 +858,13 @@ void ScDocument::SetOnlineSpellPos( const ScAddress& rPos )
aOnlineSpellPos = aVisSpellRange.aEnd;
}
-BOOL ScDocument::SetVisibleSpellRange( const ScRange& rNewRange )
+sal_Bool ScDocument::SetVisibleSpellRange( const ScRange& rNewRange )
{
- BOOL bChange = ( aVisSpellRange != rNewRange );
+ sal_Bool bChange = ( aVisSpellRange != rNewRange );
if (bChange)
{
// continue spelling through visible range when scrolling down
- BOOL bContDown = ( nVisSpellState == VSPL_START && rNewRange.In( aVisSpellPos ) &&
+ sal_Bool bContDown = ( nVisSpellState == VSPL_START && rNewRange.In( aVisSpellPos ) &&
rNewRange.aStart.Row() > aVisSpellRange.aStart.Row() &&
rNewRange.aStart.Col() == aVisSpellRange.aStart.Col() &&
rNewRange.aEnd.Col() == aVisSpellRange.aEnd.Col() );
@@ -891,17 +892,27 @@ void ScDocument::RemoveAutoSpellObj()
pTab[nTab]->RemoveAutoSpellObj();
}
+void ScDocument::RepaintRange( const ScRange& rRange )
+{
+ if ( bIsVisible && pShell )
+ {
+ ScModelObj* pModel = ScModelObj::getImplementation( pShell->GetModel() );
+ if ( pModel )
+ pModel->RepaintRange( rRange ); // locked repaints are checked there
+ }
+}
+
//------------------------------------------------------------------------
-BOOL ScDocument::IdleCheckLinks() // TRUE = demnaechst wieder versuchen
+sal_Bool ScDocument::IdleCheckLinks() // sal_True = demnaechst wieder versuchen
{
- BOOL bAnyLeft = FALSE;
+ sal_Bool bAnyLeft = false;
if (GetLinkManager())
{
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
- USHORT nCount = rLinks.Count();
- for (USHORT i=0; i<nCount; i++)
+ sal_uInt16 nCount = rLinks.Count();
+ for (sal_uInt16 i=0; i<nCount; i++)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
if (pBase->ISA(ScDdeLink))
@@ -911,7 +922,7 @@ BOOL ScDocument::IdleCheckLinks() // TRUE = demnaechst wieder versuche
{
pDdeLink->TryUpdate();
if (pDdeLink->NeedsUpdate()) // war nix?
- bAnyLeft = TRUE;
+ bAnyLeft = sal_True;
}
}
}
@@ -923,15 +934,15 @@ BOOL ScDocument::IdleCheckLinks() // TRUE = demnaechst wieder versuche
void ScDocument::SaveDdeLinks(SvStream& rStream) const
{
// bei 4.0-Export alle mit Modus != DEFAULT weglassen
- BOOL bExport40 = ( rStream.GetVersion() <= SOFFICE_FILEFORMAT_40 );
+ sal_Bool bExport40 = ( rStream.GetVersion() <= SOFFICE_FILEFORMAT_40 );
const ::sfx2::SvBaseLinks& rLinks = GetLinkManager()->GetLinks();
- USHORT nCount = rLinks.Count();
+ sal_uInt16 nCount = rLinks.Count();
// erstmal zaehlen...
- USHORT nDdeCount = 0;
- USHORT i;
+ sal_uInt16 nDdeCount = 0;
+ sal_uInt16 i;
for (i=0; i<nCount; i++)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
@@ -964,9 +975,9 @@ void ScDocument::LoadDdeLinks(SvStream& rStream)
ScMultipleReadHeader aHdr( rStream );
GetLinkManager();
- USHORT nCount;
+ sal_uInt16 nCount;
rStream >> nCount;
- for (USHORT i=0; i<nCount; i++)
+ for (sal_uInt16 i=0; i<nCount; i++)
{
ScDdeLink* pLink = new ScDdeLink( this, rStream, aHdr );
pLinkManager->InsertDDELink( pLink,
@@ -974,21 +985,21 @@ void ScDocument::LoadDdeLinks(SvStream& rStream)
}
}
-BOOL ScDocument::HasDdeLinks() const
+sal_Bool ScDocument::HasDdeLinks() const
{
if (GetLinkManager()) // Clipboard z.B. hat keinen LinkManager
{
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
- USHORT nCount = rLinks.Count();
- for (USHORT i=0; i<nCount; i++)
+ sal_uInt16 nCount = rLinks.Count();
+ for (sal_uInt16 i=0; i<nCount; i++)
if ((*rLinks[i])->ISA(ScDdeLink))
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return false;
}
-void ScDocument::SetInLinkUpdate(BOOL bSet)
+void ScDocument::SetInLinkUpdate(sal_Bool bSet)
{
// called from TableLink and AreaLink
@@ -996,7 +1007,7 @@ void ScDocument::SetInLinkUpdate(BOOL bSet)
bInLinkUpdate = bSet;
}
-BOOL ScDocument::IsInLinkUpdate() const
+sal_Bool ScDocument::IsInLinkUpdate() const
{
return bInLinkUpdate || IsInDdeLinkUpdate();
}
@@ -1007,10 +1018,10 @@ void ScDocument::UpdateExternalRefLinks()
return;
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
- USHORT nCount = rLinks.Count();
+ sal_uInt16 nCount = rLinks.Count();
bool bAny = false;
- for (USHORT i = 0; i < nCount; ++i)
+ for (sal_uInt16 i = 0; i < nCount; ++i)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
ScExternalRefLink* pRefLink = dynamic_cast<ScExternalRefLink*>(pBase);
@@ -1029,7 +1040,7 @@ void ScDocument::UpdateExternalRefLinks()
// #i101960# set document modified, as in TrackTimeHdl for DDE links
if (!pShell->IsModified())
{
- pShell->SetModified( TRUE );
+ pShell->SetModified( sal_True );
SfxBindings* pBindings = GetViewBindings();
if (pBindings)
{
@@ -1045,19 +1056,19 @@ void ScDocument::UpdateDdeLinks()
if (GetLinkManager())
{
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
- USHORT nCount = rLinks.Count();
- USHORT i;
+ sal_uInt16 nCount = rLinks.Count();
+ sal_uInt16 i;
// falls das Updaten laenger dauert, erstmal alle Werte
// zuruecksetzen, damit nichts altes (falsches) stehen bleibt
- BOOL bAny = FALSE;
+ sal_Bool bAny = false;
for (i=0; i<nCount; i++)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
if (pBase->ISA(ScDdeLink))
{
((ScDdeLink*)pBase)->ResetValue();
- bAny = TRUE;
+ bAny = sal_True;
}
}
if (bAny)
@@ -1082,18 +1093,18 @@ void ScDocument::UpdateDdeLinks()
}
}
-BOOL ScDocument::UpdateDdeLink( const String& rAppl, const String& rTopic, const String& rItem )
+sal_Bool ScDocument::UpdateDdeLink( const String& rAppl, const String& rTopic, const String& rItem )
{
// fuer refresh() per StarOne Api
// ResetValue() fuer einzelnen Link nicht noetig
//! wenn's mal alles asynchron wird, aber auch hier
- BOOL bFound = FALSE;
+ sal_Bool bFound = false;
if (GetLinkManager())
{
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
- USHORT nCount = rLinks.Count();
- for (USHORT i=0; i<nCount; i++)
+ sal_uInt16 nCount = rLinks.Count();
+ for (sal_uInt16 i=0; i<nCount; i++)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
if (pBase->ISA(ScDdeLink))
@@ -1104,7 +1115,7 @@ BOOL ScDocument::UpdateDdeLink( const String& rAppl, const String& rTopic, const
pDdeLink->GetItem() == rItem )
{
pDdeLink->TryUpdate();
- bFound = TRUE; // koennen theoretisch mehrere sein (Mode), darum weitersuchen
+ bFound = sal_True; // koennen theoretisch mehrere sein (Mode), darum weitersuchen
}
}
}
@@ -1118,8 +1129,8 @@ void ScDocument::DisconnectDdeLinks()
if (GetLinkManager())
{
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
- USHORT nCount = rLinks.Count();
- for (USHORT i=0; i<nCount; i++)
+ sal_uInt16 nCount = rLinks.Count();
+ for (sal_uInt16 i=0; i<nCount; i++)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
if (pBase->ISA(ScDdeLink))
@@ -1141,8 +1152,8 @@ void ScDocument::CopyDdeLinks( ScDocument* pDestDoc ) const
else if (GetLinkManager()) // Links direkt kopieren
{
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
- USHORT nCount = rLinks.Count();
- for (USHORT i=0; i<nCount; i++)
+ sal_uInt16 nCount = rLinks.Count();
+ for (sal_uInt16 i=0; i<nCount; i++)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
if (pBase->ISA(ScDdeLink))
@@ -1156,14 +1167,14 @@ void ScDocument::CopyDdeLinks( ScDocument* pDestDoc ) const
}
}
-USHORT ScDocument::GetDdeLinkCount() const
+sal_uInt16 ScDocument::GetDdeLinkCount() const
{
- USHORT nDdeCount = 0;
+ sal_uInt16 nDdeCount = 0;
if (GetLinkManager())
{
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
- USHORT nCount = rLinks.Count();
- for (USHORT i=0; i<nCount; i++)
+ sal_uInt16 nCount = rLinks.Count();
+ for (sal_uInt16 i=0; i<nCount; i++)
if ((*rLinks[i])->ISA(ScDdeLink))
++nDdeCount;
}
@@ -1180,15 +1191,15 @@ namespace {
@return The DDE link, if it exists, otherwise 0. */
ScDdeLink* lclGetDdeLink(
const sfx2::LinkManager* pLinkManager,
- const String& rAppl, const String& rTopic, const String& rItem, BYTE nMode,
- USHORT* pnDdePos = NULL )
+ const String& rAppl, const String& rTopic, const String& rItem, sal_uInt8 nMode,
+ sal_uInt16* pnDdePos = NULL )
{
if( pLinkManager )
{
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
- USHORT nCount = rLinks.Count();
+ sal_uInt16 nCount = rLinks.Count();
if( pnDdePos ) *pnDdePos = 0;
- for( USHORT nIndex = 0; nIndex < nCount; ++nIndex )
+ for( sal_uInt16 nIndex = 0; nIndex < nCount; ++nIndex )
{
::sfx2::SvBaseLink* pLink = *rLinks[ nIndex ];
if( ScDdeLink* pDdeLink = PTR_CAST( ScDdeLink, pLink ) )
@@ -1208,14 +1219,14 @@ ScDdeLink* lclGetDdeLink(
/** Returns a pointer to the specified DDE link.
@param nDdePos Index of the DDE link (does not include other links from link manager).
@return The DDE link, if it exists, otherwise 0. */
-ScDdeLink* lclGetDdeLink( const sfx2::LinkManager* pLinkManager, USHORT nDdePos )
+ScDdeLink* lclGetDdeLink( const sfx2::LinkManager* pLinkManager, sal_uInt16 nDdePos )
{
if( pLinkManager )
{
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
- USHORT nCount = rLinks.Count();
- USHORT nDdeIndex = 0; // counts only the DDE links
- for( USHORT nIndex = 0; nIndex < nCount; ++nIndex )
+ sal_uInt16 nCount = rLinks.Count();
+ sal_uInt16 nDdeIndex = 0; // counts only the DDE links
+ for( sal_uInt16 nIndex = 0; nIndex < nCount; ++nIndex )
{
::sfx2::SvBaseLink* pLink = *rLinks[ nIndex ];
if( ScDdeLink* pDdeLink = PTR_CAST( ScDdeLink, pLink ) )
@@ -1233,12 +1244,12 @@ ScDdeLink* lclGetDdeLink( const sfx2::LinkManager* pLinkManager, USHORT nDdePos
// ----------------------------------------------------------------------------
-bool ScDocument::FindDdeLink( const String& rAppl, const String& rTopic, const String& rItem, BYTE nMode, USHORT& rnDdePos )
+bool ScDocument::FindDdeLink( const String& rAppl, const String& rTopic, const String& rItem, sal_uInt8 nMode, sal_uInt16& rnDdePos )
{
return lclGetDdeLink( GetLinkManager(), rAppl, rTopic, rItem, nMode, &rnDdePos ) != NULL;
}
-bool ScDocument::GetDdeLinkData( USHORT nDdePos, String& rAppl, String& rTopic, String& rItem ) const
+bool ScDocument::GetDdeLinkData( sal_uInt16 nDdePos, String& rAppl, String& rTopic, String& rItem ) const
{
if( const ScDdeLink* pDdeLink = lclGetDdeLink( GetLinkManager(), nDdePos ) )
{
@@ -1250,7 +1261,7 @@ bool ScDocument::GetDdeLinkData( USHORT nDdePos, String& rAppl, String& rTopic,
return false;
}
-bool ScDocument::GetDdeLinkMode( USHORT nDdePos, BYTE& rnMode ) const
+bool ScDocument::GetDdeLinkMode( sal_uInt16 nDdePos, sal_uInt8& rnMode ) const
{
if( const ScDdeLink* pDdeLink = lclGetDdeLink( GetLinkManager(), nDdePos ) )
{
@@ -1260,13 +1271,13 @@ bool ScDocument::GetDdeLinkMode( USHORT nDdePos, BYTE& rnMode ) const
return false;
}
-const ScMatrix* ScDocument::GetDdeLinkResultMatrix( USHORT nDdePos ) const
+const ScMatrix* ScDocument::GetDdeLinkResultMatrix( sal_uInt16 nDdePos ) const
{
const ScDdeLink* pDdeLink = lclGetDdeLink( GetLinkManager(), nDdePos );
return pDdeLink ? pDdeLink->GetResult() : NULL;
}
-bool ScDocument::CreateDdeLink( const String& rAppl, const String& rTopic, const String& rItem, BYTE nMode, ScMatrixRef pResults )
+bool ScDocument::CreateDdeLink( const String& rAppl, const String& rTopic, const String& rItem, sal_uInt8 nMode, ScMatrixRef pResults )
{
/* Create a DDE link without updating it (i.e. for Excel import), to prevent
unwanted connections. First try to find existing link. Set result array
@@ -1292,7 +1303,7 @@ bool ScDocument::CreateDdeLink( const String& rAppl, const String& rTopic, const
return false;
}
-bool ScDocument::SetDdeLinkResultMatrix( USHORT nDdePos, ScMatrixRef pResults )
+bool ScDocument::SetDdeLinkResultMatrix( sal_uInt16 nDdePos, ScMatrixRef pResults )
{
if( ScDdeLink* pDdeLink = lclGetDdeLink( GetLinkManager(), nDdePos ) )
{
@@ -1304,18 +1315,18 @@ bool ScDocument::SetDdeLinkResultMatrix( USHORT nDdePos, ScMatrixRef pResults )
//------------------------------------------------------------------------
-BOOL ScDocument::HasAreaLinks() const
+sal_Bool ScDocument::HasAreaLinks() const
{
if (GetLinkManager()) // Clipboard z.B. hat keinen LinkManager
{
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
- USHORT nCount = rLinks.Count();
- for (USHORT i=0; i<nCount; i++)
+ sal_uInt16 nCount = rLinks.Count();
+ for (sal_uInt16 i=0; i<nCount; i++)
if ((*rLinks[i])->ISA(ScAreaLink))
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return false;
}
void ScDocument::UpdateAreaLinks()
@@ -1323,8 +1334,8 @@ void ScDocument::UpdateAreaLinks()
if (GetLinkManager())
{
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
- USHORT nCount = rLinks.Count();
- for (USHORT i=0; i<nCount; i++)
+ sal_uInt16 nCount = rLinks.Count();
+ for (sal_uInt16 i=0; i<nCount; i++)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
if (pBase->ISA(ScAreaLink))
@@ -1338,7 +1349,7 @@ void ScDocument::DeleteAreaLinksOnTab( SCTAB nTab )
if (GetLinkManager())
{
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
- USHORT nPos = 0;
+ sal_uInt16 nPos = 0;
while ( nPos < rLinks.Count() )
{
const ::sfx2::SvBaseLink* pBase = *rLinks[nPos];
@@ -1359,8 +1370,8 @@ void ScDocument::UpdateRefAreaLinks( UpdateRefMode eUpdateRefMode,
bool bAnyUpdate = false;
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
- USHORT nCount = rLinks.Count();
- for (USHORT i=0; i<nCount; i++)
+ sal_uInt16 nCount = rLinks.Count();
+ for (sal_uInt16 i=0; i<nCount; i++)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
if (pBase->ISA(ScAreaLink))
@@ -1394,7 +1405,7 @@ void ScDocument::UpdateRefAreaLinks( UpdateRefMode eUpdateRefMode,
// If several links start at the same cell, the one with the lower index is removed
// (file format specifies only one link definition for a cell).
- USHORT nFirstIndex = 0;
+ sal_uInt16 nFirstIndex = 0;
while ( nFirstIndex < nCount )
{
bool bFound = false;
@@ -1402,7 +1413,7 @@ void ScDocument::UpdateRefAreaLinks( UpdateRefMode eUpdateRefMode,
if ( pFirst->ISA(ScAreaLink) )
{
ScAddress aFirstPos = static_cast<ScAreaLink*>(pFirst)->GetDestArea().aStart;
- for ( USHORT nSecondIndex = nFirstIndex + 1; nSecondIndex < nCount && !bFound; ++nSecondIndex )
+ for ( sal_uInt16 nSecondIndex = nFirstIndex + 1; nSecondIndex < nCount && !bFound; ++nSecondIndex )
{
::sfx2::SvBaseLink* pSecond = *rLinks[nSecondIndex];
if ( pSecond->ISA(ScAreaLink) &&
@@ -1435,12 +1446,12 @@ void ScDocument::KeyInput( const KeyEvent& )
// ----------------------------------------------------------------------------
-BOOL ScDocument::CheckMacroWarn()
+sal_Bool ScDocument::CheckMacroWarn()
{
// The check for macro configuration, macro warning and disabling is now handled
// in SfxObjectShell::AdjustMacroMode, called by SfxObjectShell::CallBasic.
- return TRUE;
+ return sal_True;
}
//------------------------------------------------------------------------
@@ -1471,23 +1482,23 @@ SfxBindings* ScDocument::GetViewBindings()
void lcl_TransliterateEditEngine( ScEditEngineDefaulter& rEngine,
utl::TransliterationWrapper& rTranslitarationWrapper,
- BOOL bConsiderLanguage, ScDocument* pDoc )
+ sal_Bool bConsiderLanguage, ScDocument* pDoc )
{
//! should use TransliterateText method of EditEngine instead, when available!
sal_uInt16 nLanguage = LANGUAGE_SYSTEM;
- USHORT nParCount = rEngine.GetParagraphCount();
- for (USHORT nPar=0; nPar<nParCount; nPar++)
+ sal_uInt16 nParCount = rEngine.GetParagraphCount();
+ for (sal_uInt16 nPar=0; nPar<nParCount; nPar++)
{
SvUShorts aPortions;
- rEngine.GetPortions( (USHORT)nPar, aPortions );
+ rEngine.GetPortions( (sal_uInt16)nPar, aPortions );
- for ( USHORT nPos = aPortions.Count(); nPos; )
+ for ( sal_uInt16 nPos = aPortions.Count(); nPos; )
{
--nPos;
- USHORT nEnd = aPortions.GetObject( nPos );
- USHORT nStart = nPos ? aPortions.GetObject( nPos - 1 ) : 0;
+ sal_uInt16 nEnd = aPortions.GetObject( nPos );
+ sal_uInt16 nStart = nPos ? aPortions.GetObject( nPos - 1 ) : 0;
ESelection aSel( nPar, nStart, nPar, nEnd );
String aOldStr = rEngine.GetText( aSel );
@@ -1497,8 +1508,8 @@ void lcl_TransliterateEditEngine( ScEditEngineDefaulter& rEngine,
{
if ( bConsiderLanguage )
{
- BYTE nScript = pDoc->GetStringScriptType( aOldStr );
- USHORT nWhich = ( nScript == SCRIPTTYPE_ASIAN ) ? EE_CHAR_LANGUAGE_CJK :
+ sal_uInt8 nScript = pDoc->GetStringScriptType( aOldStr );
+ sal_uInt16 nWhich = ( nScript == SCRIPTTYPE_ASIAN ) ? EE_CHAR_LANGUAGE_CJK :
( ( nScript == SCRIPTTYPE_COMPLEX ) ? EE_CHAR_LANGUAGE_CTL :
EE_CHAR_LANGUAGE );
nLanguage = ((const SvxLanguageItem&)aAttr.Get(nWhich)).GetValue();
@@ -1525,7 +1536,7 @@ void ScDocument::TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nTyp
DBG_ASSERT( rMultiMark.IsMultiMarked(), "TransliterateText: no selection" );
utl::TransliterationWrapper aTranslitarationWrapper( xServiceManager, nType );
- BOOL bConsiderLanguage = aTranslitarationWrapper.needLanguageForTheMode();
+ sal_Bool bConsiderLanguage = aTranslitarationWrapper.needLanguageForTheMode();
sal_uInt16 nLanguage = LANGUAGE_SYSTEM;
ScEditEngineDefaulter* pEngine = NULL; // not using pEditEngine member because of defaults
@@ -1537,7 +1548,7 @@ void ScDocument::TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nTyp
SCCOL nCol = 0;
SCROW nRow = 0;
- BOOL bFound = rMultiMark.IsCellMarked( nCol, nRow );
+ sal_Bool bFound = rMultiMark.IsCellMarked( nCol, nRow );
if (!bFound)
bFound = GetNextMarkedCell( nCol, nRow, nTab, rMultiMark );
@@ -1554,8 +1565,8 @@ void ScDocument::TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nTyp
if ( bConsiderLanguage )
{
- BYTE nScript = GetStringScriptType( aOldStr ); //! cell script type?
- USHORT nWhich = ( nScript == SCRIPTTYPE_ASIAN ) ? ATTR_CJK_FONT_LANGUAGE :
+ sal_uInt8 nScript = GetStringScriptType( aOldStr ); //! cell script type?
+ sal_uInt16 nWhich = ( nScript == SCRIPTTYPE_ASIAN ) ? ATTR_CJK_FONT_LANGUAGE :
( ( nScript == SCRIPTTYPE_COMPLEX ) ? ATTR_CTL_FONT_LANGUAGE :
ATTR_FONT_LANGUAGE );
nLanguage = ((const SvxLanguageItem*)GetAttr( nCol, nRow, nTab, nWhich ))->GetValue();
@@ -1576,7 +1587,7 @@ void ScDocument::TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nTyp
const ScPatternAttr* pPattern = GetPattern( nCol, nRow, nTab );
SfxItemSet* pDefaults = new SfxItemSet( pEngine->GetEmptyItemSet() );
pPattern->FillEditItemSet( pDefaults );
- pEngine->SetDefaults( pDefaults, TRUE );
+ pEngine->SetDefaults( pDefaults, sal_True );
const EditTextObject* pData = ((const ScEditCell*)pCell)->GetData();
pEngine->SetText( *pData );
@@ -1592,7 +1603,7 @@ void ScDocument::TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nTyp
{
// remove defaults (paragraph attributes) before creating text object
SfxItemSet* pEmpty = new SfxItemSet( pEngine->GetEmptyItemSet() );
- pEngine->SetDefaults( pEmpty, TRUE );
+ pEngine->SetDefaults( pEmpty, sal_True );
EditTextObject* pNewData = pEngine->CreateTextObject();
PutCell( nCol, nRow, nTab,