summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-04-01 09:51:26 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-04-01 12:54:16 +0200
commit8d43860bbdee020080503ed838d92e634ee9092e (patch)
tree563ccc53290fe5779009844a221d3771212fd587 /sd
parent97c468daae242ef8d62edb0942cb52ef4a2a1ebb (diff)
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@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r--sd/inc/drawdoc.hxx6
-rw-r--r--sd/source/core/drawdoc.cxx8
-rw-r--r--sd/source/filter/xml/sdxmlwrp.cxx2
-rw-r--r--sd/source/ui/docshell/docshel4.cxx4
-rw-r--r--sd/source/ui/view/sdview3.cxx2
5 files changed, 11 insertions, 11 deletions
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));