diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2023-10-27 11:53:57 +0200 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2023-10-27 22:21:03 +0200 |
commit | 47ee01c28701e22e55a9ef7d66e0836c5a0a5899 (patch) | |
tree | 7946bef94e9357038ee6ba04c822c27807169880 /sc/source/ui/condformat | |
parent | 9775af227eded1ccdfa5750689533b429558cf3a (diff) |
Make simple conditional formatting dialog translated
Followup for commit a9f6f63d21e368fe6bcc9080fd1ba23bcccc0e52
sc: Add easy to use conditional formatting menu
- make strings translated
- add more conditions
- TODO: add other missing conditions
Change-Id: I0d25b3352067e7006b88f42f3401d4670b3a5061
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158536
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sc/source/ui/condformat')
-rw-r--r-- | sc/source/ui/condformat/condformateasydlg.cxx | 54 |
1 files changed, 48 insertions, 6 deletions
diff --git a/sc/source/ui/condformat/condformateasydlg.cxx b/sc/source/ui/condformat/condformateasydlg.cxx index 8ddb297269dc..c371861ac355 100644 --- a/sc/source/ui/condformat/condformateasydlg.cxx +++ b/sc/source/ui/condformat/condformateasydlg.cxx @@ -3,7 +3,9 @@ #include <stlpool.hxx> #include <viewdata.hxx> #include <reffact.hxx> +#include <scresid.hxx> #include <svl/style.hxx> +#include <strings.hrc> namespace { @@ -49,6 +51,11 @@ ScTabViewShell* GetTabViewShell(const SfxBindings* pBindings) namespace sc { +void ConditionalFormatEasyDialog::SetDescription(std::u16string_view rCondition) +{ + mxDescription->set_label(mxDescription->get_label() + ": " + rCondition); +} + ConditionalFormatEasyDialog::ConditionalFormatEasyDialog(SfxBindings* pBindings, SfxChildWindow* pChildWindow, weld::Window* pParent, @@ -89,19 +96,54 @@ ConditionalFormatEasyDialog::ConditionalFormatEasyDialog(SfxBindings* pBindings, mxNumberEntry2->set_increments(1, 0); switch (meMode) { - case ScConditionMode::Greater: - mxDescription->set_label(mxDescription->get_label() + " greater than "); + case ScConditionMode::Equal: + SetDescription(ScResId(STR_CONDITION_EQUAL)); break; case ScConditionMode::Less: - mxDescription->set_label(mxDescription->get_label() + " less than "); + SetDescription(ScResId(STR_CONDITION_LESS)); break; - case ScConditionMode::Equal: - mxDescription->set_label(mxDescription->get_label() + " equal to "); + case ScConditionMode::Greater: + SetDescription(ScResId(STR_CONDITION_GREATER)); + break; + case ScConditionMode::EqLess: + SetDescription(ScResId(STR_CONDITION_EQLESS)); + break; + case ScConditionMode::EqGreater: + SetDescription(ScResId(STR_CONDITION_EQGREATER)); + break; + case ScConditionMode::NotEqual: + SetDescription(ScResId(STR_CONDITION_NOT_EQUAL)); break; case ScConditionMode::Between: - mxDescription->set_label(mxDescription->get_label() + " between "); + SetDescription(ScResId(STR_CONDITION_BETWEEN)); mxNumberEntry2->show(); break; + // NotBetween + // Duplicate + // NotDuplicate + // Direct + // Top10 + // Bottom10 + // TopPercent + // BottomPercent + // AboveAverage + // BelowAverage + // AboveEqualAverage + // BelowEqualAverage + case ScConditionMode::Error: + SetDescription(ScResId(STR_CONDITION_ERROR)); + break; + case ScConditionMode::NoError: + SetDescription(ScResId(STR_CONDITION_NOERROR)); + break; + // BeginsWith + // EndsWith + case ScConditionMode::ContainsText: + SetDescription(ScResId(STR_CONDITION_CONTAINS_TEXT)); + break; + case ScConditionMode::NotContainsText: + SetDescription(ScResId(STR_CONDITION_NOT_CONTAINS_TEXT)); + break; default: SAL_WARN("sc", "ConditionalFormatEasyDialog::ConditionalFormatEasyDialog: invalid format"); |