diff options
-rw-r--r-- | scaddins/source/analysis/analysishelper.cxx | 4 | ||||
-rw-r--r-- | scaddins/source/analysis/financial.cxx | 20 |
2 files changed, 24 insertions, 0 deletions
diff --git a/scaddins/source/analysis/analysishelper.cxx b/scaddins/source/analysis/analysishelper.cxx index 05b6bbfbd237..001223108dee 100644 --- a/scaddins/source/analysis/analysishelper.cxx +++ b/scaddins/source/analysis/analysishelper.cxx @@ -1068,6 +1068,8 @@ double GetOddfprice( sal_Int32 /*nNullDate*/, sal_Int32 /*nSettle*/, sal_Int32 / sal_Int32 /*nFirstCoup*/, double /*fRate*/, double /*fYield*/, double /*fRedemp*/, sal_Int32 /*nFreq*/, sal_Int32 /*nBase*/ ) throw( uno::RuntimeException, lang::IllegalArgumentException ) { + // If you ever change this to not unconditionally throw, adapt + // getOddfprice() (note lower-case 'g') in financial.cxx. throw uno::RuntimeException(); // #87380# } @@ -1151,6 +1153,8 @@ double GetOddfyield( sal_Int32 /*nNullDate*/, sal_Int32 /*nSettle*/, sal_Int32 / sal_Int32 /*nFirstCoup*/, double /*fRate*/, double /*fPrice*/, double /*fRedemp*/, sal_Int32 /*nFreq*/, sal_Int32 /*nBase*/ ) throw( uno::RuntimeException, lang::IllegalArgumentException ) { + // Ditto here, if you change this to not throw unconditionally, + // adapt getOddfyield() in financial.cxx. throw uno::RuntimeException(); // #87380# } diff --git a/scaddins/source/analysis/financial.cxx b/scaddins/source/analysis/financial.cxx index dd637c69f15f..a34591acf313 100644 --- a/scaddins/source/analysis/financial.cxx +++ b/scaddins/source/analysis/financial.cxx @@ -403,8 +403,20 @@ double SAL_CALL AnalysisAddIn::getOddfprice( const css::uno::Reference< css::bea if( fRate < 0.0 || fYield < 0.0 || CHK_Freq || nMat <= nFirstCoup || nFirstCoup <= nSettle || nSettle <= nIssue ) throw css::lang::IllegalArgumentException(); +#if !(defined(_MSC_VER) && defined(ENABLE_LTO)) double fRet = GetOddfprice( GetNullDate( xOpt ), nSettle, nMat, nIssue, nFirstCoup, fRate, fYield, fRedemp, nFreq, getDateMode( xOpt, rOB ) ); RETURN_FINITE( fRet ); +#else + // During link-time optimization the compiler inlines the above + // call to GetOddfprice() (note upper-case 'G') (from + // analysishelper.cxx), and notices that GetOddfprice() always + // throws, so the assignment and return are unreachable. Avoid + // that warning by throwing directly here. + (void) rOB; + (void) fRedemp; + (void) xOpt; + throw css::uno::RuntimeException(); +#endif } @@ -415,9 +427,17 @@ double SAL_CALL AnalysisAddIn::getOddfyield( const css::uno::Reference< css::bea if( fRate < 0.0 || fPrice <= 0.0 || CHK_Freq || nMat <= nFirstCoup || nFirstCoup <= nSettle || nSettle <= nIssue ) throw css::lang::IllegalArgumentException(); +#if !(defined(_MSC_VER) && defined(ENABLE_LTO)) double fRet = GetOddfyield( GetNullDate( xOpt ), nSettle, nMat, nIssue, nFirstCoup, fRate, fPrice, fRedemp, nFreq, getDateMode( xOpt, rOB ) ); RETURN_FINITE( fRet ); +#else + // Same story here, see comment in getOddfprice() + (void) rOB; + (void) fRedemp; + (void) xOpt; + throw css::uno::RuntimeException(); +#endif } |