[Libreoffice-commits] .: 2 commits - sc/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Tue Nov 15 18:10:03 PST 2011
sc/source/ui/docshell/docsh.cxx | 15 +++-------
sc/source/ui/docshell/docsh2.cxx | 4 +-
sc/source/ui/docshell/docsh4.cxx | 33 ++++++++++------------
sc/source/ui/docshell/docsh6.cxx | 2 -
sc/source/ui/docshell/docsh8.cxx | 16 +++++-----
sc/source/ui/inc/docsh.hxx | 57 +++++++++++++++++----------------------
6 files changed, 58 insertions(+), 69 deletions(-)
New commits:
commit 7ba7cbae11b8850b56edd638894554883c5d3b08
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date: Tue Nov 15 21:09:53 2011 -0500
Cleaned up ScDocShell a bit.
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 8f4d96d..fd4efe4 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 b3ccd39..da261db 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 4b79ecd..8bd4782 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 511abb5..37e9481 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 9058f7b..733e069 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 da3d58a..f106229 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...
commit daf480d62303155b9c490760f3a21ed8e94acdc0
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date: Tue Nov 15 20:47:32 2011 -0500
sal_Bool to bool.
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index ae426a1..4b79ecd 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -1219,9 +1219,9 @@ sal_Bool ScDocShell::ExecuteChangeProtectionDialog( Window* _pParent, sal_Bool b
//------------------------------------------------------------------
-void ScDocShell::DoRecalc( sal_Bool bApi )
+void ScDocShell::DoRecalc( bool bApi )
{
- sal_Bool bDone = false;
+ bool bDone = false;
ScTabViewShell* pSh = GetBestViewShell();
if ( pSh )
{
@@ -1229,7 +1229,7 @@ void ScDocShell::DoRecalc( sal_Bool bApi )
if ( pHdl && pHdl->IsInputMode() && pHdl->IsFormulaMode() && !bApi )
{
pHdl->FormulaPreview(); // Teilergebnis als QuickHelp
- bDone = sal_True;
+ bDone = true;
}
else
{
@@ -1242,7 +1242,7 @@ void ScDocShell::DoRecalc( sal_Bool bApi )
WaitObject aWaitObj( GetActiveDialogParent() );
aDocument.CalcFormulaTree();
if ( pSh )
- pSh->UpdateCharts(sal_True);
+ pSh->UpdateCharts(true);
aDocument.BroadcastUno( SfxSimpleHint( SFX_HINT_DATACHANGED ) );
@@ -1258,7 +1258,7 @@ void ScDocShell::DoRecalc( sal_Bool bApi )
}
}
-void ScDocShell::DoHardRecalc( sal_Bool /* bApi */ )
+void ScDocShell::DoHardRecalc( bool /* bApi */ )
{
WaitObject aWaitObj( GetActiveDialogParent() );
ScTabViewShell* pSh = GetBestViewShell();
@@ -1270,7 +1270,7 @@ void ScDocShell::DoHardRecalc( sal_Bool /* bApi */ )
aDocument.CalcAll();
GetDocFunc().DetectiveRefresh(); // erzeugt eigenes Undo
if ( pSh )
- pSh->UpdateCharts(sal_True);
+ pSh->UpdateCharts(true);
// set notification flags for "calculate" event (used in SFX_HINT_DATACHANGED broadcast)
// (might check for the presence of any formulas on each sheet)
diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx
index c468ddf..da3d58a 100644
--- a/sc/source/ui/inc/docsh.hxx
+++ b/sc/source/ui/inc/docsh.hxx
@@ -311,8 +311,8 @@ public:
sal_Bool MoveTable( SCTAB nSrcTab, SCTAB nDestTab, sal_Bool bCopy, sal_Bool bRecord );
- void DoRecalc( sal_Bool bApi );
- void DoHardRecalc( sal_Bool bApi );
+ void DoRecalc( bool bApi );
+ void DoHardRecalc( bool bApi );
void UpdateOle( const ScViewData* pViewData, sal_Bool bSnapSize = false);
sal_Bool IsOle();
More information about the Libreoffice-commits
mailing list