diff options
Diffstat (limited to 'sc/source/ui/view/cellsh.cxx')
-rw-r--r-- | sc/source/ui/view/cellsh.cxx | 106 |
1 files changed, 53 insertions, 53 deletions
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx index c880a29f8067..f0b496260876 100644 --- a/sc/source/ui/view/cellsh.cxx +++ b/sc/source/ui/view/cellsh.cxx @@ -88,7 +88,7 @@ SFX_IMPL_INTERFACE(ScCellShell, ScFormatShell , ScResId(SCSTR_CELLSHELL) ) ScCellShell::ScCellShell(ScViewData* pData) : ScFormatShell(pData), pImpl( new CellShell_Impl() ), - bPastePossible(FALSE) + bPastePossible(sal_False) { SetHelpId(HID_SCSHELL_CELLSH); SetName(String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("Cell"))); @@ -98,7 +98,7 @@ ScCellShell::~ScCellShell() { if ( pImpl->m_pClipEvtLstnr ) { - pImpl->m_pClipEvtLstnr->AddRemoveListener( GetViewData()->GetActiveWin(), FALSE ); + pImpl->m_pClipEvtLstnr->AddRemoveListener( GetViewData()->GetActiveWin(), sal_False ); // #103849# The listener may just now be waiting for the SolarMutex and call the link // afterwards, in spite of RemoveListener. So the link has to be reset, too. @@ -119,9 +119,9 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet ) ScTabViewShell* pTabViewShell = GetViewData()->GetViewShell(); ScRange aMarkRange; ScMarkType eMarkType = GetViewData()->GetSimpleArea( aMarkRange ); - BOOL bSimpleArea = (eMarkType == SC_MARK_SIMPLE); - BOOL bOnlyNotBecauseOfMatrix; - BOOL bEditable = pTabViewShell->SelectionEditable( &bOnlyNotBecauseOfMatrix ); + sal_Bool bSimpleArea = (eMarkType == SC_MARK_SIMPLE); + sal_Bool bOnlyNotBecauseOfMatrix; + sal_Bool bEditable = pTabViewShell->SelectionEditable( &bOnlyNotBecauseOfMatrix ); ScDocument* pDoc = GetViewData()->GetDocument(); ScDocShell* pDocShell = GetViewData()->GetDocShell(); ScMarkData& rMark = GetViewData()->GetMarkData(); @@ -133,11 +133,11 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet ) nRow2 = aMarkRange.aEnd.Row(); SfxWhichIter aIter(rSet); - USHORT nWhich = aIter.FirstWhich(); + sal_uInt16 nWhich = aIter.FirstWhich(); while ( nWhich ) { - BOOL bDisable = FALSE; - BOOL bNeedEdit = TRUE; // muss Selektion editierbar sein? + sal_Bool bDisable = sal_False; + sal_Bool bNeedEdit = sal_True; // muss Selektion editierbar sein? switch ( nWhich ) { case FID_FILL_TO_BOTTOM: // Fuellen oben/unten @@ -171,7 +171,7 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet ) case FID_FILL_SERIES: // Block fuellen case SID_OPENDLG_TABOP: // Mehrfachoperationen, mind. 2 Zellen markiert? if (pDoc->GetChangeTrack()!=NULL &&nWhich ==SID_OPENDLG_TABOP) - bDisable = TRUE; + bDisable = sal_True; else bDisable = (!bSimpleArea) || (nCol1 == nCol2 && nRow1 == nRow2); @@ -209,7 +209,7 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet ) //! muss man leben.. wird in Copy-Routine abgefangen, sonst //! muesste hier nochmal Aufwand getrieben werden if ( !(!bEditable && bOnlyNotBecauseOfMatrix) ) - bNeedEdit = FALSE; // erlaubt, wenn geschuetzt/ReadOnly + bNeedEdit = sal_False; // erlaubt, wenn geschuetzt/ReadOnly break; case SID_AUTOFORMAT: // Autoformat, mind. 3x3 selektiert @@ -221,11 +221,11 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet ) { if ( !bEditable && bOnlyNotBecauseOfMatrix ) { - bNeedEdit = FALSE; + bNeedEdit = sal_False; } if ( pDocShell && pDocShell->IsDocShared() ) { - bDisable = TRUE; + bDisable = sal_True; } } break; @@ -236,14 +236,14 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet ) case SID_ENABLE_HYPHENATION : // nur wegen Matrix nicht editierbar? Attribute trotzdem ok if ( !bEditable && bOnlyNotBecauseOfMatrix ) - bNeedEdit = FALSE; + bNeedEdit = sal_False; break; case FID_VALIDATION: { if ( pDocShell && pDocShell->IsDocShared() ) { - bDisable = TRUE; + bDisable = sal_True; } } break; @@ -256,14 +256,14 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet ) break; } if (!bDisable && bNeedEdit && !bEditable) - bDisable = TRUE; + bDisable = sal_True; if (bDisable) rSet.DisableItem(nWhich); else if (nWhich == SID_ENABLE_HYPHENATION) { // toggle slots need a bool item - rSet.Put( SfxBoolItem( nWhich, FALSE ) ); + rSet.Put( SfxBoolItem( nWhich, sal_False ) ); } nWhich = aIter.NextWhich(); } @@ -281,11 +281,11 @@ void ScCellShell::GetCellState( SfxItemSet& rSet ) GetViewData()->GetTabNo() ); SfxWhichIter aIter(rSet); - USHORT nWhich = aIter.FirstWhich(); + sal_uInt16 nWhich = aIter.FirstWhich(); while ( nWhich ) { - BOOL bDisable = FALSE; - BOOL bNeedEdit = TRUE; // muss Cursorposition editierbar sein? + sal_Bool bDisable = sal_False; + sal_Bool bNeedEdit = sal_True; // muss Cursorposition editierbar sein? switch ( nWhich ) { case SID_THESAURUS: @@ -295,7 +295,7 @@ void ScCellShell::GetCellState( SfxItemSet& rSet ) if (!bDisable) { // test for available languages - USHORT nLang = ScViewUtil::GetEffLanguage( pDoc, aCursor ); + sal_uInt16 nLang = ScViewUtil::GetEffLanguage( pDoc, aCursor ); bDisable = !ScModule::HasThesaurusLanguage( nLang ); } } @@ -311,9 +311,9 @@ void ScCellShell::GetCellState( SfxItemSet& rSet ) if (!pDoc->IsBlockEditable( aCursor.Tab(), aRange.aStart.Col(),aRange.aStart.Row(), aRange.aEnd.Col(),aRange.aEnd.Row() )) { - bDisable = TRUE; + bDisable = sal_True; } - bNeedEdit=FALSE; + bNeedEdit=sal_False; } } @@ -322,7 +322,7 @@ void ScCellShell::GetCellState( SfxItemSet& rSet ) { if ( pDocShell && pDocShell->IsDocShared() ) { - bDisable = TRUE; + bDisable = sal_True; } } break; @@ -330,7 +330,7 @@ void ScCellShell::GetCellState( SfxItemSet& rSet ) if (!bDisable && bNeedEdit) if (!pDoc->IsBlockEditable( aCursor.Tab(), aCursor.Col(),aCursor.Row(), aCursor.Col(),aCursor.Row() )) - bDisable = TRUE; + bDisable = sal_True; if (bDisable) rSet.DisableItem(nWhich); nWhich = aIter.NextWhich(); @@ -374,7 +374,7 @@ sal_Bool lcl_TestFormat( SvxClipboardFmtItem& rFormats, const TransferableDataHe void ScCellShell::GetPossibleClipboardFormats( SvxClipboardFmtItem& rFormats ) { Window* pWin = GetViewData()->GetActiveWin(); - BOOL bDraw = ( ScDrawTransferObj::GetOwnClipboard( pWin ) != NULL ); + sal_Bool bDraw = ( ScDrawTransferObj::GetOwnClipboard( pWin ) != NULL ); TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pWin ) ); @@ -402,11 +402,11 @@ void ScCellShell::GetPossibleClipboardFormats( SvxClipboardFmtItem& rFormats ) // Einfuegen, Inhalte einfuegen -BOOL lcl_IsCellPastePossible( const TransferableDataHelper& rData ) +sal_Bool lcl_IsCellPastePossible( const TransferableDataHelper& rData ) { - BOOL bPossible = FALSE; + sal_Bool bPossible = sal_False; if ( ScTransferObj::GetOwnClipboard( NULL ) || ScDrawTransferObj::GetOwnClipboard( NULL ) ) - bPossible = TRUE; + bPossible = sal_True; else { if ( rData.HasFormat( SOT_FORMAT_BITMAP ) || @@ -426,7 +426,7 @@ BOOL lcl_IsCellPastePossible( const TransferableDataHelper& rData ) rData.HasFormat( SOT_FORMATSTR_ID_HTML_SIMPLE ) || rData.HasFormat( SOT_FORMATSTR_ID_DIF ) ) { - bPossible = TRUE; + bPossible = sal_True; } } return bPossible; @@ -459,14 +459,14 @@ void __EXPORT ScCellShell::GetClipState( SfxItemSet& rSet ) pImpl->m_pClipEvtLstnr = new TransferableClipboardListener( LINK( this, ScCellShell, ClipboardChanged ) ); pImpl->m_pClipEvtLstnr->acquire(); Window* pWin = GetViewData()->GetActiveWin(); - pImpl->m_pClipEvtLstnr->AddRemoveListener( pWin, TRUE ); + pImpl->m_pClipEvtLstnr->AddRemoveListener( pWin, sal_True ); // get initial state TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pWin ) ); bPastePossible = lcl_IsCellPastePossible( aDataHelper ); } - BOOL bDisable = !bPastePossible; + sal_Bool bDisable = !bPastePossible; // Zellschutz / Multiselektion @@ -477,11 +477,11 @@ void __EXPORT ScCellShell::GetClipState( SfxItemSet& rSet ) SCTAB nTab = GetViewData()->GetTabNo(); ScDocument* pDoc = GetViewData()->GetDocShell()->GetDocument(); if (!pDoc->IsBlockEditable( nTab, nCol,nRow, nCol,nRow )) - bDisable = TRUE; + bDisable = sal_True; ScRange aDummy; ScMarkType eMarkType = GetViewData()->GetSimpleArea( aDummy); if (eMarkType != SC_MARK_SIMPLE && eMarkType != SC_MARK_SIMPLE_FILTERED) - bDisable = TRUE; + bDisable = sal_True; } if (bDisable) @@ -519,8 +519,8 @@ void ScCellShell::GetState(SfxItemSet &rSet) // removed: SID_BORDER_OBJECT (old Basic) ScTabViewShell* pTabViewShell = GetViewData()->GetViewShell(); -// BOOL bOle = pTabViewShell->GetViewFrame()->GetFrame().IsInPlace(); -// BOOL bTabProt = GetViewData()->GetDocument()->IsTabProtected(GetViewData()->GetTabNo()); +// sal_Bool bOle = pTabViewShell->GetViewFrame()->GetFrame().IsInPlace(); +// sal_Bool bTabProt = GetViewData()->GetDocument()->IsTabProtected(GetViewData()->GetTabNo()); ScDocShell* pDocSh = GetViewData()->GetDocShell(); ScViewData* pData = GetViewData(); ScDocument* pDoc = pData->GetDocument(); @@ -535,7 +535,7 @@ void ScCellShell::GetState(SfxItemSet &rSet) SfxWhichIter aIter(rSet); - USHORT nWhich = aIter.FirstWhich(); + sal_uInt16 nWhich = aIter.FirstWhich(); while ( nWhich ) { switch ( nWhich ) @@ -551,7 +551,7 @@ void ScCellShell::GetState(SfxItemSet &rSet) if ( pData->GetSimpleArea( aRange ) == SC_MARK_SIMPLE ) { String aStr; - USHORT nFlags = SCA_VALID | SCA_TAB_3D; + sal_uInt16 nFlags = SCA_VALID | SCA_TAB_3D; aRange.Format(aStr,nFlags,pDoc); rSet.Put( SfxStringItem( nWhich, aStr ) ); } @@ -615,7 +615,7 @@ void ScCellShell::GetState(SfxItemSet &rSet) * 1: ER Click erweitert Selektion * 2: ERG Click definiert weitere Selektion */ - USHORT nMode = pTabViewShell->GetLockedModifiers(); + sal_uInt16 nMode = pTabViewShell->GetLockedModifiers(); switch ( nMode ) { @@ -657,7 +657,7 @@ void ScCellShell::GetState(SfxItemSet &rSet) String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("...")) ) ); else { - USHORT nErrCode = 0; + sal_uInt16 nErrCode = 0; ScBaseCell* pCell; pDoc->GetCell( nPosX, nPosY, nTab, pCell ); if ( pCell && pCell->GetCellType() == CELLTYPE_FORMULA ) @@ -750,7 +750,7 @@ void ScCellShell::GetState(SfxItemSet &rSet) if ( !pDoc->IsScenario(nTab) ) { String aStr; - USHORT nFlags; + sal_uInt16 nFlags; SCTAB nScTab = nTab + 1; String aProtect; bool bSheetProtected = pDoc->IsTabProtected(nTab); @@ -761,7 +761,7 @@ void ScCellShell::GetState(SfxItemSet &rSet) aList.Insert( new String( aStr ), LIST_APPEND ); pDoc->GetScenarioData( nScTab, aStr, aDummyCol, nFlags ); aList.Insert( new String( aStr ), LIST_APPEND ); - // Protection is TRUE if both Sheet and Scenario are protected + // Protection is sal_True if both Sheet and Scenario are protected aProtect = (bSheetProtected && (nFlags & SC_SCENARIO_PROTECT)) ? '1' : '0'; aList.Insert( new String( aProtect), LIST_APPEND ); ++nScTab; @@ -770,7 +770,7 @@ void ScCellShell::GetState(SfxItemSet &rSet) else { String aComment; - USHORT nDummyFlags; + sal_uInt16 nDummyFlags; pDoc->GetScenarioData( nTab, aComment, aDummyCol, nDummyFlags ); DBG_ASSERT( aList.Count() == 0, "List not empty!" ); aList.Insert( new String( aComment ) ); @@ -778,8 +778,8 @@ void ScCellShell::GetState(SfxItemSet &rSet) rSet.Put( SfxStringListItem( nWhich, &aList ) ); - ULONG nCount = aList.Count(); - for ( ULONG i=0; i<nCount; i++ ) + sal_uLong nCount = aList.Count(); + for ( sal_uLong i=0; i<nCount; i++ ) delete (String*) aList.GetObject(i); } break; @@ -801,7 +801,7 @@ void ScCellShell::GetState(SfxItemSet &rSet) if ( pDoc->IsTabProtected(nTab) ) { const SfxItemSet& rAttrSet = GetSelectionPattern()->GetItemSet(); - const ScProtectionAttr& rProtAttr = (const ScProtectionAttr&)rAttrSet.Get( ATTR_PROTECTION, TRUE ); + const ScProtectionAttr& rProtAttr = (const ScProtectionAttr&)rAttrSet.Get( ATTR_PROTECTION, sal_True ); if ( rProtAttr.GetProtection() ) rSet.DisableItem( nWhich ); } @@ -827,7 +827,7 @@ void ScCellShell::GetState(SfxItemSet &rSet) { //! test for data pilot operation } - else if (!pTabViewShell->OutlinePossible(FALSE)) + else if (!pTabViewShell->OutlinePossible(sal_False)) rSet.DisableItem( nWhich ); break; @@ -837,7 +837,7 @@ void ScCellShell::GetState(SfxItemSet &rSet) { //! test for data pilot operation } - else if (!pTabViewShell->OutlinePossible(TRUE)) + else if (!pTabViewShell->OutlinePossible(sal_True)) rSet.DisableItem( nWhich ); break; @@ -850,7 +850,7 @@ void ScCellShell::GetState(SfxItemSet &rSet) } else { - BOOL bCol, bRow; + sal_Bool bCol, bRow; pTabViewShell->TestRemoveOutline( bCol, bRow ); if ( !bCol && !bRow ) rSet.DisableItem( nWhich ); @@ -906,21 +906,21 @@ void ScCellShell::GetState(SfxItemSet &rSet) case SID_DELETE_NOTE: { - BOOL bEnable = FALSE; + sal_Bool bEnable = sal_False; if ( rMark.IsMarked() || rMark.IsMultiMarked() ) { if ( pDoc->IsSelectionEditable( rMark ) ) { // look for at least one note in selection ScRangeList aRanges; - rMark.FillRangeListWithMarks( &aRanges, FALSE ); - ULONG nCount = aRanges.Count(); - for (ULONG nPos=0; nPos<nCount && !bEnable; nPos++) + rMark.FillRangeListWithMarks( &aRanges, sal_False ); + sal_uLong nCount = aRanges.Count(); + for (sal_uLong nPos=0; nPos<nCount && !bEnable; nPos++) { ScCellIterator aCellIter( pDoc, *aRanges.GetObject(nPos) ); for( ScBaseCell* pCell = aCellIter.GetFirst(); pCell && !bEnable; pCell = aCellIter.GetNext() ) if ( pCell->HasNote() ) - bEnable = TRUE; // note found + bEnable = sal_True; // note found } } } |