[Libreoffice-commits] core.git: basic/source cui/source editeng/source include/tools sc/source sd/source sfx2/source sw/source tools/source

Noel Grandin noel.grandin at collabora.co.uk
Tue Feb 7 09:13:19 UTC 2017


 basic/source/basmgr/basmgr.cxx       |   20 ++++++++++----------
 basic/source/classes/sb.cxx          |    6 +++---
 cui/source/options/optdict.cxx       |    4 ++--
 cui/source/tabpages/backgrnd.cxx     |    4 ++--
 editeng/source/misc/splwrap.cxx      |    4 ++--
 include/tools/errinf.hxx             |    2 +-
 sc/source/filter/xml/xmlwrap.cxx     |    8 ++++----
 sc/source/ui/docshell/docsh.cxx      |    4 ++--
 sc/source/ui/docshell/docsh8.cxx     |    6 +++---
 sd/source/filter/xml/sdxmlwrp.cxx    |    8 ++++----
 sd/source/ui/func/fuinsert.cxx       |    3 +--
 sd/source/ui/view/viewshe2.cxx       |    2 +-
 sfx2/source/doc/objstor.cxx          |    4 ++--
 sw/source/filter/html/swhtml.cxx     |    4 ++--
 sw/source/filter/xml/swxml.cxx       |    8 ++++----
 sw/source/filter/xml/wrtxml.cxx      |    8 ++++----
 sw/source/uibase/misc/glosdoc.cxx    |    8 ++++----
 sw/source/uibase/uiview/viewling.cxx |    2 +-
 tools/source/ref/errinf.cxx          |    6 +++---
 19 files changed, 55 insertions(+), 56 deletions(-)

New commits:
commit b5e3f8a5fa98a249ecd50021c33cf2a5c7a3b4fc
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Mon Feb 6 16:02:12 2017 +0200

    remove ugly operator* in DynamicErrorInfo
    
    I can see why you'd want to hide this horrible tunnelling of
    information with objects registering themselves in a global list.
    Urrgh.
    
    Change-Id: Ib151a0d2d5a4508dc456e52883e488ce56d9a095
    Reviewed-on: https://gerrit.libreoffice.org/33984
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index 9b0c92a..286a9c4 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -634,10 +634,10 @@ BasicManager::BasicManager( StarBASIC* pSLib, OUString* pLibPath, bool bDocMgr )
 
 void BasicManager::ImpMgrNotLoaded( const OUString& rStorageName )
 {
-    // pErrInf is only destroyed if the error os processed by an
+    // pErrInf is only destroyed if the error is processed by an
     // ErrorHandler
     StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_MGROPEN, rStorageName, ERRCODE_BUTTON_OK );
-    aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::OPENMGRSTREAM));
+    aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::OPENMGRSTREAM));
 
     // Create a stdlib otherwise we crash!
     BasicLibInfo* pStdLibInfo = CreateLibInfo();
@@ -777,7 +777,7 @@ void BasicManager::LoadOldBasicManager( SotStorage& rStorage )
     if (!ImplLoadBasic( *xManagerStream, mpImpl->aLibs.front()->GetLibRef() ))
     {
         StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_MGROPEN, aStorName, ERRCODE_BUTTON_OK );
-        aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::OPENMGRSTREAM));
+        aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::OPENMGRSTREAM));
         // and it proceeds ...
     }
     xManagerStream->Seek( nBasicEndOff+1 ); // +1: 0x00 as separator
@@ -825,7 +825,7 @@ void BasicManager::LoadOldBasicManager( SotStorage& rStorage )
             else
             {
                 StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_LIBLOAD, aStorName, ERRCODE_BUTTON_OK );
-                aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::STORAGENOTFOUND));
+                aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::STORAGENOTFOUND));
             }
         }
     }
@@ -908,7 +908,7 @@ bool BasicManager::ImpLoadLibrary( BasicLibInfo* pLibInfo, SotStorage* pCurStora
     if ( !xBasicStorage.is() || xBasicStorage->GetError() )
     {
         StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_MGROPEN, xStorage->GetName(), ERRCODE_BUTTON_OK );
-        aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::OPENLIBSTORAGE));
+        aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::OPENLIBSTORAGE));
     }
     else
     {
@@ -917,7 +917,7 @@ bool BasicManager::ImpLoadLibrary( BasicLibInfo* pLibInfo, SotStorage* pCurStora
         if ( !xBasicStream.is() || xBasicStream->GetError() )
         {
             StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_LIBLOAD , pLibInfo->GetLibName(), ERRCODE_BUTTON_OK );
-            aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::OPENLIBSTREAM));
+            aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::OPENLIBSTREAM));
         }
         else
         {
@@ -940,7 +940,7 @@ bool BasicManager::ImpLoadLibrary( BasicLibInfo* pLibInfo, SotStorage* pCurStora
             if ( !bLoaded )
             {
                 StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_LIBLOAD, pLibInfo->GetLibName(), ERRCODE_BUTTON_OK );
-                aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::BASICLOADERROR));
+                aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::BASICLOADERROR));
             }
             else
             {
@@ -1124,7 +1124,7 @@ bool BasicManager::RemoveLib( sal_uInt16 nLib, bool bDelBasicFromStorage )
     if( !nLib || nLib  < mpImpl->aLibs.size() )
     {
         StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_REMOVELIB, OUString(), ERRCODE_BUTTON_OK );
-        aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::STDLIB));
+        aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::STDLIB));
         return false;
     }
 
@@ -1160,7 +1160,7 @@ bool BasicManager::RemoveLib( sal_uInt16 nLib, bool bDelBasicFromStorage )
             if ( !xBasicStorage.is() || xBasicStorage->GetError() )
             {
                 StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_REMOVELIB, OUString(), ERRCODE_BUTTON_OK );
-                aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::OPENLIBSTORAGE));
+                aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::OPENLIBSTORAGE));
             }
             else if (xBasicStorage->IsStream((*itLibInfo)->GetLibName()))
             {
@@ -1295,7 +1295,7 @@ bool BasicManager::LoadLib( sal_uInt16 nLib )
     else
     {
         StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_LIBLOAD, OUString(), ERRCODE_BUTTON_OK );
-        aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::LIBNOTFOUND));
+        aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::LIBNOTFOUND));
     }
     return bDone;
 }
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index 60d71c7..74cec84 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -1663,7 +1663,7 @@ bool StarBASIC::CError( SbError code, const OUString& rMsg,
     // Implementation of the code for the string transport to SFX-Error
     if( !rMsg.isEmpty() )
     {
-        code = (SbError)*new StringErrorInfo( code, rMsg );
+        code = (SbError)(new StringErrorInfo( code, rMsg ))->GetErrorCode();
     }
     SetErrorData( code, l, c1, c2 );
     GetSbData()->bCompilerError = true;
@@ -1702,11 +1702,11 @@ bool StarBASIC::RTError( SbError code, const OUString& rMsg, sal_Int32 l, sal_In
         {
             OUString aTmp = "\'" + OUString::number(SbxErrObject::getUnoErrObject()->getNumber()) +
                             "\'\n" + OUString(!GetSbData()->aErrMsg.isEmpty() ? GetSbData()->aErrMsg : rMsg);
-            code = (SbError)*new StringErrorInfo( code, aTmp );
+            code = (SbError)(new StringErrorInfo( code, aTmp ))->GetErrorCode();
         }
         else
         {
-            code = (SbError)*new StringErrorInfo( code, rMsg );
+            code = (SbError)(new StringErrorInfo( code, rMsg ))->GetErrorCode();
         }
     }
 
diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx
index a28bd94..2747233 100644
--- a/cui/source/options/optdict.cxx
+++ b/cui/source/options/optdict.cxx
@@ -180,8 +180,8 @@ IMPL_LINK_NOARG(SvxNewDictionaryDialog, OKHdl_Impl, Button*, void)
         // error: couldn't create new dictionary
         SfxErrorContext aContext( ERRCTX_SVX_LINGU_DICTIONARY, OUString(),
             this, RID_SVXERRCTX, &CUI_MGR() );
-        ErrorHandler::HandleError( *new StringErrorInfo(
-                ERRCODE_SVX_LINGU_DICT_NOTWRITEABLE, sDict ) );
+        ErrorHandler::HandleError( (new StringErrorInfo(
+                ERRCODE_SVX_LINGU_DICT_NOTWRITEABLE, sDict ))->GetErrorCode() );
 
         EndDialog();
     }
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index f781f0c..16981f5 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -973,8 +973,8 @@ void SvxBackgroundTabPage::RaiseLoadError_Impl()
                               &CUI_MGR() );
 
     ErrorHandler::HandleError(
-        *new StringErrorInfo( ERRCODE_SVX_GRAPHIC_NOTREADABLE,
-                              aBgdGraphicPath ) );
+        (new StringErrorInfo( ERRCODE_SVX_GRAPHIC_NOTREADABLE,
+                              aBgdGraphicPath ))->GetErrorCode() );
 }
 
 bool SvxBackgroundTabPage::LoadLinkedGraphic_Impl()
diff --git a/editeng/source/misc/splwrap.cxx b/editeng/source/misc/splwrap.cxx
index 0ae986e..fac731a 100644
--- a/editeng/source/misc/splwrap.cxx
+++ b/editeng/source/misc/splwrap.cxx
@@ -104,14 +104,14 @@ void SvxSpellWrapper::ShowLanguageErrors()
         {
             OUString aErr( SvtLanguageTable::GetLanguageString( nLang ) );
             ErrorHandler::HandleError(
-                *new StringErrorInfo( ERRCODE_SVX_LINGU_LANGUAGENOTEXISTS, aErr ) );
+                (new StringErrorInfo( ERRCODE_SVX_LINGU_LANGUAGENOTEXISTS, aErr ))->GetErrorCode() );
             nTmpSpell = SVX_LANG_MISSING;
         }
         if (SVX_LANG_MISSING_DO_WARN == nTmpHyph)
         {
             OUString aErr( SvtLanguageTable::GetLanguageString( nLang ) );
             ErrorHandler::HandleError(
-                *new StringErrorInfo( ERRCODE_SVX_LINGU_LANGUAGENOTEXISTS, aErr ) );
+                (new StringErrorInfo( ERRCODE_SVX_LINGU_LANGUAGENOTEXISTS, aErr ))->GetErrorCode() );
             nTmpHyph = SVX_LANG_MISSING;
         }
 
diff --git a/include/tools/errinf.hxx b/include/tools/errinf.hxx
index 9559eec..2b9f6b5 100644
--- a/include/tools/errinf.hxx
+++ b/include/tools/errinf.hxx
@@ -62,7 +62,7 @@ public:
                             DynamicErrorInfo(sal_uIntPtr lUserId, sal_uInt16 nMask);
     virtual                 ~DynamicErrorInfo() override;
 
-    operator                sal_uIntPtr() const;
+    sal_uIntPtr             GetErrorCode() const;
     sal_uInt16              GetDialogMask() const;
 };
 
diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx
index a79b75c..82c90df 100644
--- a/sc/source/filter/xml/xmlwrap.cxx
+++ b/sc/source/filter/xml/xmlwrap.cxx
@@ -216,17 +216,17 @@ sal_uInt32 ScXMLImportWrapper::ImportFromComponent(const uno::Reference<uno::XCo
 
             if( !sDocName.isEmpty() )
             {
-                nReturn = *new TwoStringErrorInfo(
+                nReturn = (new TwoStringErrorInfo(
                                 (bMustBeSuccessfull ? SCERR_IMPORT_FILE_ROWCOL
                                                         : SCWARN_IMPORT_FILE_ROWCOL),
                                 sDocName, sErr,
-                                ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR );
+                                ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ))->GetErrorCode();
             }
             else
             {
                 OSL_ENSURE( bMustBeSuccessfull, "Warnings are not supported" );
-                nReturn = *new StringErrorInfo( SCERR_IMPORT_FORMAT_ROWCOL, sErr,
-                                 ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR );
+                nReturn = (new StringErrorInfo( SCERR_IMPORT_FORMAT_ROWCOL, sErr,
+                                 ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ))->GetErrorCode();
             }
         }
     }
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 0a4ecc9..1a7fc52 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -2465,10 +2465,10 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )
             bRet = aImExport.ExportStream(*pStream, rMed.GetBaseURL(true), SotClipboardFormatId::HTML);
             if (bRet && !aImExport.GetNonConvertibleChars().isEmpty())
             {
-                SetError(*new StringErrorInfo(
+                SetError((new StringErrorInfo(
                     SCWARN_EXPORT_NONCONVERTIBLE_CHARS,
                     aImExport.GetNonConvertibleChars(),
-                    ERRCODE_BUTTON_OK | ERRCODE_MSG_INFO), OSL_LOG_PREFIX);
+                    ERRCODE_BUTTON_OK | ERRCODE_MSG_INFO))->GetErrorCode(), OSL_LOG_PREFIX);
             }
         }
     }
diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx
index 6bee8e6..72dde81 100644
--- a/sc/source/ui/docshell/docsh8.cxx
+++ b/sc/source/ui/docshell/docsh8.cxx
@@ -1088,12 +1088,12 @@ sal_uLong ScDocShell::DBaseExport( const OUString& rFullFileName, rtl_TextEncodi
             }
             OUString sPosition( ScAddress( nDocCol, nDocRow, nTab).GetColRowString());
             OUString sEncoding( SvxTextEncodingTable().GetTextString( eCharSet));
-            nErr = *new TwoStringErrorInfo( (bEncErr ? SCERR_EXPORT_ENCODING :
+            nErr = (new TwoStringErrorInfo( (bEncErr ? SCERR_EXPORT_ENCODING :
                         SCERR_EXPORT_FIELDWIDTH), sPosition, sEncoding,
-                    ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR);
+                    ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR))->GetErrorCode();
         }
         else if ( !aException.Message.isEmpty() )
-            nErr = *new StringErrorInfo( (SCERR_EXPORT_SQLEXCEPTION), aException.Message, ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR);
+            nErr = (new StringErrorInfo( SCERR_EXPORT_SQLEXCEPTION, aException.Message, ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR))->GetErrorCode();
         else
             nErr = SCERR_EXPORT_DATA;
     }
diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx
index f91acb5..d79ff01 100644
--- a/sd/source/filter/xml/sdxmlwrp.cxx
+++ b/sd/source/filter/xml/sdxmlwrp.cxx
@@ -245,17 +245,17 @@ sal_Int32 ReadThroughComponent(
 
         if (!rStreamName.isEmpty())
         {
-            return *new TwoStringErrorInfo(
+            return (new TwoStringErrorInfo(
                             (bMustBeSuccessfull ? ERR_FORMAT_FILE_ROWCOL
                                                     : WARN_FORMAT_FILE_ROWCOL),
                             rStreamName, sErr,
-                            ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR );
+                            ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ))->GetErrorCode();
         }
         else
         {
             DBG_ASSERT( bMustBeSuccessfull, "Warnings are not supported" );
-            return *new StringErrorInfo( ERR_FORMAT_ROWCOL, sErr,
-                             ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR );
+            return (new StringErrorInfo( ERR_FORMAT_ROWCOL, sErr,
+                             ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ))->GetErrorCode();
         }
     }
     catch (const xml::sax::SAXException& r)
diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx
index f91f066..e9155f7 100644
--- a/sd/source/ui/func/fuinsert.cxx
+++ b/sd/source/ui/func/fuinsert.cxx
@@ -452,8 +452,7 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq )
         }
         else
         {
-            ErrorHandler::HandleError(* new StringErrorInfo(ERRCODE_SFX_OLEGENERAL,
-                                        "" ) );
+            ErrorHandler::HandleError( (new StringErrorInfo(ERRCODE_SFX_OLEGENERAL, ""))->GetErrorCode() );
         }
     }
     else
diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx
index 82b529e..b0f3702 100644
--- a/sd/source/ui/view/viewshe2.cxx
+++ b/sd/source/ui/view/viewshe2.cxx
@@ -864,7 +864,7 @@ bool ViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb)
 
     if (aErrCode != 0 && !bAbort)
     {
-        ErrorHandler::HandleError(* new StringErrorInfo(aErrCode, OUString() ) );
+        ErrorHandler::HandleError( (new StringErrorInfo(aErrCode, ""))->GetErrorCode() );
     }
 
     return aErrCode == 0;
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 1dbaac7..b0c4687 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2296,8 +2296,8 @@ bool SfxObjectShell::ImportFrom(SfxMedium& rMedium,
             io::WrongFormatException e;
             if (rWrapped.TargetException >>= e)
             {
-                SetError(*new StringErrorInfo(ERRCODE_SFX_FORMAT_ROWCOL,
-                    e.Message, ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ), "");
+                SetError((new StringErrorInfo(ERRCODE_SFX_FORMAT_ROWCOL,
+                    e.Message, ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ))->GetErrorCode(), "");
             }
         }
         catch(...)
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 7ba89d0..830a9b0 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -226,8 +226,8 @@ sal_uLong HTMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPam,
             + "," + OUString::number((sal_Int32)xParser->GetLinePos()));
 
         // den Stream als Fehlernummer Transporter benutzen
-        nRet = *new StringErrorInfo( ERR_FORMAT_ROWCOL, sErr,
-                                    ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR );
+        nRet = (new StringErrorInfo( ERR_FORMAT_ROWCOL, sErr,
+                                    ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ))->GetErrorCode();
     }
 
     return nRet;
diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx
index 66327a2..374029e 100644
--- a/sw/source/filter/xml/swxml.cxx
+++ b/sw/source/filter/xml/swxml.cxx
@@ -206,17 +206,17 @@ sal_Int32 ReadThroughComponent(
 
         if( !rStreamName.isEmpty() )
         {
-            return *new TwoStringErrorInfo(
+            return (new TwoStringErrorInfo(
                             (bMustBeSuccessfull ? ERR_FORMAT_FILE_ROWCOL
                                                     : WARN_FORMAT_FILE_ROWCOL),
                             rStreamName, sErr,
-                            ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR );
+                            ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ))->GetErrorCode();
         }
         else
         {
             OSL_ENSURE( bMustBeSuccessfull, "Warnings are not supported" );
-            return *new StringErrorInfo( ERR_FORMAT_ROWCOL, sErr,
-                             ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR );
+            return (new StringErrorInfo( ERR_FORMAT_ROWCOL, sErr,
+                             ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ))->GetErrorCode();
         }
     }
     catch(const xml::sax::SAXException& r)
diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx
index 0447ac4..a2494ef 100644
--- a/sw/source/filter/xml/wrtxml.cxx
+++ b/sw/source/filter/xml/wrtxml.cxx
@@ -413,15 +413,15 @@ sal_uInt32 SwXMLWriter::Write_( const uno::Reference < task::XStatusIndicator >&
     if( bErr )
     {
         if( !sErrFile.isEmpty() )
-            return *new StringErrorInfo( ERR_WRITE_ERROR_FILE, sErrFile,
-                                         ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR );
+            return (new StringErrorInfo( ERR_WRITE_ERROR_FILE, sErrFile,
+                                         ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ))->GetErrorCode();
         return ERR_SWG_WRITE_ERROR;
     }
     else if( bWarn )
     {
         if( !sWarnFile.isEmpty() )
-            return *new StringErrorInfo( WARN_WRITE_ERROR_FILE, sWarnFile,
-                                         ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR );
+            return (new StringErrorInfo( WARN_WRITE_ERROR_FILE, sWarnFile,
+                                         ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ))->GetErrorCode();
         return WARN_SWG_FEATURES_LOST;
     }
 
diff --git a/sw/source/uibase/misc/glosdoc.cxx b/sw/source/uibase/misc/glosdoc.cxx
index 0959f92..513aba7 100644
--- a/sw/source/uibase/misc/glosdoc.cxx
+++ b/sw/source/uibase/misc/glosdoc.cxx
@@ -398,9 +398,9 @@ void SwGlossaries::UpdateGlosPath(bool bFull)
                 m_aInvalidPaths = aInvalidPaths;
                 // wrong path, that means AutoText directory doesn't exist
 
-                ErrorHandler::HandleError( *new StringErrorInfo(
+                ErrorHandler::HandleError( (new StringErrorInfo(
                                         ERR_AUTOPATH_ERROR, lcl_makePath(m_aInvalidPaths),
-                                        ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ));
+                                        ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ))->GetErrorCode());
                 m_bError = true;
             }
             else
@@ -419,8 +419,8 @@ void SwGlossaries::UpdateGlosPath(bool bFull)
 
 void SwGlossaries::ShowError()
 {
-    sal_uInt32 nPathError = *new StringErrorInfo(ERR_AUTOPATH_ERROR,
-                                            lcl_makePath(m_aInvalidPaths), ERRCODE_BUTTON_OK );
+    sal_uInt32 nPathError = (new StringErrorInfo(ERR_AUTOPATH_ERROR,
+                                            lcl_makePath(m_aInvalidPaths), ERRCODE_BUTTON_OK ))->GetErrorCode();
     ErrorHandler::HandleError( nPathError );
 }
 
diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx
index 0e74a3d..a1479f9 100644
--- a/sw/source/uibase/uiview/viewling.cxx
+++ b/sw/source/uibase/uiview/viewling.cxx
@@ -359,7 +359,7 @@ void SwView::SpellError(LanguageType eLang)
     if ( LANGUAGE_NONE == eLang )
         ErrorHandler::HandleError( ERRCODE_SVX_LINGU_NOLANGUAGE );
     else
-        ErrorHandler::HandleError( *new StringErrorInfo( ERRCODE_SVX_LINGU_LANGUAGENOTEXISTS, aErr ) );
+        ErrorHandler::HandleError( (new StringErrorInfo( ERRCODE_SVX_LINGU_LANGUAGENOTEXISTS, aErr ))->GetErrorCode() );
 
     while( nWaitCnt )
     {
diff --git a/tools/source/ref/errinf.cxx b/tools/source/ref/errinf.cxx
index 4c3eb52..539151c 100644
--- a/tools/source/ref/errinf.cxx
+++ b/tools/source/ref/errinf.cxx
@@ -86,7 +86,7 @@ void DynamicErrorInfo_Impl::RegisterEDcr(DynamicErrorInfo *pDcr)
 void DynamicErrorInfo_Impl::UnRegisterEDcr(DynamicErrorInfo const *pDcr)
 {
     DynamicErrorInfo **ppDcr = TheEDcrData::get().ppDcr;
-    sal_uIntPtr lIdx = (((sal_uIntPtr)(*pDcr) & ERRCODE_DYNAMIC_MASK) >> ERRCODE_DYNAMIC_SHIFT) - 1;
+    sal_uIntPtr lIdx = ((pDcr->GetErrorCode() & ERRCODE_DYNAMIC_MASK) >> ERRCODE_DYNAMIC_SHIFT) - 1;
     DBG_ASSERT(ppDcr[lIdx]==pDcr,"ErrHdl: Error nicht gefunden");
     if(ppDcr[lIdx]==pDcr)
         ppDcr[lIdx]=nullptr;
@@ -105,7 +105,7 @@ ErrorInfo *ErrorInfo::GetErrorInfo(sal_uIntPtr lId)
         return new ErrorInfo(lId);
 }
 
-DynamicErrorInfo::operator sal_uIntPtr() const
+sal_uIntPtr DynamicErrorInfo::GetErrorCode() const
 {
     return pImpl->lErrId;
 }
@@ -127,7 +127,7 @@ ErrorInfo* DynamicErrorInfo_Impl::GetDynamicErrorInfo(sal_uIntPtr lId)
 {
     sal_uIntPtr lIdx = ((lId & ERRCODE_DYNAMIC_MASK)>>ERRCODE_DYNAMIC_SHIFT)-1;
     DynamicErrorInfo* pDcr = TheEDcrData::get().ppDcr[lIdx];
-    if(pDcr && (sal_uIntPtr)(*pDcr)==lId)
+    if(pDcr && pDcr->GetErrorCode()==lId)
         return pDcr;
     else
         return new ErrorInfo(lId & ~ERRCODE_DYNAMIC_MASK);


More information about the Libreoffice-commits mailing list