sc/inc/sc.hrc | 5 +++-- sc/source/ui/src/units.src | 9 +++++++-- sc/source/ui/view/viewfunc.cxx | 18 +++++++++++++++++- 3 files changed, 27 insertions(+), 5 deletions(-)
New commits: commit a5106f8af396d45eda68a6977a52f9ae431f6757 Author: Andrzej Hunt <andr...@ahunt.org> Date: Mon Jun 1 18:37:26 2015 +0100 Show whether error is in formula or output in units warning Change-Id: Ib21462b3d67bb9b960c0d37384cdcef5003a884e diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index bac863f..42a0561 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -998,8 +998,9 @@ #define STR_TITLE_DATE (STR_START + 443) #define STR_UNKNOWN_USER_CONFLICT (STR_START + 444) -#define STR_UNITS_ERRORINCELL (STR_START + 450) -#define BT_UNITS_EDIT_CELL (STR_START + 451) +#define STR_UNITS_ERROR_INPUT (STR_START + 450) +#define STR_UNITS_ERROR_OUTPUT (STR_START + 451) +#define BT_UNITS_EDIT_CELL (STR_START + 452) #define STR_UNITS_CONVERSION_RECOMMENDED (STR_START + 455) #define BT_UNITS_CONVERT_THIS_CELL (STR_START + 456) diff --git a/sc/source/ui/src/units.src b/sc/source/ui/src/units.src index 7a818e9..d666923 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 b9a08c3..31b3870 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -2855,7 +2855,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 ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits