diff options
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/src/units.src | 9 | ||||
-rw-r--r-- | sc/source/ui/view/viewfunc.cxx | 18 |
2 files changed, 24 insertions, 3 deletions
diff --git a/sc/source/ui/src/units.src b/sc/source/ui/src/units.src index 7a818e954d82..d666923f0d51 100644 --- a/sc/source/ui/src/units.src +++ b/sc/source/ui/src/units.src @@ -19,9 +19,14 @@ #include "sc.hrc" -String STR_UNITS_ERRORINCELL +String STR_UNITS_ERROR_INPUT { - Text [ en-US ] = "Units error in formula in Cell $1" ; + Text [ en-US ] = "Units error in formula in Cell $1: incompatible units used in formula." ; +}; + +String STR_UNITS_ERROR_OUTPUT +{ + Text [ en-US ] = "Units error in formula in Cell $1: result units don't match specified units." ; }; PushButton BT_UNITS_EDIT_CELL diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index f25711a7c995..dbbff8eadfd9 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -2863,7 +2863,23 @@ void ScViewFunc::NotifyUnitErrorInFormula( const ScAddress& rAddress, ScDocument // after having carried out further edits on the document (whereby any tab changes/additions/removals // could change the number of the tab, with a name change being much more rare), hence having // all information (including tab name) could be useful. - OUString sTitle = SC_RESSTR( STR_UNITS_ERRORINCELL ); + OUString sTitle; + if (rStatus == FormulaStatus::ERROR_INPUT_SCALING || + rStatus == FormulaStatus::ERROR_INPUT_INCOMPATIBLE) + { + sTitle = SC_RESSTR( STR_UNITS_ERROR_INPUT ); + } + else if (rStatus == FormulaStatus::ERROR_OUTPUT_SCALING || + rStatus == FormulaStatus::ERROR_OUTPUT_INCOMPATIBLE) + { + sTitle = SC_RESSTR( STR_UNITS_ERROR_OUTPUT ); + } + else + { + // We should not be showing a warning bar for any other statuses. + assert(false); + } + sTitle = sTitle.replaceAll( "$1", rAddress.GetColRowString() ); OUString sCellAddress = rAddress.Format( SCA_BITS, pDoc ); SfxInfoBarWindow* pInfoBar = pViewFrame->AppendInfoBar( sCellAddress, sTitle ); |