[Libreoffice-commits] core.git: sd/inc sd/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Wed Apr 1 10:54:52 UTC 2020
sd/inc/drawdoc.hxx | 6 +++---
sd/source/core/drawdoc.cxx | 8 ++++----
sd/source/filter/xml/sdxmlwrp.cxx | 2 +-
sd/source/ui/docshell/docshel4.cxx | 4 ++--
sd/source/ui/view/sdview3.cxx | 2 +-
5 files changed, 11 insertions(+), 11 deletions(-)
New commits:
commit 8d43860bbdee020080503ed838d92e634ee9092e
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Apr 1 09:51:26 2020 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Apr 1 12:54:16 2020 +0200
convert DocCreationMode to scoped enum
Change-Id: I42fd704601fe81462f17b3968911fd79c13b50ef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91473
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sd/inc/drawdoc.hxx b/sd/inc/drawdoc.hxx
index ab7c46c8614b..28ea7a6107f0 100644
--- a/sd/inc/drawdoc.hxx
+++ b/sd/inc/drawdoc.hxx
@@ -99,10 +99,10 @@ struct StyleReplaceData
OUString aNewName;
};
-enum DocCreationMode
+enum class DocCreationMode
{
- NEW_DOC,
- DOC_LOADED
+ New,
+ Loaded
};
namespace sd
diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx
index c793ef34df74..02c7b5667d8a 100644
--- a/sd/source/core/drawdoc.cxx
+++ b/sd/source/core/drawdoc.cxx
@@ -618,7 +618,7 @@ SdDrawDocument* SdDrawDocument::AllocSdDrawDocument() const
lcl_copyUserDefinedProperties(GetDocSh(), pNewDocSh);
- pNewModel->NewOrLoadCompleted( DOC_LOADED ); // loaded from source document
+ pNewModel->NewOrLoadCompleted( DocCreationMode::Loaded ); // loaded from source document
}
else if( mbAllocDocSh )
{
@@ -683,7 +683,7 @@ void SdDrawDocument::NbcSetChanged(bool bFlag)
// it won't load any more.
void SdDrawDocument::NewOrLoadCompleted(DocCreationMode eMode)
{
- if (eMode == NEW_DOC)
+ if (eMode == DocCreationMode::New)
{
// New document:
// create slideshow and default templates,
@@ -693,7 +693,7 @@ void SdDrawDocument::NewOrLoadCompleted(DocCreationMode eMode)
static_cast< SdStyleSheetPool* >( mxStyleSheetPool.get() )->CreatePseudosIfNecessary();
}
- else if (eMode == DOC_LOADED)
+ else if (eMode == DocCreationMode::Loaded)
{
// Document has finished loading
@@ -770,7 +770,7 @@ void SdDrawDocument::NewOrLoadCompleted(DocCreationMode eMode)
mpInternalOutliner->SetStyleSheetPool(static_cast<SfxStyleSheetPool*>(GetStyleSheetPool()));
}
- if ( eMode == DOC_LOADED )
+ if ( eMode == DocCreationMode::Loaded )
{
// Make presentation objects listeners of the appropriate styles
SdStyleSheetPool* pSPool = static_cast<SdStyleSheetPool*>( GetStyleSheetPool() );
diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx
index 5dcbc27c4fe3..c866a5ab6680 100644
--- a/sd/source/filter/xml/sdxmlwrp.cxx
+++ b/sd/source/filter/xml/sdxmlwrp.cxx
@@ -472,7 +472,7 @@ bool SdXMLFilter::Import( ErrCode& nError )
SdDrawDocument* pDoc = mrDocShell.GetDoc();
bool const bWasUndo(pDoc->IsUndoEnabled());
pDoc->EnableUndo(false);
- pDoc->NewOrLoadCompleted( NEW_DOC );
+ pDoc->NewOrLoadCompleted( DocCreationMode::New );
pDoc->CreateFirstPages();
pDoc->StopWorkStartupDelay();
diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx
index 93c1fd4df139..9e90dd020282 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -247,7 +247,7 @@ bool DrawDocShell::InitNew( const css::uno::Reference< css::embed::XStorage >& x
if (bRet)
{
if( !mbSdDataObj )
- mpDoc->NewOrLoadCompleted(NEW_DOC); // otherwise calling
+ mpDoc->NewOrLoadCompleted(DocCreationMode::New); // otherwise calling
// NewOrLoadCompleted(NEW_LOADED) in
// SdDrawDocument::AllocModel()
}
@@ -350,7 +350,7 @@ bool DrawDocShell::LoadFrom( SfxMedium& rMedium )
if( mpViewShell )
pWait.reset(new weld::WaitObject(mpViewShell->GetFrameWeld()));
- mpDoc->NewOrLoadCompleted( NEW_DOC );
+ mpDoc->NewOrLoadCompleted( DocCreationMode::New );
mpDoc->CreateFirstPages();
mpDoc->StopWorkStartupDelay();
diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx
index c74845cc836d..ba876ab75c25 100644
--- a/sd/source/ui/view/sdview3.cxx
+++ b/sd/source/ui/view/sdview3.cxx
@@ -1524,7 +1524,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
bool View::PasteRTFTable( const ::tools::SvRef<SotStorageStream>& xStm, SdrPage* pPage, SdrInsertFlags nPasteOptions )
{
std::unique_ptr<SdDrawDocument> pModel(new SdDrawDocument( DocumentType::Impress, mpDocSh ));
- pModel->NewOrLoadCompleted(NEW_DOC);
+ pModel->NewOrLoadCompleted(DocCreationMode::New);
pModel->GetItemPool().SetDefaultMetric(MapUnit::Map100thMM);
pModel->InsertPage(pModel->AllocPage(false));
More information about the Libreoffice-commits
mailing list