From 47ee01c28701e22e55a9ef7d66e0836c5a0a5899 Mon Sep 17 00:00:00 2001 From: Szymon Kłos Date: Fri, 27 Oct 2023 11:53:57 +0200 Subject: Make simple conditional formatting dialog translated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- sc/source/ui/condformat/condformateasydlg.cxx | 54 ++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 6 deletions(-) (limited to 'sc/source/ui/condformat') 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 #include #include +#include #include +#include 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"); -- cgit v1.2.3