summaryrefslogtreecommitdiff
path: root/sd/source/ui
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-02-09 08:52:13 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-06-21 08:42:30 +0200
commit528632660b72b105345945c13c5b68060d94a91b (patch)
tree860508d482959abeb9175f0ce6b9e65954269f95 /sd/source/ui
parentaee66aa85e75f67135e5c6079a281e18402d261a (diff)
convert ErrCode to strong typedef
would have preferred to re-use o3tl::strong_int, of which this is a modified copy, but there are lots of convenience accessors which are nice to define on the class. Change-Id: I301b807aaf02fbced3bf75de1e1692cde6c0340a Reviewed-on: https://gerrit.libreoffice.org/38497 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source/ui')
-rw-r--r--sd/source/ui/app/sdmod.cxx4
-rw-r--r--sd/source/ui/app/sdmod1.cxx26
-rw-r--r--sd/source/ui/docshell/docshel4.cxx2
-rw-r--r--sd/source/ui/func/fuinsfil.cxx4
-rw-r--r--sd/source/ui/func/fupage.cxx2
-rw-r--r--sd/source/ui/inc/OutlineViewShell.hxx2
-rw-r--r--sd/source/ui/view/outlnvsh.cxx4
-rw-r--r--sd/source/ui/view/sdview4.cxx2
8 files changed, 21 insertions, 25 deletions
diff --git a/sd/source/ui/app/sdmod.cxx b/sd/source/ui/app/sdmod.cxx
index 689ba7569b158..f8d0ee660771f 100644
--- a/sd/source/ui/app/sdmod.cxx
+++ b/sd/source/ui/app/sdmod.cxx
@@ -85,8 +85,8 @@ SdModule::SdModule(SfxObjectFactory* pFact1, SfxObjectFactory* pFact2 )
StartListening( *SfxGetpApp() );
SvxErrorHandler::ensure();
mpErrorHdl = new SfxErrorHandler( RID_SD_ERRHDL,
- ERRCODE_AREA_SD,
- ERRCODE_AREA_SD_END,
+ ErrCode(ERRCODE_AREA_SD),
+ ErrCode(ERRCODE_AREA_SD_END),
GetResMgr() );
// Create a new ref device and (by calling SetReferenceDevice())
diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx
index 094becb271fc7..12945863ea8fe 100644
--- a/sd/source/ui/app/sdmod1.cxx
+++ b/sd/source/ui/app/sdmod1.cxx
@@ -433,7 +433,7 @@ SfxFrame* SdModule::CreateFromTemplate( const OUString& rTemplatePath, const Ref
SfxItemSet* pSet = new SfxAllItemSet( SfxGetpApp()->GetPool() );
pSet->Put( SfxBoolItem( SID_TEMPLATE, true ) );
- sal_uLong lErr = SfxGetpApp()->LoadTemplate( xDocShell, rTemplatePath, pSet );
+ ErrCode lErr = SfxGetpApp()->LoadTemplate( xDocShell, rTemplatePath, pSet );
SfxObjectShell* pDocShell = xDocShell;
@@ -566,19 +566,17 @@ OutlineToImpressFinalizer::OutlineToImpressFinalizer (
// Check the error code and stop copying the stream data when an
// error has occurred.
- switch (nErrorCode)
+ if (nErrorCode == ERRCODE_NONE)
{
- case ERRCODE_NONE:
- if (nReadByteCount == 0)
- bLoop = false;
- break;
- case ERRCODE_IO_PENDING:
- break;
-
- default:
+ if (nReadByteCount == 0)
bLoop = false;
- nReadByteCount = 0;
- break;
+ }
+ else if (nErrorCode == ERRCODE_IO_PENDING)
+ ;
+ else
+ {
+ bLoop = false;
+ nReadByteCount = 0;
}
// Append the read bytes to the end of the memory stream.
@@ -606,9 +604,7 @@ void OutlineToImpressFinalizer::operator() (bool)
sd::OutlineView* pView = static_cast<sd::OutlineView*>(pOutlineShell->GetView());
// mba: the stream can't contain any relative URLs, because we don't
// have any information about a BaseURL!
- if ( pOutlineShell->ReadRtf(*mpStream) == 0 )
- {
- }
+ pOutlineShell->ReadRtf(*mpStream);
// Call UpdatePreview once for every slide to resync the
// document with the outliner of the OutlineViewShell.
diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx
index cb562673ef43f..afaacaf55dec1 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -585,7 +585,7 @@ bool DrawDocShell::SaveAs( SfxMedium& rMedium )
if( GetCreateMode() == SfxObjectCreateMode::STANDARD )
SfxObjectShell::SetVisArea( ::tools::Rectangle() );
- sal_uInt32 nVBWarning = ERRCODE_NONE;
+ ErrCode nVBWarning = ERRCODE_NONE;
bool bRet = SfxObjectShell::SaveAs( rMedium );
if( bRet )
diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx
index d8c620e6f7f6d..711aa064351aa 100644
--- a/sd/source/ui/func/fuinsfil.cxx
+++ b/sd/source/ui/func/fuinsfil.cxx
@@ -456,7 +456,7 @@ void FuInsertFile::InsTextOrRTFinDrMode(SfxMedium* pMedium)
assert(pStream && "No InStream!");
pStream->Seek( 0 );
- sal_uLong nErr = pOutliner->Read( *pStream, pMedium->GetBaseURL(), nFormat, mpDocSh->GetHeaderAttributes() );
+ ErrCode nErr = pOutliner->Read( *pStream, pMedium->GetBaseURL(), nFormat, mpDocSh->GetHeaderAttributes() );
if (nErr || pOutliner->GetEditEngine().GetText().isEmpty())
{
@@ -600,7 +600,7 @@ void FuInsertFile::InsTextOrRTFinOlMode(SfxMedium* pMedium)
DBG_ASSERT( pStream, "No InStream!" );
pStream->Seek( 0 );
- sal_uLong nErr = pOutliner->Read(*pStream, pMedium->GetBaseURL(), nFormat, mpDocSh->GetHeaderAttributes());
+ ErrCode nErr = pOutliner->Read(*pStream, pMedium->GetBaseURL(), nFormat, mpDocSh->GetHeaderAttributes());
if (nErr || pOutliner->GetEditEngine().GetText().isEmpty())
{
diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx
index 024afcc41ac4e..fe040185b4e6d 100644
--- a/sd/source/ui/func/fupage.cxx
+++ b/sd/source/ui/func/fupage.cxx
@@ -312,7 +312,7 @@ const SfxItemSet* FuPage::ExecuteDialog( vcl::Window* pParent )
if( aDlg.Execute() == ERRCODE_NONE )
{
Graphic aGraphic;
- int nError = aDlg.GetGraphic(aGraphic);
+ ErrCode nError = aDlg.GetGraphic(aGraphic);
if( nError == ERRCODE_NONE )
{
pTempSet.reset( new SfxItemSet( mpDoc->GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{}) );
diff --git a/sd/source/ui/inc/OutlineViewShell.hxx b/sd/source/ui/inc/OutlineViewShell.hxx
index 10ff97c9a074c..179853283af63 100644
--- a/sd/source/ui/inc/OutlineViewShell.hxx
+++ b/sd/source/ui/inc/OutlineViewShell.hxx
@@ -111,7 +111,7 @@ public:
virtual bool KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin) override;
virtual void MouseButtonUp(const MouseEvent& rMEvt, ::sd::Window* pWin) override;
- sal_uLong ReadRtf(SvStream& rInput);
+ ErrCode ReadRtf(SvStream& rInput);
virtual void WriteUserDataSequence ( css::uno::Sequence < css::beans::PropertyValue >&, bool bBrowse ) override;
virtual void ReadUserDataSequence ( const css::uno::Sequence < css::beans::PropertyValue >&, bool bBrowse ) override;
diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx
index 328c2b1018574..14b9022abc1cc 100644
--- a/sd/source/ui/view/outlnvsh.cxx
+++ b/sd/source/ui/view/outlnvsh.cxx
@@ -1752,9 +1752,9 @@ void OutlineViewShell::UpdateOutlineObject( SdPage* pPage, Paragraph* pPara )
/**
* Fill Outliner from Stream
*/
-sal_uLong OutlineViewShell::ReadRtf(SvStream& rInput)
+ErrCode OutlineViewShell::ReadRtf(SvStream& rInput)
{
- sal_uLong bRet = 0;
+ ErrCode bRet = ERRCODE_NONE;
::Outliner& rOutl = pOlView->GetOutliner();
diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx
index 3d98ee66ea4fd..4f8b8be7fec2f 100644
--- a/sd/source/ui/view/sdview4.cxx
+++ b/sd/source/ui/view/sdview4.cxx
@@ -392,7 +392,7 @@ IMPL_LINK_NOARG(View, DropInsertFileHdl, Timer *, void)
return;
SfxErrorContext aEc( ERRCTX_ERROR, mpViewSh->GetActiveWindow(), RID_SO_ERRCTX );
- ErrCode nError = 0;
+ ErrCode nError = ERRCODE_NONE;
::std::vector< OUString >::const_iterator aIter( maDropFileVector.begin() );