[Libreoffice-commits] core.git: 2 commits - i18npool/util include/svtools solenv/bin svtools/inc svtools/Library_svt.mk svtools/source
Ahmed ElShreif (via logerrit)
logerrit at kemper.freedesktop.org
Wed Aug 12 16:48:58 UTC 2020
i18npool/util/i18npool.component | 8 ++---
include/svtools/valueset.hxx | 2 +
solenv/bin/native-code.py | 44 +++++++++++++++++++++++++++
svtools/Library_svt.mk | 1
svtools/inc/uiobject.hxx | 38 ++++++++++++++++++++++++
svtools/source/control/valueset.cxx | 7 ++++
svtools/source/uitest/uiobject.cxx | 57 ++++++++++++++++++++++++++++++++++++
7 files changed, 153 insertions(+), 4 deletions(-)
New commits:
commit edd916b47e01ea53f0989bdbb6a703e081e25aea
Author: Ahmed ElShreif <aelshreif7 at gmail.com>
AuthorDate: Sat Aug 8 01:04:28 2020 +0200
Commit: Ahmed ElShreif <aelshreif7 at gmail.com>
CommitDate: Wed Aug 12 18:48:32 2020 +0200
uitest : Add support for Normal ValueSet
This patch will add support for all the normal valuesets inside any dialog .
for example it will help in "Select Presets and Shadow Styles in borders tab ( format table or format cell )" to test tdf#133641 .
You can use the support by this line:
>> obj_name.executeAction("SELECT", mkPropertyValues({"POS": "4"}))
Change-Id: I35d0608318f1bca4f4e702ebcc258957835ce0db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100373
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
diff --git a/include/svtools/valueset.hxx b/include/svtools/valueset.hxx
index 410003e97d72..128ffcb8daf6 100644
--- a/include/svtools/valueset.hxx
+++ b/include/svtools/valueset.hxx
@@ -407,6 +407,8 @@ public:
int nItemId = IsNoSelection() ? -1 : GetSelectedItemId();
return mnSavedItemId != nItemId;
}
+
+ virtual FactoryFunction GetUITestFactory() const override;
};
diff --git a/svtools/Library_svt.mk b/svtools/Library_svt.mk
index 456a7ae568a0..b7ed7657d691 100644
--- a/svtools/Library_svt.mk
+++ b/svtools/Library_svt.mk
@@ -182,6 +182,7 @@ $(eval $(call gb_Library_add_exception_objects,svt,\
svtools/source/uno/wizard/unowizard \
svtools/source/uno/wizard/wizardpagecontroller \
svtools/source/uno/wizard/wizardshell \
+ svtools/source/uitest/uiobject \
))
ifeq ($(OS),WNT)
diff --git a/svtools/inc/uiobject.hxx b/svtools/inc/uiobject.hxx
new file mode 100644
index 000000000000..a27b6d68fdad
--- /dev/null
+++ b/svtools/inc/uiobject.hxx
@@ -0,0 +1,38 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_SVTOOLS_INC_UIOBJECT_HXX
+#define INCLUDED_SVTOOLS_INC_UIOBJECT_HXX
+
+#include <memory>
+#include <vcl/uitest/uiobject.hxx>
+#include <svtools/valueset.hxx>
+
+class ValueSet;
+
+class ValueSetUIObject final : public WindowUIObject
+{
+ ValueSet* mpSet;
+
+public:
+ ValueSetUIObject(const VclPtr<vcl::Window>& xSetWin, ValueSet* pSet);
+
+ virtual void execute(const OUString& rAction, const StringMap& rParameters) override;
+
+ static std::unique_ptr<UIObject> create(vcl::Window* pWindow);
+
+ virtual StringMap get_state() override;
+
+private:
+ OUString get_name() const override;
+};
+
+#endif // INCLUDED_SVX_INC_UIOBJECT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index 74a09e613d26..e56f3e7e2d43 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -43,6 +43,8 @@
#include <svtools/valueset.hxx>
#include <boost/property_tree/ptree.hpp>
+#include <uiobject.hxx>
+
using namespace css::uno;
using namespace css::lang;
using namespace css::accessibility;
@@ -1909,4 +1911,9 @@ void ValueSet::Hide()
mxScrolledWindow->hide();
}
+FactoryFunction ValueSet::GetUITestFactory() const
+{
+ return ValueSetUIObject::create;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/uitest/uiobject.cxx b/svtools/source/uitest/uiobject.cxx
new file mode 100644
index 000000000000..904a81be1bb6
--- /dev/null
+++ b/svtools/source/uitest/uiobject.cxx
@@ -0,0 +1,57 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <memory>
+#include <uiobject.hxx>
+#include <svtools/valueset.hxx>
+#include <vcl/layout.hxx>
+
+ValueSetUIObject::ValueSetUIObject(const VclPtr<vcl::Window>& xSetWin, ValueSet* pSet)
+ : WindowUIObject(xSetWin)
+ , mpSet(pSet)
+{
+}
+
+void ValueSetUIObject::execute(const OUString& rAction, const StringMap& rParameters)
+{
+ if (rAction == "SELECT")
+ {
+ if (rParameters.find("POS") != rParameters.end())
+ {
+ OUString aIndexStr = rParameters.find("POS")->second;
+
+ sal_Int32 nIndex = aIndexStr.toInt32();
+ mpSet->SelectItem(nIndex);
+ mpSet->Select();
+ }
+ }
+ else
+ WindowUIObject::execute(rAction, rParameters);
+}
+
+std::unique_ptr<UIObject> ValueSetUIObject::create(vcl::Window* pWindow)
+{
+ VclDrawingArea* pSetWin = dynamic_cast<VclDrawingArea*>(pWindow);
+ assert(pSetWin);
+ return std::unique_ptr<UIObject>(
+ new ValueSetUIObject(pSetWin, static_cast<ValueSet*>(pSetWin->GetUserData())));
+}
+
+OUString ValueSetUIObject::get_name() const { return "ValueSetUIObject"; }
+
+StringMap ValueSetUIObject::get_state()
+{
+ StringMap aMap = WindowUIObject::get_state();
+ aMap["SelectedItemId"] = OUString::number(mpSet->GetSelectedItemId());
+ aMap["SelectedItemPos"] = OUString::number(mpSet->GetSelectItemPos());
+ aMap["ItemsCount"] = OUString::number(mpSet->GetItemCount());
+ return aMap;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
commit ed8bce1909f658d8e3d950f374931242f91ba811
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Aug 12 16:02:41 2020 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Aug 12 18:48:18 2020 +0200
fix i18n constructors and android scripts
after
commit 155c056b1d4674d5ff73bbb5e1ad1dcd1e6aae36
i18npool: create instances with uno constructors
this fixes two things
(*) the names of some of the constructo functions were wrong
(*) the native-code.py script needed updating
Change-Id: I5f3cad78eb2f84cb78ba7fed9f98122858fc6b81
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100599
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/i18npool/util/i18npool.component b/i18npool/util/i18npool.component
index 13892bfcb5e3..e3e437c875ee 100644
--- a/i18npool/util/i18npool.component
+++ b/i18npool/util/i18npool.component
@@ -125,7 +125,7 @@
<service name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric first)"/>
</implementation>
<implementation name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric first) (grouped by consonant)"
- constructor="i18npool_IndexEntrySupplier_ja_phonetic_alphanumeric_first_by_syllable_get_implementation">
+ constructor="i18npool_IndexEntrySupplier_ja_phonetic_alphanumeric_first_by_consonant_get_implementation">
<service name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric first) (grouped by consonant)"/>
</implementation>
<implementation name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric first) (grouped by syllable)"
@@ -133,15 +133,15 @@
<service name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric first) (grouped by syllable)"/>
</implementation>
<implementation name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric last)"
- constructor="i18npool_IndexEntrySupplier_ja_phonetic_alphanumeric_first_by_syllable_get_implementation">
+ constructor="i18npool_IndexEntrySupplier_ja_phonetic_alphanumeric_last_by_syllable_get_implementation">
<service name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric last)"/>
</implementation>
<implementation name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric last) (grouped by consonant)"
- constructor="i18npool_IndexEntrySupplier_ja_phonetic_alphanumeric_first_by_syllable_get_implementation">
+ constructor="i18npool_IndexEntrySupplier_ja_phonetic_alphanumeric_last_by_consonant_get_implementation">
<service name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric last) (grouped by consonant)"/>
</implementation>
<implementation name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric last) (grouped by syllable)"
- constructor="i18npool_IndexEntrySupplier_ja_phonetic_alphanumeric_first_by_syllable_get_implementation">
+ constructor="i18npool_IndexEntrySupplier_ja_phonetic_alphanumeric_last_by_syllable_get_implementation">
<service name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric last) (grouped by syllable)"/>
</implementation>
<implementation name="com.sun.star.i18n.InputSequenceChecker"
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 28066c1f42d3..d283c4043110 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -227,6 +227,50 @@ core_constructor_list = [
"com_sun_star_i18n_Transliteration_IGNORE_KANA_get_implementation",
"com_sun_star_i18n_Transliteration_IGNORE_WIDTH_get_implementation",
"com_sun_star_text_DefaultNumberingProvider_get_implementation",
+ ("i18npool_BreakIterator_ja_get_implementation", "#if WITH_LOCALE_ALL || WITH_LOCALE_ja"),
+ ("i18npool_BreakIterator_ko_get_implementation", "#if WITH_LOCALE_ALL || WITH_LOCALE_ko"),
+ ("i18npool_BreakIterator_th_get_implementation", "#if WITH_LOCALE_ALL || WITH_LOCALE_th"),
+ ("i18npool_BreakIterator_zh_get_implementation", "#if WITH_LOCALE_ALL || WITH_LOCALE_zh"),
+ ("i18npool_BreakIterator_zh_TW_get_implementation", "#if WITH_LOCALE_ALL || WITH_LOCALE_zh"),
+ "i18npool_CalendarImpl_get_implementation",
+ "i18npool_Calendar_ROC_get_implementation",
+ "i18npool_Calendar_dangi_get_implementation",
+ "i18npool_Calendar_buddhist_get_implementation",
+ "i18npool_Calendar_gengou_get_implementation",
+ "i18npool_Calendar_gregorian_get_implementation",
+ "i18npool_Calendar_hanja_get_implementation",
+ "i18npool_Calendar_hanja_yoil_get_implementation",
+ "i18npool_Calendar_hijri_get_implementation",
+ "i18npool_Calendar_jewish_get_implementation",
+ "i18npool_ChapterCollator_get_implementation",
+ "i18npool_Collator_Unicode_get_implementation",
+ "i18npool_IndexEntrySupplier_get_implementation",
+ "i18npool_IndexEntrySupplier_Unicode_get_implementation",
+ "i18npool_IndexEntrySupplier_asian_get_implementation",
+ ("i18npool_IndexEntrySupplier_ja_phonetic_alphanumeric_first_by_syllable_get_implementation", "#if WITH_LOCALE_ALL || WITH_LOCALE_ja"),
+ ("i18npool_IndexEntrySupplier_ja_phonetic_alphanumeric_first_by_consonant_get_implementation", "#if WITH_LOCALE_ALL || WITH_LOCALE_ja"),
+ ("i18npool_IndexEntrySupplier_ja_phonetic_alphanumeric_last_by_syllable_get_implementation", "#if WITH_LOCALE_ALL || WITH_LOCALE_ja"),
+ ("i18npool_IndexEntrySupplier_ja_phonetic_alphanumeric_last_by_consonant_get_implementation", "#if WITH_LOCALE_ALL || WITH_LOCALE_ja"),
+ ("i18npool_InputSequenceChecker_hi_get_implementation", "#if WITH_LOCALE_ALL || WITH_LOCALE_hi"),
+ ("i18npool_InputSequenceChecker_th_get_implementation", "#if WITH_LOCALE_ALL || WITH_LOCALE_th"),
+ ("i18npool_TextConversion_ko_get_implementation", "#if WITH_LOCALE_ALL || WITH_LOCALE_ko"),
+ ("i18npool_TextConversion_zh_get_implementation", "#if WITH_LOCALE_ALL || WITH_LOCALE_zh"),
+ "i18npool_CharToNumEastIndic_ar_get_implementation",
+ ("i18npool_CharToNumFullwidth_get_implementation", "#if WITH_LOCALE_ALL || WITH_LOCALE_ja"),
+ ("i18npool_CharToNumHangul_ko_get_implementation", "#if WITH_LOCALE_ALL || WITH_LOCALE_ko"),
+ "i18npool_CharToNumIndic_ar_get_implementation",
+ ("i18npool_CharToNumIndic_hi_get_implementation", "#if WITH_LOCALE_ALL || WITH_LOCALE_hi"),
+ ("i18npool_CharToNumKanjiShort_ja_JP_get_implementation", "#if WITH_LOCALE_ALL || WITH_LOCALE_ja"),
+ ("i18npool_CharToNumKanjiTraditional_ja_JP_get_implementation", "#if WITH_LOCALE_ALL || WITH_LOCALE_ja"),
+ ("i18npool_CharToNumLower_ko_get_implementation", "#if WITH_LOCALE_ALL || WITH_LOCALE_ko"),
+ ("i18npool_CharToNumUpper_ko_get_implementation", "#if WITH_LOCALE_ALL || WITH_LOCALE_ko"),
+ ("i18npool_CharToNum_th_get_implementation", "#if WITH_LOCALE_ALL || WITH_LOCALE_th"),
+ ("i18npool_NumToTextFullwidth_zh_CN_get_implementation", "#if WITH_LOCALE_ALL || WITH_LOCALE_zh"),
+ ("i18npool_NumToTextFullwidth_zh_TW_get_implementation", "#if WITH_LOCALE_ALL || WITH_LOCALE_zh"),
+ ("i18npool_NumToTextLower_zh_CN_get_implementation", "#if WITH_LOCALE_ALL || WITH_LOCALE_zh"),
+ ("i18npool_NumToTextLower_zh_TW_get_implementation", "#if WITH_LOCALE_ALL || WITH_LOCALE_zh"),
+ ("i18npool_NumToTextUpper_zh_CN_get_implementation", "#if WITH_LOCALE_ALL || WITH_LOCALE_zh"),
+ ("i18npool_NumToTextUpper_zh_TW_get_implementation", "#if WITH_LOCALE_ALL || WITH_LOCALE_zh"),
# i18nsearch/sourceh/search/i18nsearch.component
"i18npool_TextSearch_get_implementation",
# linguistic/source/lng.component
More information about the Libreoffice-commits
mailing list