[Libreoffice-commits] core.git: sd/inc sd/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Wed Apr 1 08:29:32 UTC 2020
sd/inc/sdxmlwrp.hxx | 8 ++++----
sd/source/filter/xml/sdxmlwrp.cxx | 6 +++---
sd/source/ui/docshell/docshel4.cxx | 12 ++++++------
3 files changed, 13 insertions(+), 13 deletions(-)
New commits:
commit 8fb5ee2a1399383dbfe3baec8c8716788c1fa0e8
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Apr 1 09:21:10 2020 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Apr 1 10:28:58 2020 +0200
convert SdXMLFilterMode to scoped enum
Change-Id: I5e5e533c076f3108fed776d00c7ec649e202d9df
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91463
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sd/inc/sdxmlwrp.hxx b/sd/inc/sdxmlwrp.hxx
index 84d3862b0c03..0c42447be28f 100644
--- a/sd/inc/sdxmlwrp.hxx
+++ b/sd/inc/sdxmlwrp.hxx
@@ -26,10 +26,10 @@
class ErrCode;
// SdXMLFilter
-enum SdXMLFilterMode
+enum class SdXMLFilterMode
{
- SDXMLMODE_Normal, ///< standard load and save of the complete document
- SDXMLMODE_Organizer ///< only for import, only the styles are loaded
+ Normal, ///< standard load and save of the complete document
+ Organizer ///< only for import, only the styles are loaded
};
class SdXMLFilter final : public SdFilter
@@ -38,7 +38,7 @@ public:
SdXMLFilter(
SfxMedium& rMedium,
::sd::DrawDocShell& rDocShell,
- SdXMLFilterMode eFilterMode = SDXMLMODE_Normal,
+ SdXMLFilterMode eFilterMode = SdXMLFilterMode::Normal,
sal_uLong nStoreVer = SOFFICE_FILEFORMAT_8 );
virtual ~SdXMLFilter() override;
diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx
index 34bdf10d30bf..5dcbc27c4fe3 100644
--- a/sd/source/filter/xml/sdxmlwrp.cxx
+++ b/sd/source/filter/xml/sdxmlwrp.cxx
@@ -598,7 +598,7 @@ bool SdXMLFilter::Import( ErrCode& nError )
xInfoSet->setPropertyValue( "StreamRelPath", Any( aName ) );
}
- if (SDXMLMODE_Organizer == meFilterMode)
+ if (SdXMLFilterMode::Organizer == meFilterMode)
xInfoSet->setPropertyValue("OrganizerMode", uno::makeAny(true));
if( ERRCODE_NONE == nRet )
@@ -630,7 +630,7 @@ bool SdXMLFilter::Import( ErrCode& nError )
pServices->mpMeta,
aEmptyArgs, aName, false );
- if( meFilterMode != SDXMLMODE_Organizer )
+ if( meFilterMode != SdXMLFilterMode::Organizer )
{
nWarn2 = ReadThroughComponent(
xStorage, xModelComp, "settings.xml", nullptr, rxContext,
@@ -643,7 +643,7 @@ bool SdXMLFilter::Import( ErrCode& nError )
pServices->mpStyles,
aFilterArgs, aName, true );
- if( !nRet && (meFilterMode != SDXMLMODE_Organizer) )
+ if( !nRet && (meFilterMode != SdXMLFilterMode::Organizer) )
nRet = ReadThroughComponent(
xStorage, xModelComp, "content.xml", "Content.xml", rxContext,
pServices->mpContent,
diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx
index b2a7bc8cc18c..93c1fd4df139 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -292,7 +292,7 @@ bool DrawDocShell::Load( SfxMedium& rMedium )
{
comphelper::EmbeddedObjectContainer& rEmbeddedObjectContainer = getEmbeddedObjectContainer();
rEmbeddedObjectContainer.setUserAllowsLinkUpdate(false);
- bRet = SdXMLFilter( rMedium, *this, SDXMLMODE_Normal, SotStorage::GetVersion( rMedium.GetStorage() ) ).Import( nError );
+ bRet = SdXMLFilter( rMedium, *this, SdXMLFilterMode::Normal, SotStorage::GetVersion( rMedium.GetStorage() ) ).Import( nError );
}
if( bRet )
@@ -356,7 +356,7 @@ bool DrawDocShell::LoadFrom( SfxMedium& rMedium )
// TODO/LATER: nobody is interested in the error code?!
ErrCode nError = ERRCODE_NONE;
- bool bRet = SdXMLFilter( rMedium, *this, SDXMLMODE_Organizer, SotStorage::GetVersion( rMedium.GetStorage() ) ).Import( nError );
+ bool bRet = SdXMLFilter( rMedium, *this, SdXMLFilterMode::Organizer, SotStorage::GetVersion( rMedium.GetStorage() ) ).Import( nError );
// tell SFX to change viewshell when in preview mode
if( IsPreview() )
@@ -470,7 +470,7 @@ bool DrawDocShell::ConvertFrom( SfxMedium& rMedium )
mpDoc->CreateFirstPages();
mpDoc->StopWorkStartupDelay();
ErrCode nError = ERRCODE_NONE;
- bRet = SdXMLFilter( rMedium, *this, SDXMLMODE_Normal, SOFFICE_FILEFORMAT_60 ).Import( nError );
+ bRet = SdXMLFilter( rMedium, *this, SdXMLFilterMode::Normal, SOFFICE_FILEFORMAT_60 ).Import( nError );
}
else if (aFilterName == "CGM - Computer Graphics Metafile")
{
@@ -528,7 +528,7 @@ bool DrawDocShell::Save()
bool bRet = SfxObjectShell::Save();
if( bRet )
- bRet = SdXMLFilter( *GetMedium(), *this, SDXMLMODE_Normal, SotStorage::GetVersion( GetMedium()->GetStorage() ) ).Export();
+ bRet = SdXMLFilter( *GetMedium(), *this, SdXMLFilterMode::Normal, SotStorage::GetVersion( GetMedium()->GetStorage() ) ).Export();
return bRet;
}
@@ -572,7 +572,7 @@ bool DrawDocShell::SaveAs( SfxMedium& rMedium )
bool bRet = SfxObjectShell::SaveAs( rMedium );
if( bRet )
- bRet = SdXMLFilter( rMedium, *this, SDXMLMODE_Normal, SotStorage::GetVersion( rMedium.GetStorage() ) ).Export();
+ bRet = SdXMLFilter( rMedium, *this, SdXMLFilterMode::Normal, SotStorage::GetVersion( rMedium.GetStorage() ) ).Export();
if( GetError() == ERRCODE_NONE )
SetError(ERRCODE_NONE);
@@ -614,7 +614,7 @@ bool DrawDocShell::ConvertTo( SfxMedium& rMedium )
else if( aTypeName.indexOf( "StarOffice_XML_Impress" ) >= 0 ||
aTypeName.indexOf( "StarOffice_XML_Draw" ) >= 0 )
{
- xFilter = std::make_unique<SdXMLFilter>(rMedium, *this, SDXMLMODE_Normal, SOFFICE_FILEFORMAT_60);
+ xFilter = std::make_unique<SdXMLFilter>(rMedium, *this, SdXMLFilterMode::Normal, SOFFICE_FILEFORMAT_60);
}
else
{
More information about the Libreoffice-commits
mailing list