diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-11-15 21:09:53 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-11-15 21:09:53 -0500 |
commit | 7ba7cbae11b8850b56edd638894554883c5d3b08 (patch) | |
tree | 799a409fe49a2282bf8434963711bd02fcff280d /sc | |
parent | daf480d62303155b9c490760f3a21ed8e94acdc0 (diff) |
Cleaned up ScDocShell a bit.
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/docshell/docsh.cxx | 15 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh2.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh4.cxx | 21 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh6.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh8.cxx | 16 | ||||
-rw-r--r-- | sc/source/ui/inc/docsh.hxx | 53 |
6 files changed, 50 insertions, 61 deletions
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 8f4d96d13dc8..fd4efe4768ae 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -1036,8 +1036,6 @@ sal_Bool ScDocShell::ConvertFrom( SfxMedium& rMedium ) vector<ScDocRowHeightUpdater::TabRanges> aRecalcRowRangesArray; - aConvFilterName.Erase(); //@ #BugId 54198 - // Alle Filter brauchen die komplette Datei am Stueck (nicht asynchron), // darum vorher per CreateFileStream dafuer sorgen, dass die komplette // Datei uebertragen wird. @@ -1051,8 +1049,6 @@ sal_Bool ScDocShell::ConvertFrom( SfxMedium& rMedium ) { String aFltName = pFilter->GetFilterName(); - aConvFilterName=aFltName; //@ #BugId 54198 - sal_Bool bCalc3 = ( aFltName.EqualsAscii(pFilterSc30) ); sal_Bool bCalc4 = ( aFltName.EqualsAscii(pFilterSc40) ); if (!bCalc3 && !bCalc4) @@ -2500,15 +2496,14 @@ sal_Bool ScDocShell::HasAutomaticTableName( const String& rFilter ) aDdeTextFmt(String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("TEXT"))), \ nPrtToScreenFactor( 1.0 ), \ pImpl ( new DocShell_Impl ), \ - bHeaderOn ( sal_True ), \ - bFooterOn ( sal_True ), \ - bNoInformLost ( sal_True ), \ - bIsEmpty ( sal_True ), \ + bHeaderOn ( true ), \ + bFooterOn ( true ), \ + bIsEmpty ( true ), \ bIsInUndo ( false ), \ bDocumentModifiedPending( false ), \ + bUpdateEnabled ( true ), \ nDocumentLock ( 0 ), \ nCanUpdate (com::sun::star::document::UpdateDocMode::ACCORDING_TO_CONFIG), \ - bUpdateEnabled ( sal_True ), \ pOldAutoDBRange ( NULL ), \ pDocHelper ( NULL ), \ pAutoStyleList ( NULL ), \ @@ -2726,7 +2721,7 @@ void ScDocShell::SetDrawModified( sal_Bool bIsModified /* = sal_True */ ) } } -void ScDocShell::SetInUndo(sal_Bool bSet) +void ScDocShell::SetInUndo(bool bSet) { bIsInUndo = bSet; } diff --git a/sc/source/ui/docshell/docsh2.cxx b/sc/source/ui/docshell/docsh2.cxx index b3ccd3933e83..da261db827f1 100644 --- a/sc/source/ui/docshell/docsh2.cxx +++ b/sc/source/ui/docshell/docsh2.cxx @@ -104,13 +104,13 @@ sal_Bool ScDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) //------------------------------------------------------------------ -sal_Bool ScDocShell::IsEmpty() const +bool ScDocShell::IsEmpty() const { return bIsEmpty; } -void ScDocShell::SetEmpty(sal_Bool bSet) +void ScDocShell::SetEmpty(bool bSet) { bIsEmpty = bSet; } diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 4b79ecdda909..8bd4782ad69e 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -1153,15 +1153,15 @@ void UpdateAcceptChangesDialog() //------------------------------------------------------------------ -sal_Bool ScDocShell::ExecuteChangeProtectionDialog( Window* _pParent, sal_Bool bJustQueryIfProtected ) +bool ScDocShell::ExecuteChangeProtectionDialog( Window* _pParent, sal_Bool bJustQueryIfProtected ) { - sal_Bool bDone = false; + bool bDone = false; ScChangeTrack* pChangeTrack = aDocument.GetChangeTrack(); if ( pChangeTrack ) { sal_Bool bProtected = pChangeTrack->IsProtected(); if ( bJustQueryIfProtected && !bProtected ) - return sal_True; + return true; String aTitle( ScResId( bProtected ? SCSTR_CHG_UNPROTECT : SCSTR_CHG_PROTECT ) ); String aText( ScResId( SCSTR_PASSWORD ) ); @@ -1186,7 +1186,7 @@ sal_Bool ScDocShell::ExecuteChangeProtectionDialog( Window* _pParent, sal_Bool b if ( SvPasswordHelper::CompareHashPassword(pChangeTrack->GetProtection(), aPassword) ) { if ( bJustQueryIfProtected ) - bDone = sal_True; + bDone = true; else pChangeTrack->SetProtection( com::sun::star::uno::Sequence< sal_Int8 > (0) ); @@ -1207,12 +1207,12 @@ sal_Bool ScDocShell::ExecuteChangeProtectionDialog( Window* _pParent, sal_Bool b if ( bProtected != pChangeTrack->IsProtected() ) { UpdateAcceptChangesDialog(); - bDone = sal_True; + bDone = true; } } } else if ( bJustQueryIfProtected ) - bDone = sal_True; + bDone = true; return bDone; } @@ -1425,9 +1425,9 @@ void ScDocShell::SetPrintZoom( SCTAB nTab, sal_uInt16 nScale, sal_uInt16 nPages } } -sal_Bool ScDocShell::AdjustPrintZoom( const ScRange& rRange ) +bool ScDocShell::AdjustPrintZoom( const ScRange& rRange ) { - sal_Bool bChange = false; + bool bChange = false; SCTAB nTab = rRange.aStart.Tab(); String aStyleName = aDocument.GetPageStyle( nTab ); @@ -1786,7 +1786,6 @@ void ScDocShell::GetStatePageStyle( SfxViewShell& /* rCaller */, if ( pStyleSheet ) { SfxItemSet& rStyleSet = pStyleSheet->GetItemSet(); - GetPageOnFromPageStyleSet( &rStyleSet, nCurTab, bHeaderOn, bFooterOn ); if ( !bHeaderOn && !bFooterOn ) @@ -1976,8 +1975,8 @@ Rectangle ScDocShell::GetVisArea( sal_uInt16 nAspect ) const void ScDocShell::GetPageOnFromPageStyleSet( const SfxItemSet* pStyleSet, SCTAB nCurTab, - sal_Bool& rbHeader, - sal_Bool& rbFooter ) + bool& rbHeader, + bool& rbFooter ) { if ( !pStyleSet ) { diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx index 511abb514363..37e94815cf5c 100644 --- a/sc/source/ui/docshell/docsh6.cxx +++ b/sc/source/ui/docshell/docsh6.cxx @@ -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, sal_Bool bReplace, sal_Bool bCellStyles, sal_Bool bPageStyles ) +void ScDocShell::LoadStylesArgs( ScDocShell& rSource, bool bReplace, bool bCellStyles, bool bPageStyles ) { // similar to LoadStyles, but with selectable behavior for XStyleLoader::loadStylesFromURL call diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx index 9058f7be4cb5..733e06918437 100644 --- a/sc/source/ui/docshell/docsh8.cxx +++ b/sc/source/ui/docshell/docsh8.cxx @@ -171,14 +171,14 @@ namespace // ----------------------------------------------------------------------- // MoveFile/KillFile/IsDocument: similar to SfxContentHelper -sal_Bool ScDocShell::MoveFile( const INetURLObject& rSourceObj, const INetURLObject& rDestObj ) +bool ScDocShell::MoveFile( const INetURLObject& rSourceObj, const INetURLObject& rDestObj ) { - sal_Bool bMoveData = sal_True; - sal_Bool bRet = sal_True, bKillSource = false; + bool bMoveData = true; + bool bRet = true, bKillSource = false; if ( rSourceObj.GetProtocol() != rDestObj.GetProtocol() ) { bMoveData = false; - bKillSource = sal_True; + bKillSource = true; } String aName = rDestObj.getName(); INetURLObject aDestPathObj = rDestObj; @@ -215,9 +215,9 @@ sal_Bool ScDocShell::MoveFile( const INetURLObject& rSourceObj, const INetURLObj } -sal_Bool ScDocShell::KillFile( const INetURLObject& rURL ) +bool ScDocShell::KillFile( const INetURLObject& rURL ) { - sal_Bool bRet = sal_True; + bool bRet = true; try { ::ucbhelper::Content aCnt( rURL.GetMainURL(INetURLObject::NO_DECODE), @@ -234,9 +234,9 @@ sal_Bool ScDocShell::KillFile( const INetURLObject& rURL ) return bRet; } -sal_Bool ScDocShell::IsDocument( const INetURLObject& rURL ) +bool ScDocShell::IsDocument( const INetURLObject& rURL ) { - sal_Bool bRet = false; + bool bRet = false; try { ::ucbhelper::Content aCnt( rURL.GetMainURL(INetURLObject::NO_DECODE), diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx index da3d58ad657b..f10622983e85 100644 --- a/sc/source/ui/inc/docsh.hxx +++ b/sc/source/ui/inc/docsh.hxx @@ -97,25 +97,20 @@ class SC_DLLPUBLIC ScDocShell: public SfxObjectShell, public SfxListener ScDocument aDocument; String aDdeTextFmt; - String aConvFilterName; //@ #BugId 54198 double nPrtToScreenFactor; -//! FontList* pFontList; DocShell_Impl* pImpl; ScDocFunc* pDocFunc; - //SfxObjectCreateMode eShellMode; - - sal_Bool bIsInplace; // wird von der View gesetzt - sal_Bool bHeaderOn; - sal_Bool bFooterOn; - sal_Bool bNoInformLost; - sal_Bool bIsEmpty; - sal_Bool bIsInUndo; - sal_Bool bDocumentModifiedPending; - sal_uInt16 nDocumentLock; + bool bHeaderOn; + bool bFooterOn; + bool bIsInplace:1; // wird von der View gesetzt + bool bIsEmpty:1; + bool bIsInUndo:1; + bool bDocumentModifiedPending:1; + bool bUpdateEnabled:1; + sal_uInt16 nDocumentLock; sal_Int16 nCanUpdate; // stores the UpdateDocMode from loading a document till update links - sal_Bool bUpdateEnabled; ScDBData* pOldAutoDBRange; @@ -158,9 +153,9 @@ class SC_DLLPUBLIC ScDocShell: public SfxObjectShell, public SfxListener SC_DLLPRIVATE sal_uLong DBaseExport( const String& rFullFileName, CharSet eCharSet, sal_Bool& bHasMemo ); - SC_DLLPRIVATE static sal_Bool MoveFile( const INetURLObject& rSource, const INetURLObject& rDest ); - SC_DLLPRIVATE static sal_Bool KillFile( const INetURLObject& rURL ); - SC_DLLPRIVATE static sal_Bool IsDocument( const INetURLObject& rURL ); + SC_DLLPRIVATE static bool MoveFile( const INetURLObject& rSource, const INetURLObject& rDest ); + SC_DLLPRIVATE static bool KillFile( const INetURLObject& rURL ); + SC_DLLPRIVATE static bool IsDocument( const INetURLObject& rURL ); SC_DLLPRIVATE void LockPaint_Impl(sal_Bool bDoc); SC_DLLPRIVATE void UnlockPaint_Impl(sal_Bool bDoc); @@ -277,12 +272,12 @@ public: /// If bJustQueryIfProtected==sal_True protection is not /// changed and <TRUE/> is returned if not protected or /// password was entered correctly. - sal_Bool ExecuteChangeProtectionDialog( Window* _pParent, sal_Bool bJustQueryIfProtected = false ); + bool ExecuteChangeProtectionDialog( Window* _pParent, sal_Bool bJustQueryIfProtected = false ); void SetPrintZoom( SCTAB nTab, sal_uInt16 nScale, sal_uInt16 nPages ); - sal_Bool AdjustPrintZoom( const ScRange& rRange ); + bool AdjustPrintZoom( const ScRange& rRange ); - void LoadStylesArgs( ScDocShell& rSource, sal_Bool bReplace, sal_Bool bCellStyles, sal_Bool bPageStyles ); + void LoadStylesArgs( ScDocShell& rSource, bool bReplace, bool bCellStyles, bool bPageStyles ); void PageStyleModified( const rtl::OUString& rStyleName, sal_Bool bApi ); @@ -365,18 +360,18 @@ public: virtual SfxStyleSheetBasePool* GetStyleSheetPool(); void SetInplace( sal_Bool bInplace ); - sal_Bool IsEmpty() const; - void SetEmpty(sal_Bool bSet); + bool IsEmpty() const; + void SetEmpty(bool bSet); - sal_Bool IsInUndo() const { return bIsInUndo; } - void SetInUndo(sal_Bool bSet); + bool IsInUndo() const { return bIsInUndo; } + void SetInUndo(bool bSet); void CalcOutputFactor(); double GetOutputFactor() const; void GetPageOnFromPageStyleSet( const SfxItemSet* pStyleSet, SCTAB nCurTab, - sal_Bool& rbHeader, - sal_Bool& rbFooter ); + bool& rbHeader, + bool& rbFooter ); virtual long DdeGetData( const String& rItem, const String& rMimeType, ::com::sun::star::uno::Any & rValue ); @@ -391,14 +386,14 @@ public: ScTabViewShell* GetBestViewShell( sal_Bool bOnlyVisible = sal_True ); ScSbxDocHelper* GetDocHelperObject() { return pDocHelper; } - void SetDocumentModifiedPending( sal_Bool bVal ) + void SetDocumentModifiedPending( bool bVal ) { bDocumentModifiedPending = bVal; } - sal_Bool IsDocumentModifiedPending() const + bool IsDocumentModifiedPending() const { return bDocumentModifiedPending; } - sal_Bool IsUpdateEnabled() const + bool IsUpdateEnabled() const { return bUpdateEnabled; } - void SetUpdateEnabled(sal_Bool bValue) + void SetUpdateEnabled(bool bValue) { bUpdateEnabled = bValue; } OutputDevice* GetRefDevice(); // WYSIWYG: Printer, otherwise VirtualDevice... |