tdf#49895: Add search functionality to Options dialog

- Search field added.
- Dialog names of all treeview nodes with their parent names
  were included in searching.
- Strings of labels, check buttons, radio buttons,
  toggle buttons, link buttons and buttons were
  included in searching.

Change-Id: Idf67c160519402ee390d94b1b3135b56324f3990
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152519
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
diff --git a/cui/Library_cui.mk b/cui/Library_cui.mk
index 43d1381..9c621a1 100644
--- a/cui/Library_cui.mk
+++ b/cui/Library_cui.mk
@@ -205,6 +205,7 @@ $(eval $(call gb_Library_add_exception_objects,cui,\
    cui/source/options/sdbcdriverenum \
    cui/source/options/securityoptions \
    cui/source/options/treeopt \
    cui/source/options/treeopthelper \
    cui/source/options/tsaurls \
    cui/source/options/webconninfo \
    cui/source/tabpages/align \
diff --git a/cui/source/inc/cuioptgenrl.hxx b/cui/source/inc/cuioptgenrl.hxx
index 42cdbbe..ac903a3 100644
--- a/cui/source/inc/cuioptgenrl.hxx
+++ b/cui/source/inc/cuioptgenrl.hxx
@@ -64,6 +64,8 @@ public:

    static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet );

    virtual OUString GetAllStrings() override;

    virtual bool        FillItemSet( SfxItemSet* rSet ) override;
    virtual void        Reset( const SfxItemSet* rSet ) override;
};
diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index 4e766c7..2fbfcd1 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -278,6 +278,8 @@ public:
                              const SfxItemSet*);
    static WhichRangesContainer GetRanges() { return pAreaRanges; }

    virtual OUString GetAllStrings() override;

    virtual bool FillItemSet( SfxItemSet* ) override;
    virtual void Reset( const SfxItemSet * ) override;
    virtual void ActivatePage( const SfxItemSet& rSet ) override;
diff --git a/cui/source/inc/dbregister.hxx b/cui/source/inc/dbregister.hxx
index ecbded9..3b26e51 100644
--- a/cui/source/inc/dbregister.hxx
+++ b/cui/source/inc/dbregister.hxx
@@ -73,6 +73,8 @@ namespace svx

        static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet );

        virtual OUString GetAllStrings() override;

        virtual bool        FillItemSet( SfxItemSet* rSet ) override;
        virtual void        Reset( const SfxItemSet* rSet ) override;
        virtual void        FillUserData() override;
diff --git a/cui/source/inc/optasian.hxx b/cui/source/inc/optasian.hxx
index 9d9815e..31a622f 100644
--- a/cui/source/inc/optasian.hxx
+++ b/cui/source/inc/optasian.hxx
@@ -53,6 +53,9 @@ public:
    static std::unique_ptr<SfxTabPage>
    Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet);
    static WhichRangesContainer GetRanges();

    virtual OUString GetAllStrings() override;

    virtual bool FillItemSet(SfxItemSet* rSet) override;
    virtual void Reset(const SfxItemSet* rSet) override;
};
diff --git a/cui/source/inc/optlingu.hxx b/cui/source/inc/optlingu.hxx
index d0933e4..dce8f2c 100644
--- a/cui/source/inc/optlingu.hxx
+++ b/cui/source/inc/optlingu.hxx
@@ -142,6 +142,8 @@ public:
    static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet );
    virtual ~SvxLinguTabPage() override;

    virtual OUString GetAllStrings() override;

    virtual bool        FillItemSet( SfxItemSet* rSet ) override;
    virtual void        Reset( const SfxItemSet* rSet ) override;

diff --git a/cui/source/inc/optpath.hxx b/cui/source/inc/optpath.hxx
index acc7696..ccfeb70 100644
--- a/cui/source/inc/optpath.hxx
+++ b/cui/source/inc/optpath.hxx
@@ -63,6 +63,8 @@ public:
    static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet );
    virtual ~SvxPathTabPage() override;

    virtual OUString GetAllStrings() override;

    virtual bool        FillItemSet( SfxItemSet* rSet ) override;
    virtual void        Reset( const SfxItemSet* rSet ) override;
};
diff --git a/cui/source/inc/treeopt.hxx b/cui/source/inc/treeopt.hxx
index 74ca73944..b3f54dc 100644
--- a/cui/source/inc/treeopt.hxx
+++ b/cui/source/inc/treeopt.hxx
@@ -26,6 +26,8 @@
#include <sfx2/basedlgs.hxx>
#include <svtools/restartdialog.hxx>
#include <utility>
#include <i18nutil/searchopt.hxx>
#include <vcl/timer.hxx>

class SfxModule;
class SfxShell;
@@ -114,6 +116,7 @@ struct Module;
class ExtensionsTabPage;
class SvxColorTabPage;
struct OptionsGroupInfo;
struct OptionsPageIdInfo;

class OfaTreeOptionsDialog final: public SfxOkDialogController
{
@@ -124,11 +127,38 @@ private:

    std::unique_ptr<weld::TreeView> xTreeLB;
    std::unique_ptr<weld::Container> xTabBox;
    std::unique_ptr<weld::Entry> m_xSearchEdit;

    weld::Window*    m_pParent;

    std::unique_ptr<weld::TreeIter> xCurrentPageEntry;

    // For search
    Timer m_aUpdateDataTimer;
    i18nutil::SearchOptions2 m_options;

    bool bIsFirtsInitialize;
    std::vector<OptionsPageIdInfo*> m_aTreePageIds;
    typedef std::vector<std::pair<sal_uInt16, std::vector<sal_uInt16>>> VectorOfMatchedIds;

    void generalOptions(const std::vector<sal_uInt16>& vPageId = {}); // SID_GENERAL_OPTIONS
    void loadAndSaveOptions(const std::vector<sal_uInt16>& vPageId = {}); // SID_FILTER_DLG
    void languageOptions(const std::vector<sal_uInt16>& vPageId = {}); // SID_LANGUAGE_OPTIONS
    void writerOptions(const std::vector<sal_uInt16>& vPageId = {}); // SID_SW_EDITOPTIONS
    void writerWebOptions(const std::vector<sal_uInt16>& vPageId = {}); // SID_SW_ONLINEOPTIONS
    void calcOptions(const std::vector<sal_uInt16>& vPageId = {}); // SID_SC_EDITOPTIONS
    void impressOptions(const std::vector<sal_uInt16>& vPageId = {}); // SID_SD_EDITOPTIONS
    void drawOptions(const std::vector<sal_uInt16>& vPageId = {}); // SID_SD_GRAPHIC_OPTIONS
    void mathOptions(const std::vector<sal_uInt16>& vPageId = {}); // SID_SM_EDITOPTIONS
    void databaseOptions(const std::vector<sal_uInt16>& vPageId = {}); // SID_SB_STARBASEOPTIONS
    void chartOptions(const std::vector<sal_uInt16>& vPageId = {}); // SID_SCH_EDITOPTIONS
    void internetOptions(const std::vector<sal_uInt16>& vPageId = {}); // SID_INET_DLG

    void clearOptionsDialog();
    void selectFirstEntry();
    void storeOptionsTree();
    void showDialog(VectorOfMatchedIds& pSearchIds);

    OUString               sTitle;

    bool                   bForgetSelection;
@@ -163,8 +193,13 @@ private:
    DECL_LINK(BackHdl_Impl, weld::Button&, void);
    DECL_LINK(ApplyHdl_Impl, weld::Button&, void);
    DECL_LINK(HelpHdl_Impl, weld::Widget&, bool);
    DECL_LINK(SearchUpdateHdl, weld::Entry&, void);
    DECL_LINK(ImplUpdateDataHdl, Timer*, void);
    DECL_LINK(FocusOut_Impl, weld::Widget&, void);
    void ResetCurrentPageFromConfig();
    void SelectHdl_Impl();
    void initializeCurrentDialog(OptionsPageInfo*& pPageInfo,
                                 std::unique_ptr<weld::TreeIter>& xEntry);

    void InitItemSets(OptionsGroupInfo& rGroupInfo);

@@ -173,6 +208,8 @@ private:
    virtual weld::Button& GetOKButton() const override { return *xOkPB; }
    virtual const SfxItemSet* GetExampleSet() const override { return nullptr; }

    int applySearchFilter(const OUString& rSearchTerm);

    // Common initialization
    OfaTreeOptionsDialog(weld::Window* pParent, bool fromExtensionManager);

@@ -192,6 +229,9 @@ public:
    void                ActivatePage( const OUString& rPageURL );
    void                ApplyItemSets();

    // default value initializes all dialogs
    void initializeFirstNDialog(sal_Int16 nNumberOfNode = -1);

    // helper functions to call the language settings TabPage from the SpellDialog
    static void         ApplyLanguageOptions(const SfxItemSet& rSet);
    static OUString     getCurrentFactory_Impl( const css::uno::Reference< css::frame::XFrame >& _xFrame );
@@ -239,4 +279,13 @@ public:
    void            SavePage();
};

// class TreeOptHelper ---------------------------------------------------

class TreeOptHelper
{
public:
    static void storeStringsOfDialog(sal_uInt16 nPageId, const OUString& sPageStrings);
    static OUString getStringsFromDialog(sal_uInt16 nPageId);
};

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/options/connpooloptions.cxx b/cui/source/options/connpooloptions.cxx
index 80c202a..b135618 100644
--- a/cui/source/options/connpooloptions.cxx
+++ b/cui/source/options/connpooloptions.cxx
@@ -159,6 +159,22 @@ namespace offapp
        commitTimeoutField();
    }

    OUString ConnectionPoolOptionsPage::GetAllStrings()
    {
        OUString sAllStrings;
        OUString labels[] = { "label1", "driverslabel", "driverlabel", "timeoutlabel", "driver" };

        for (const auto& label : labels)
            sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

        OUString checkButton[] = { "connectionpooling", "enablepooling" };

        for (const auto& check : checkButton)
            sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";

        return sAllStrings.replaceAll("_", "");
    }

    bool ConnectionPoolOptionsPage::FillItemSet(SfxItemSet* _rSet)
    {
        commitTimeoutField();
diff --git a/cui/source/options/connpooloptions.hxx b/cui/source/options/connpooloptions.hxx
index 549448e..e5ec2a6 100644
--- a/cui/source/options/connpooloptions.hxx
+++ b/cui/source/options/connpooloptions.hxx
@@ -45,6 +45,7 @@ namespace offapp
        ConnectionPoolOptionsPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rAttrSet);
        virtual ~ConnectionPoolOptionsPage() override;
        static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* _rAttrSet);
        virtual OUString GetAllStrings() override;

    private:
        virtual bool        FillItemSet(SfxItemSet* _rSet) override;
diff --git a/cui/source/options/dbregister.cxx b/cui/source/options/dbregister.cxx
index 143112c..3aa47d6 100644
--- a/cui/source/options/dbregister.cxx
+++ b/cui/source/options/dbregister.cxx
@@ -131,6 +131,13 @@ std::unique_ptr<SfxTabPage> DbRegistrationOptionsPage::Create( weld::Container* 
    return std::make_unique<DbRegistrationOptionsPage>(pPage, pController, *rAttrSet);
}

OUString DbRegistrationOptionsPage::GetAllStrings()
{
    OUString sAllStrings = m_xBuilder->weld_label("label1")->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool DbRegistrationOptionsPage::FillItemSet( SfxItemSet* rCoreSet )
{
    // the settings for the single drivers
diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx
index 93c8b03..b2fb060 100644
--- a/cui/source/options/fontsubs.cxx
+++ b/cui/source/options/fontsubs.cxx
@@ -140,6 +140,22 @@ std::unique_ptr<SfxTabPage> SvxFontSubstTabPage::Create( weld::Container* pPage,
    return std::make_unique<SvxFontSubstTabPage>(pPage, pController, *rAttrSet);
}

OUString SvxFontSubstTabPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label4", "label2", "label3", "label1", "label8", "label9" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString checkButton[] = { "usetable", "nonpropfontonly" };

    for (const auto& check : checkButton)
        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool  SvxFontSubstTabPage::FillItemSet( SfxItemSet* )
{
    std::vector<SubstitutionStruct> aNewFontSubs;
diff --git a/cui/source/options/fontsubs.hxx b/cui/source/options/fontsubs.hxx
index dc55d94..d86ed04 100644
--- a/cui/source/options/fontsubs.hxx
+++ b/cui/source/options/fontsubs.hxx
@@ -54,6 +54,9 @@ public:
    SvxFontSubstTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
    static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet);
    virtual ~SvxFontSubstTabPage() override;

    virtual OUString GetAllStrings() override;

    virtual bool        FillItemSet( SfxItemSet* rSet ) override;
    virtual void        Reset( const SfxItemSet* rSet ) override;
};
diff --git a/cui/source/options/optaccessibility.cxx b/cui/source/options/optaccessibility.cxx
index d0a3694..e0667d5 100644
--- a/cui/source/options/optaccessibility.cxx
+++ b/cui/source/options/optaccessibility.cxx
@@ -48,6 +48,23 @@ std::unique_ptr<SfxTabPage> SvxAccessibilityOptionsTabPage::Create(weld::Contain
    return std::make_unique<SvxAccessibilityOptionsTabPage>(pPage, pController, *rAttrSet);
}

OUString SvxAccessibilityOptionsTabPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label1", "label2", "label13" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString checkButton[] = { "acctool",      "textselinreadonly", "animatedgraphics",
                               "animatedtext", "autofontcolor",     "systempagepreviewcolor" };

    for (const auto& check : checkButton)
        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool SvxAccessibilityOptionsTabPage::FillItemSet( SfxItemSet* )
{
    std::shared_ptr<comphelper::ConfigurationChanges> batch( comphelper::ConfigurationChanges::create() );
diff --git a/cui/source/options/optaccessibility.hxx b/cui/source/options/optaccessibility.hxx
index 504e183..4481dd8 100644
--- a/cui/source/options/optaccessibility.hxx
+++ b/cui/source/options/optaccessibility.hxx
@@ -35,6 +35,9 @@ public:
    virtual ~SvxAccessibilityOptionsTabPage() override;

    static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet );

    virtual OUString GetAllStrings() override;

    virtual bool        FillItemSet( SfxItemSet* rSet ) override;
    virtual void        Reset( const SfxItemSet* rSet ) override;
};
diff --git a/cui/source/options/optasian.cxx b/cui/source/options/optasian.cxx
index 9ef6b75..533768d 100644
--- a/cui/source/options/optasian.cxx
+++ b/cui/source/options/optasian.cxx
@@ -141,6 +141,26 @@ std::unique_ptr<SfxTabPage> SvxAsianLayoutPage::Create(weld::Container* pPage, w
    return std::make_unique<SvxAsianLayoutPage>(pPage, pController, *rAttrSet);
}

OUString SvxAsianLayoutPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[]
        = { "label1", "label2", "label3", "languageft", "startft", "endft", "hintft" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString radioButton[] = { "charkerning", "charpunctkerning", "nocompression",
                               "punctcompression", "punctkanacompression" };

    for (const auto& radio : radioButton)
        sAllStrings += m_xBuilder->weld_radio_button(radio)->get_label() + " ";

    sAllStrings += m_xStandardCB->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool SvxAsianLayoutPage::FillItemSet( SfxItemSet* )
{
    if(m_xCharKerningRB->get_state_changed_from_saved())
diff --git a/cui/source/options/optbasic.cxx b/cui/source/options/optbasic.cxx
index c550d94..dc46c8e 100644
--- a/cui/source/options/optbasic.cxx
+++ b/cui/source/options/optbasic.cxx
@@ -53,6 +53,23 @@ void SvxBasicIDEOptionsPage::LoadConfig()
    m_xUseExtendedTypesChk->set_sensitive( !officecfg::Office::BasicIDE::Autocomplete::UseExtended::isReadOnly() );
}

OUString SvxBasicIDEOptionsPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label1", "label2", "label3" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString checkButton[] = { "codecomplete_enable", "autocorrect",    "autoclose_quotes",
                               "autoclose_paren",     "autoclose_proc", "extendedtypes_enable" };

    for (const auto& check : checkButton)
        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool SvxBasicIDEOptionsPage::FillItemSet( SfxItemSet* /*rCoreSet*/ )
{
    bool bModified = false;
diff --git a/cui/source/options/optbasic.hxx b/cui/source/options/optbasic.hxx
index 990b54d..bc4274e 100644
--- a/cui/source/options/optbasic.hxx
+++ b/cui/source/options/optbasic.hxx
@@ -38,6 +38,9 @@ public:
    virtual ~SvxBasicIDEOptionsPage() override;

    static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet );

    virtual OUString GetAllStrings() override;

    virtual bool FillItemSet( SfxItemSet* rSet ) override;
    virtual void Reset( const SfxItemSet* rSet ) override;
    virtual void FillUserData() override;
diff --git a/cui/source/options/optchart.cxx b/cui/source/options/optchart.cxx
index 5d6b15e..77ca751 100644
--- a/cui/source/options/optchart.cxx
+++ b/cui/source/options/optchart.cxx
@@ -143,6 +143,22 @@ std::unique_ptr<SfxTabPage> SvxDefaultColorOptPage::Create( weld::Container* pPa
    return std::make_unique<SvxDefaultColorOptPage>( pPage, pController, *rAttrs );
}

OUString SvxDefaultColorOptPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label20", "label1" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString buttons[] = { "add", "delete", "default" };

    for (const auto& btn : buttons)
        sAllStrings += m_xBuilder->weld_button(btn)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool SvxDefaultColorOptPage::FillItemSet( SfxItemSet* rOutAttrs )
{
    if( m_SvxChartColorTableUniquePtr )
diff --git a/cui/source/options/optchart.hxx b/cui/source/options/optchart.hxx
index 08bd26a..22a0149 100644
--- a/cui/source/options/optchart.hxx
+++ b/cui/source/options/optchart.hxx
@@ -69,6 +69,9 @@ public:
    void    Construct();

    static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rInAttrs );

    virtual OUString GetAllStrings() override;

    virtual bool        FillItemSet( SfxItemSet* rOutAttrs ) override;
    virtual void        Reset( const SfxItemSet* rInAttrs ) override;

diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx
index 6daa39b..0c8502a 100644
--- a/cui/source/options/optcolor.cxx
+++ b/cui/source/options/optcolor.cxx
@@ -800,6 +800,18 @@ std::unique_ptr<SfxTabPage> SvxColorOptionsTabPage::Create(weld::Container* pPag
    return std::make_unique<SvxColorOptionsTabPage>(pPage, pController, *rAttrSet);
}

OUString SvxColorOptionsTabPage::GetAllStrings()
{
    // buttons are excluded
    OUString sAllStrings;
    OUString labels[] = { "label2", "label3", "autocolor", "uielements", "colorsetting" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool SvxColorOptionsTabPage::FillItemSet( SfxItemSet*  )
{
    bFillItemSetCalled = true;
diff --git a/cui/source/options/optcolor.hxx b/cui/source/options/optcolor.hxx
index 096ed93..396746d 100644
--- a/cui/source/options/optcolor.hxx
+++ b/cui/source/options/optcolor.hxx
@@ -60,6 +60,8 @@ public:

    static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet );

    virtual OUString GetAllStrings() override;

    virtual bool        FillItemSet( SfxItemSet* rSet ) override;
    virtual void        Reset( const SfxItemSet* rSet ) override;

diff --git a/cui/source/options/optctl.cxx b/cui/source/options/optctl.cxx
index 869879c..dae4909 100644
--- a/cui/source/options/optctl.cxx
+++ b/cui/source/options/optctl.cxx
@@ -58,6 +58,27 @@ std::unique_ptr<SfxTabPage> SvxCTLOptionsPage::Create( weld::Container* pPage, w
    return std::make_unique<SvxCTLOptionsPage>( pPage, pController, *rAttrSet );
}

OUString SvxCTLOptionsPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label1", "label2", "label3", "label4", "label5" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString checkButton[] = { "sequencechecking", "restricted", "typeandreplace" };

    for (const auto& check : checkButton)
        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";

    OUString radioButton[] = { "movementlogical", "movementvisual" };

    for (const auto& radio : radioButton)
        sAllStrings += m_xBuilder->weld_radio_button(radio)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool SvxCTLOptionsPage::FillItemSet( SfxItemSet* )
{
    bool bModified = false;
diff --git a/cui/source/options/optctl.hxx b/cui/source/options/optctl.hxx
index 0cc2495..35c07d3 100644
--- a/cui/source/options/optctl.hxx
+++ b/cui/source/options/optctl.hxx
@@ -38,6 +38,9 @@ public:
    SvxCTLOptionsPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
    virtual ~SvxCTLOptionsPage() override;
    static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet );

    virtual OUString GetAllStrings() override;

    virtual bool        FillItemSet( SfxItemSet* rSet ) override;
    virtual void        Reset( const SfxItemSet* rSet ) override;
};
diff --git a/cui/source/options/optdeepl.cxx b/cui/source/options/optdeepl.cxx
index 75db4af..b02edf8 100644
--- a/cui/source/options/optdeepl.cxx
+++ b/cui/source/options/optdeepl.cxx
@@ -43,6 +43,19 @@ void OptDeeplTabPage::Reset(const SfxItemSet*)
        m_xAuthKey->set_text(*officecfg::Office::Linguistic::Translation::Deepl::AuthKey::get());
}

OUString OptDeeplTabPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label1", "label2", "label3" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    sAllStrings += m_xBuilder->weld_link_button("privacy")->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool OptDeeplTabPage::FillItemSet(SfxItemSet*)
{
    std::shared_ptr<comphelper::ConfigurationChanges> batch(
diff --git a/cui/source/options/optdeepl.hxx b/cui/source/options/optdeepl.hxx
index 3258f67..51714c6 100644
--- a/cui/source/options/optdeepl.hxx
+++ b/cui/source/options/optdeepl.hxx
@@ -28,6 +28,8 @@ public:
    static std::unique_ptr<SfxTabPage>
    Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet);

    virtual OUString GetAllStrings() override;

    virtual bool FillItemSet(SfxItemSet* rSet) override;
    virtual void Reset(const SfxItemSet* rSet) override;

diff --git a/cui/source/options/optfltr.cxx b/cui/source/options/optfltr.cxx
index 48840b1..9e636ac 100644
--- a/cui/source/options/optfltr.cxx
+++ b/cui/source/options/optfltr.cxx
@@ -71,6 +71,23 @@ std::unique_ptr<SfxTabPage> OfaMSFilterTabPage::Create( weld::Container* pPage, 
    return std::make_unique<OfaMSFilterTabPage>(pPage, pController, *rAttrSet);
}

OUString OfaMSFilterTabPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label1", "label2", "label3" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString checkButton[] = { "wo_basic", "wo_exec",     "wo_saveorig", "ex_basic",
                               "ex_exec",  "ex_saveorig", "pp_basic",    "pp_saveorig" };

    for (const auto& check : checkButton)
        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool OfaMSFilterTabPage::FillItemSet( SfxItemSet* )
{
    SvtFilterOptions& rOpt = SvtFilterOptions::Get();
@@ -155,6 +172,24 @@ std::unique_ptr<SfxTabPage> OfaMSFilterTabPage2::Create( weld::Container* pPage,
    return std::make_unique<OfaMSFilterTabPage2>( pPage, pController, *rAttrSet );
}

OUString OfaMSFilterTabPage2::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label1", "label2", "label3", "label4", "label5", "label6" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString radioButton[] = { "highlighting", "shading" };

    for (const auto& radio : radioButton)
        sAllStrings += m_xBuilder->weld_radio_button(radio)->get_label() + " ";

    sAllStrings += m_xMSOLockFileCB->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool OfaMSFilterTabPage2::FillItemSet( SfxItemSet* )
{
    SvtFilterOptions& rOpt = SvtFilterOptions::Get();
diff --git a/cui/source/options/optfltr.hxx b/cui/source/options/optfltr.hxx
index f38a893..fcde689 100644
--- a/cui/source/options/optfltr.hxx
+++ b/cui/source/options/optfltr.hxx
@@ -40,6 +40,8 @@ public:
    static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController,
                                const SfxItemSet* rAttrSet );

    virtual OUString GetAllStrings() override;

    virtual bool        FillItemSet( SfxItemSet* rSet ) override;
    virtual void        Reset( const SfxItemSet* rSet ) override;
};
@@ -71,6 +73,8 @@ public:
    static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet );
    virtual ~OfaMSFilterTabPage2() override;

    virtual OUString GetAllStrings() override;

    virtual bool        FillItemSet( SfxItemSet* rSet ) override;
    virtual void        Reset( const SfxItemSet* rSet ) override;
};
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 3223637..22d3d75 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -218,6 +218,27 @@ std::unique_ptr<SfxTabPage> OfaMiscTabPage::Create( weld::Container* pPage, weld
    return std::make_unique<OfaMiscTabPage>( pPage, pController, *rAttrSet );
}

OUString OfaMiscTabPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label1", "label2", "label4", "label5", "label6",
                          "toyear", "label7", "label8", "label9" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString checkButton[]
        = { "exthelp",   "popupnohelp", "cbShowTipOfTheDay", "filedlg",
            "docstatus", "crashreport", "quicklaunch",       "cbPerformFileExtCheck" };

    for (const auto& check : checkButton)
        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";

    sAllStrings += m_xBuilder->weld_button("assocfiles")->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool OfaMiscTabPage::FillItemSet( SfxItemSet* rSet )
{
    bool bModified = false;
@@ -683,6 +704,27 @@ std::unique_ptr<SfxTabPage> OfaViewTabPage::Create( weld::Container* pPage, weld
    return std::make_unique<OfaViewTabPage>(pPage, pController, *rAttrSet);
}

OUString OfaViewTabPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label16", "label7",      "label1",       "label6", "label15",
                          "label14", "label8",      "label9",       "label4", "label12",
                          "label2",  "skiaenabled", "skiadisabled", "label5", "aafrom" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString checkButton[]
        = { "useaccel", "useaa", "useskia", "forceskiaraster", "showfontpreview", "aafont" };

    for (const auto& check : checkButton)
        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";

    sAllStrings += m_xSkiaLog->get_label() + " " + m_xRunGPTests->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool OfaViewTabPage::FillItemSet( SfxItemSet* )
{
    bool bModified = false;
@@ -1207,6 +1249,25 @@ static void lcl_Update(std::unique_ptr<SfxVoidItem> pInvalidItems[], std::unique
    }
}

OUString OfaLanguagesTabPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[]
        = { "label1", "label4",          "label7", "localesettingFT", "defaultcurrency",
            "label6", "dataaccpatterns", "label2", "western",         "label3" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString checkButton[] = { "decimalseparator", "asiansupport", "ctlsupport", "currentdoc",
                               "ignorelanguagechange" };

    for (const auto& check : checkButton)
        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool OfaLanguagesTabPage::FillItemSet( SfxItemSet* rSet )
{
    // lock configuration broadcasters so that we can coordinate the notifications
diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx
index c0d2439..7dc7e07 100644
--- a/cui/source/options/optgdlg.hxx
+++ b/cui/source/options/optgdlg.hxx
@@ -68,6 +68,8 @@ public:

    static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet );

    virtual OUString GetAllStrings() override;

    virtual bool        FillItemSet( SfxItemSet* rSet ) override;
    virtual void        Reset( const SfxItemSet* rSet ) override;
};
@@ -128,6 +130,8 @@ public:

    static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet );

    virtual OUString GetAllStrings() override;

    virtual bool        FillItemSet( SfxItemSet* rSet ) override;
    virtual void        Reset( const SfxItemSet* rSet ) override;
};
@@ -176,6 +180,8 @@ public:

    static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet );

    virtual OUString GetAllStrings() override;

    virtual bool        FillItemSet( SfxItemSet* rSet ) override;
    virtual void        Reset( const SfxItemSet* rSet ) override;
};
diff --git a/cui/source/options/optgenrl.cxx b/cui/source/options/optgenrl.cxx
index 474eaa5..4245ac9 100644
--- a/cui/source/options/optgenrl.cxx
+++ b/cui/source/options/optgenrl.cxx
@@ -341,6 +341,23 @@ std::unique_ptr<SfxTabPage> SvxGeneralTabPage::Create( weld::Container* pPage, w
    return std::make_unique<SvxGeneralTabPage>( pPage, pController, *rAttrSet );
}

OUString SvxGeneralTabPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[]
        = { "label1",     "companyft",         "nameft",          "rusnameft",
            "eastnameft", "streetft",          "russtreetft",     "icityft",
            "cityft",     "countryft",         "titleft",         "phoneft",
            "faxft",      "cryptographylabel", "signingkeylabel", "encryptionkeylabel" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    sAllStrings += m_xUseDataCB->get_label() + " " + m_xEncryptToSelfCB->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool SvxGeneralTabPage::FillItemSet( SfxItemSet* )
{
    // remove leading and trailing whitespaces
diff --git a/cui/source/options/opthtml.cxx b/cui/source/options/opthtml.cxx
index 18e3bec..15e4b39 100644
--- a/cui/source/options/opthtml.cxx
+++ b/cui/source/options/opthtml.cxx
@@ -68,6 +68,24 @@ std::unique_ptr<SfxTabPage> OfaHtmlTabPage::Create( weld::Container* pPage, weld
    return std::make_unique<OfaHtmlTabPage>(pPage, pController, *rAttrSet);
}

OUString OfaHtmlTabPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label1",  "label2",  "label3",  "size1FT", "size2FT",
                          "size3FT", "size4FT", "size5FT", "size6FT", "size7FT" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString checkButton[] = { "numbersenglishus", "unknowntag",     "ignorefontnames", "starbasic",
                               "starbasicwarning", "printextension", "savegrflocal" };

    for (const auto& check : checkButton)
        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool OfaHtmlTabPage::FillItemSet( SfxItemSet* )
{
    std::shared_ptr<comphelper::ConfigurationChanges> xChanges = comphelper::ConfigurationChanges::create();
diff --git a/cui/source/options/opthtml.hxx b/cui/source/options/opthtml.hxx
index 33bff16..7cd3a5e 100644
--- a/cui/source/options/opthtml.hxx
+++ b/cui/source/options/opthtml.hxx
@@ -49,6 +49,8 @@ public:
    static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController,
                                       const SfxItemSet* rAttrSet );

    virtual OUString GetAllStrings() override;

    virtual bool        FillItemSet( SfxItemSet* rSet ) override;
    virtual void        Reset( const SfxItemSet* rSet ) override;

diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index cf879d0..1d0ef95 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -336,6 +336,18 @@ void SvxProxyTabPage::Reset(const SfxItemSet*)
    EnableControls_Impl();
}

OUString SvxProxyTabPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label1",    "label2",     "httpft",      "httpsft",   "ftpft",
                          "noproxyft", "httpportft", "httpsportft", "ftpportft", "noproxydesc" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool SvxProxyTabPage::FillItemSet(SfxItemSet* )
{
    bool bModified = false;
@@ -836,6 +848,33 @@ namespace
    }
}

OUString SvxSecurityTabPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label1",         "label4",  "label2", "masterpasswordtext",
                          "nopasswordsave", "label3",  "label5", "label8",
                          "label7",         "label10", "label9", "label12",
                          "label11" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString checkButton[] = { "savepassword", "usemasterpassword" };

    for (const auto& check : checkButton)
        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";

    // TODO: Should we exclude button strings from the search?
    // button id: "browse" is excluded
    OUString buttons[]
        = { "options", "connections", "masterpassword", "macro", "cert", "tsas" };

    for (const auto& btn : buttons)
        sAllStrings += m_xBuilder->weld_button(btn)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool SvxSecurityTabPage::FillItemSet( SfxItemSet* )
{
    bool bModified = false;
@@ -919,6 +958,19 @@ std::unique_ptr<SfxTabPage> SvxEMailTabPage::Create( weld::Container* pPage, wel

/* -------------------------------------------------------------------------*/

OUString SvxEMailTabPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label1", "label2", "browsetitle", "suppress" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

/* -------------------------------------------------------------------------*/

bool SvxEMailTabPage::FillItemSet( SfxItemSet* )
{
    std::shared_ptr<comphelper::ConfigurationChanges> batch(
diff --git a/cui/source/options/optinet2.hxx b/cui/source/options/optinet2.hxx
index 9fea649..f99c30b 100644
--- a/cui/source/options/optinet2.hxx
+++ b/cui/source/options/optinet2.hxx
@@ -68,6 +68,9 @@ public:
    SvxProxyTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
    virtual ~SvxProxyTabPage() override;
    static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet );

    virtual OUString GetAllStrings() override;

    virtual bool        FillItemSet( SfxItemSet* rSet ) override;
    virtual void        Reset( const SfxItemSet* rSet ) override;
};
@@ -127,6 +130,9 @@ public:
    SvxSecurityTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
    static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet );
    virtual ~SvxSecurityTabPage() override;

    virtual OUString GetAllStrings() override;

    virtual bool        FillItemSet( SfxItemSet* rSet ) override;
    virtual void        Reset( const SfxItemSet* rSet ) override;
};
@@ -155,6 +161,8 @@ public:

    static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet );

    virtual OUString GetAllStrings() override;

    virtual bool        FillItemSet( SfxItemSet* rSet ) override;
    virtual void        Reset( const SfxItemSet* rSet ) override;
};
diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index 64ba41c..60eba67 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -467,6 +467,27 @@ std::unique_ptr<SfxTabPage> SvxJavaOptionsPage::Create(weld::Container* pPage, w
    return std::make_unique<SvxJavaOptionsPage>(pPage, pController, *rAttrSet);
}

OUString SvxJavaOptionsPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label1", "label2", "javapath", "selectruntime", "label12" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString checkButton[] = { "javaenabled", "experimental", "macrorecording" };

    for (const auto& check : checkButton)
        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";

    OUString buttons[] = { "add", "parameters", "classpath", "expertconfig" };

    for (const auto& btn : buttons)
        sAllStrings += m_xBuilder->weld_button(btn)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool SvxJavaOptionsPage::FillItemSet( SfxItemSet* /*rCoreSet*/ )
{
    bool bModified = false;
diff --git a/cui/source/options/optjava.hxx b/cui/source/options/optjava.hxx
index 929dfe7..080c5bc 100644
--- a/cui/source/options/optjava.hxx
+++ b/cui/source/options/optjava.hxx
@@ -108,6 +108,8 @@ public:

    static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet );

    virtual OUString GetAllStrings() override;

    virtual bool            FillItemSet( SfxItemSet* rSet ) override;
    virtual void            Reset( const SfxItemSet* rSet ) override;
    virtual void            FillUserData() override;
diff --git a/cui/source/options/optjsearch.cxx b/cui/source/options/optjsearch.cxx
index 4a2c31c..d9f285b 100644
--- a/cui/source/options/optjsearch.cxx
+++ b/cui/source/options/optjsearch.cxx
@@ -201,6 +201,39 @@ void SvxJSearchOptionsPage::Reset( const SfxItemSet* )
    m_xIgnoreMiddleDot         ->save_state();
}

OUString SvxJSearchOptionsPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label1", "label2" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString checkButton[] = { "matchcase",
                               "matchfullhalfwidth",
                               "matchhiraganakatakana",
                               "matchcontractions",
                               "matchminusdashchoon",
                               "matchrepeatcharmarks",
                               "matchvariantformkanji",
                               "matcholdkanaforms",
                               "ignorepunctuation",
                               "ignorewhitespace",
                               "matchdiziduzu",
                               "matchbavahafa",
                               "matchtsithichidhizi",
                               "matchhyuiyubyuvyu",
                               "matchseshezeje",
                               "matchiaiya",
                               "matchkiku",
                               "matchprolongedsoundmark",
                               "ignoremiddledot" };

    for (const auto& check : checkButton)
        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool SvxJSearchOptionsPage::FillItemSet( SfxItemSet* )
{
diff --git a/cui/source/options/optjsearch.hxx b/cui/source/options/optjsearch.hxx
index f0da350..96b7d73 100644
--- a/cui/source/options/optjsearch.hxx
+++ b/cui/source/options/optjsearch.hxx
@@ -59,6 +59,8 @@ public:
    virtual ~SvxJSearchOptionsPage() override;
    static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet);

    virtual OUString GetAllStrings() override;

    virtual void        Reset( const SfxItemSet* rSet ) override;
    virtual bool        FillItemSet( SfxItemSet* rSet ) override;

diff --git a/cui/source/options/optlanguagetool.cxx b/cui/source/options/optlanguagetool.cxx
index e1f4806..9c8cccba 100644
--- a/cui/source/options/optlanguagetool.cxx
+++ b/cui/source/options/optlanguagetool.cxx
@@ -83,6 +83,26 @@ void OptLanguageToolTabPage::Reset(const SfxItemSet*)
    m_xSSLDisableVerificationBox->set_active(!LanguageToolCfg::SSLCertVerify::get());
}

OUString OptLanguageToolTabPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "langtoolsettings", "disclaimer",  "apisettingsheader", "base",
                          "urldesc",          "usernamelbl", "usernamedesc",      "apikeylbl",
                          "apikeydesc",       "restlbl",     "restdesc" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString checkButton[] = { "activate", "verifyssl" };

    for (const auto& check : checkButton)
        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";

    sAllStrings += m_xBuilder->weld_link_button("policy")->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool OptLanguageToolTabPage::FillItemSet(SfxItemSet*)
{
    auto batch(comphelper::ConfigurationChanges::create());
diff --git a/cui/source/options/optlanguagetool.hxx b/cui/source/options/optlanguagetool.hxx
index 2dbe889..25781c6 100644
--- a/cui/source/options/optlanguagetool.hxx
+++ b/cui/source/options/optlanguagetool.hxx
@@ -29,6 +29,8 @@ public:
    static std::unique_ptr<SfxTabPage>
    Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet);

    virtual OUString GetAllStrings() override;

    virtual bool FillItemSet(SfxItemSet* rSet) override;
    virtual void Reset(const SfxItemSet* rSet) override;

diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index d13ca46..6bc7d5a 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -921,6 +921,19 @@ std::unique_ptr<SfxTabPage> SvxLinguTabPage::Create( weld::Container* pPage, wel
    return std::make_unique<SvxLinguTabPage>( pPage, pController, *rAttrSet );
}

OUString SvxLinguTabPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "lingumodulesft", "lingudictsft", "label4" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    sAllStrings += m_xMoreDictsLink->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool SvxLinguTabPage::FillItemSet( SfxItemSet* rCoreSet )
{
    bool bModified = true; // !!!!
diff --git a/cui/source/options/optopencl.cxx b/cui/source/options/optopencl.cxx
index e85ef1d..866e843 100644
--- a/cui/source/options/optopencl.cxx
+++ b/cui/source/options/optopencl.cxx
@@ -50,6 +50,19 @@ std::unique_ptr<SfxTabPage> SvxOpenCLTabPage::Create(weld::Container* pPage, wel
    return std::make_unique<SvxOpenCLTabPage>(pPage, pController, *rAttrSet);
}

OUString SvxOpenCLTabPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label1", "openclnotused", "openclused" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    sAllStrings += mxUseOpenCL->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool SvxOpenCLTabPage::FillItemSet( SfxItemSet* )
{
    bool bModified = false;
diff --git a/cui/source/options/optopencl.hxx b/cui/source/options/optopencl.hxx
index f7097d3..1fce5e3 100644
--- a/cui/source/options/optopencl.hxx
+++ b/cui/source/options/optopencl.hxx
@@ -34,6 +34,7 @@ public:
    SvxOpenCLTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
    static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet );
    virtual ~SvxOpenCLTabPage() override;
    virtual OUString GetAllStrings() override;

    virtual bool            FillItemSet( SfxItemSet* rSet ) override;
    virtual void            Reset( const SfxItemSet* rSet ) override;
diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx
index dfca56d..bb77a5f 100644
--- a/cui/source/options/optpath.cxx
+++ b/cui/source/options/optpath.cxx
@@ -221,6 +221,12 @@ std::unique_ptr<SfxTabPage> SvxPathTabPage::Create( weld::Container* pPage, weld
    return std::make_unique<SvxPathTabPage>( pPage, pController, *rAttrSet );
}

OUString SvxPathTabPage::GetAllStrings()
{
    OUString sAllStrings = m_xBuilder->weld_label("label1")->get_label();
    return sAllStrings.replaceAll("_", "");
}

bool SvxPathTabPage::FillItemSet( SfxItemSet* )
{
    for (int i = 0, nEntryCount = m_xPathBox->n_children(); i < nEntryCount; ++i)
diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx
index 565d765..2042c9c 100644
--- a/cui/source/options/optsave.cxx
+++ b/cui/source/options/optsave.cxx
@@ -238,6 +238,26 @@ void SvxSaveTabPage::DetectHiddenControls()

}

OUString SvxSaveTabPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label1", "label2", "autosave_mins", "label3",
                          "label5", "label6", "saveas_label",  "odfwarning_label" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString checkButton[]
        = { "load_settings", "load_docprinter", "load_anyuser",   "autosave",
            "userautosave",  "docinfo",         "backup",         "backupintodocumentfolder",
            "relative_fsys", "relative_inet",   "warnalienformat" };

    for (const auto& check : checkButton)
        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool SvxSaveTabPage::FillItemSet( SfxItemSet* rSet )
{
    auto xChanges = comphelper::ConfigurationChanges::create();
diff --git a/cui/source/options/optsave.hxx b/cui/source/options/optsave.hxx
index a4cb763..8d95b7c 100644
--- a/cui/source/options/optsave.hxx
+++ b/cui/source/options/optsave.hxx
@@ -74,6 +74,8 @@ public:

    static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet );

    virtual OUString GetAllStrings() override;

    virtual bool        FillItemSet( SfxItemSet* rSet ) override;
    virtual void        Reset( const SfxItemSet* rSet ) override;
};
diff --git a/cui/source/options/optupdt.cxx b/cui/source/options/optupdt.cxx
index faeac7f..779856f 100644
--- a/cui/source/options/optupdt.cxx
+++ b/cui/source/options/optupdt.cxx
@@ -190,6 +190,31 @@ std::unique_ptr<SfxTabPage> SvxOnlineUpdateTabPage::Create( weld::Container* pPa
    return std::make_unique<SvxOnlineUpdateTabPage>( pPage, pController, *rAttrSet );
}

OUString SvxOnlineUpdateTabPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label1",        "lastchecked", "neverchecked",    "labeldest",
                          "destpathlabel", "labelagent",  "useragent_label", "useragent_changed" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString checkButton[] = { "autocheck", "autodownload", "extrabits" };

    for (const auto& check : checkButton)
        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";

    OUString radioButton[] = { "everyday", "everyweek", "everymonth" };

    for (const auto& radio : radioButton)
        sAllStrings += m_xBuilder->weld_radio_button(radio)->get_label() + " ";

    // some buttons are not included
    sAllStrings += m_xPrivacyPolicyButton->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool SvxOnlineUpdateTabPage::FillItemSet( SfxItemSet* )
{
    bool bModified = false;
diff --git a/cui/source/options/optupdt.hxx b/cui/source/options/optupdt.hxx
index 7143bf3..bf2abfe 100644
--- a/cui/source/options/optupdt.hxx
+++ b/cui/source/options/optupdt.hxx
@@ -62,6 +62,8 @@ public:
    static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet );
    virtual ~SvxOnlineUpdateTabPage() override;

    virtual OUString GetAllStrings() override;

    virtual bool            FillItemSet( SfxItemSet* rSet ) override;
    virtual void            Reset( const SfxItemSet* rSet ) override;
    virtual void            FillUserData() override;
diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx
index c1ee5265..5fe9a7d 100644
--- a/cui/source/options/personalization.cxx
+++ b/cui/source/options/personalization.cxx
@@ -55,6 +55,19 @@ std::unique_ptr<SfxTabPage> SvxPersonalizationTabPage::Create(weld::Container* p
    return std::make_unique<SvxPersonalizationTabPage>(pPage, pController, *rSet);
}

OUString SvxPersonalizationTabPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString radioButton[] = { "no_persona", "default_persona" };

    for (const auto& radio : radioButton)
        sAllStrings += m_xBuilder->weld_radio_button(radio)->get_label() + " ";

    sAllStrings += m_xBuilder->weld_label("personas_label")->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool SvxPersonalizationTabPage::FillItemSet(SfxItemSet*)
{
    // persona
diff --git a/cui/source/options/personalization.hxx b/cui/source/options/personalization.hxx
index 671f194..b86653f 100644
--- a/cui/source/options/personalization.hxx
+++ b/cui/source/options/personalization.hxx
@@ -33,6 +33,8 @@ public:
    static std::unique_ptr<SfxTabPage>
    Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet);

    virtual OUString GetAllStrings() override;

    /// Apply the settings ([OK] button).
    virtual bool FillItemSet(SfxItemSet* rSet) override;

diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 1b419f2..4af68df 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -66,6 +66,11 @@
#include "optlanguagetool.hxx"
#include "optdeepl.hxx"

// include search util
#include <com/sun/star/util/SearchFlags.hpp>
#include <com/sun/star/util/SearchAlgorithms2.hpp>
#include <unotools/textsearch.hxx>

#include <com/sun/star/awt/XContainerWindowEventHandler.hpp>
#include <com/sun/star/awt/ContainerWindowProvider.hpp>
#include <com/sun/star/awt/XControl.hpp>
@@ -438,6 +443,23 @@ struct OptionsGroupInfo
        m_pModule( pMod ), m_nDialogId( nId ) {}
};

struct OptionsPageIdInfo
{
    OUString m_sParentName;
    OUString m_sPageName;
    sal_uInt16 m_nParentId;
    sal_uInt16 m_nPageId;

    OptionsPageIdInfo(OUString sParentName, OUString sPageName, sal_uInt16 nParentId,
                      sal_uInt16 nPageId)
        : m_sParentName(std::move(sParentName))
        , m_sPageName(std::move(sPageName))
        , m_nParentId(nParentId)
        , m_nPageId(nPageId)
    {
    }
};

// Basic ctor with common initialization
OfaTreeOptionsDialog::OfaTreeOptionsDialog(weld::Window* pParent, bool fromExtensionManager)
    : SfxOkDialogController(pParent, "cui/ui/optionsdialog.ui", "OptionsDialog")
@@ -446,7 +468,10 @@ OfaTreeOptionsDialog::OfaTreeOptionsDialog(weld::Window* pParent, bool fromExten
    , xBackPB(m_xBuilder->weld_button("revert"))
    , xTreeLB(m_xBuilder->weld_tree_view("pages"))
    , xTabBox(m_xBuilder->weld_container("box"))
    , m_xSearchEdit(m_xBuilder->weld_entry("searchEntry"))
    , m_pParent(pParent)
    , m_aUpdateDataTimer("OfaTreeOptionsDialog UpdateDataTimer")
    , bIsFirtsInitialize(true)
    , sTitle(m_xDialog->get_title())
    , bForgetSelection(false)
    , bIsFromExtensionManager(fromExtensionManager)
@@ -468,8 +493,19 @@ OfaTreeOptionsDialog::OfaTreeOptionsDialog(weld::Window* pParent, bool fromExten
    xBackPB->connect_clicked(LINK(this, OfaTreeOptionsDialog, BackHdl_Impl));
    xApplyPB->connect_clicked(LINK(this, OfaTreeOptionsDialog, ApplyHdl_Impl));
    xOkPB->connect_clicked(LINK(this, OfaTreeOptionsDialog, ApplyHdl_Impl));
    m_xSearchEdit->connect_changed(LINK(this, OfaTreeOptionsDialog, SearchUpdateHdl));
    m_xSearchEdit->connect_focus_out(LINK(this, OfaTreeOptionsDialog, FocusOut_Impl));
    m_xDialog->connect_help(LINK(this, OfaTreeOptionsDialog, HelpHdl_Impl));

    m_aUpdateDataTimer.SetInvokeHandler(LINK(this, OfaTreeOptionsDialog, ImplUpdateDataHdl));
    m_aUpdateDataTimer.SetTimeout(EDIT_UPDATEDATA_TIMEOUT);

    // Initialize search util
    m_options.AlgorithmType2 = util::SearchAlgorithms2::ABSOLUTE;
    m_options.transliterateFlags |= TransliterationFlags::IGNORE_CASE;
    m_options.searchFlag
        |= (util::SearchFlags::REG_NOT_BEGINOFLINE | util::SearchFlags::REG_NOT_ENDOFLINE);

    xTreeLB->set_accessible_name(sTitle);
}

@@ -739,6 +775,314 @@ IMPL_LINK(OfaTreeOptionsDialog, ApplyHdl_Impl, weld::Button&, rButton, void)
        m_xDialog->response(RET_OK);
}

IMPL_LINK_NOARG(OfaTreeOptionsDialog, FocusOut_Impl, weld::Widget&, void)
{
    if (m_aUpdateDataTimer.IsActive())
    {
        m_aUpdateDataTimer.Stop();
        m_aUpdateDataTimer.Invoke();
    }
}

IMPL_LINK_NOARG(OfaTreeOptionsDialog, SearchUpdateHdl, weld::Entry&, void)
{
    m_aUpdateDataTimer.Start();
}

IMPL_LINK_NOARG(OfaTreeOptionsDialog, ImplUpdateDataHdl, Timer*, void)
{
    if (bIsFirtsInitialize)
    {
        m_xSearchEdit->freeze();
        xTreeLB->hide();

        initializeFirstNDialog();

        m_xSearchEdit->thaw();
        xTreeLB->show();
        bIsFirtsInitialize = false;
    }

    // Pause redraw
    xTreeLB->freeze();

    // Apply the search filter
    OUString aSearchTerm(m_xSearchEdit->get_text());
    int nMatchFound = applySearchFilter(aSearchTerm);

    // Resume redraw
    xTreeLB->thaw();

    // select first child of first node after the search done
    if (nMatchFound != -1)
        selectFirstEntry();
}

void OfaTreeOptionsDialog::selectFirstEntry()
{
    std::unique_ptr<weld::TreeIter> xEntry;
    std::unique_ptr<weld::TreeIter> xTemp = xTreeLB->make_iterator();
    bool bTemp = xTreeLB->get_iter_first(*xTemp);

    while (bTemp)
    {
        // select only the first child
        if (xTreeLB->get_iter_depth(*xTemp) && xTreeLB->get_id(*xTemp).toInt64())
        {
            xEntry = xTreeLB->make_iterator(xTemp.get());

            if (!xEntry)
            {
                xEntry = xTreeLB->make_iterator();
                if (!xTreeLB->get_iter_first(*xEntry) || !xTreeLB->iter_next(*xEntry))
                    xEntry.reset();
            }

            if (!xEntry)
                return;

            std::unique_ptr<weld::TreeIter> xParent(xTreeLB->make_iterator(xEntry.get()));
            xTreeLB->iter_parent(*xParent);
            xTreeLB->expand_row(*xParent);
            xTreeLB->scroll_to_row(*xParent);
            xTreeLB->scroll_to_row(*xEntry);
            xTreeLB->set_cursor(*xEntry);
            xTreeLB->select(*xEntry);
            SelectHdl_Impl();

            break;
        }
        bTemp = xTreeLB->iter_next(*xTemp);
    }
}

void OfaTreeOptionsDialog::initializeFirstNDialog(sal_Int16 nNumberOfNode)
{
    std::unique_ptr<weld::TreeIter> xEntry;
    sal_Int16 nCount = 0;

    std::unique_ptr<weld::TreeIter> xTemp = xTreeLB->make_iterator();
    bool bTemp = xTreeLB->get_iter_first(*xTemp);

    while (bTemp)
    {
        if (xTreeLB->get_iter_depth(*xTemp) && xTreeLB->get_id(*xTemp).toInt64())
        {
            if (!(xEntry = xTreeLB->make_iterator(xTemp.get())))
            {
                xEntry = xTreeLB->make_iterator();
                if (!xTreeLB->get_iter_first(*xEntry) || !xTreeLB->iter_next(*xEntry))
                    xEntry.reset();
            }

            if (!xEntry)
                return;

            OptionsPageInfo* pPageInfo = weld::fromId<OptionsPageInfo*>(xTreeLB->get_id(*xEntry));
            if (TreeOptHelper::getStringsFromDialog(pPageInfo->m_nPageId).isEmpty())
            {
                SolarMutexGuard aGuard;
                initializeCurrentDialog(pPageInfo, xEntry);
            }
        }

        /* if nNumberOfNode is -1 (which is the default value if no parameter provided),
           this function will initialize all dialogs since nCount always greater than -1 */
        if (nCount == nNumberOfNode)
            break;

        ++nCount;
        bTemp = xTreeLB->iter_next(*xTemp);
    }
}

void OfaTreeOptionsDialog::clearOptionsDialog()
{
    // clear and reset
    std::unique_ptr<weld::TreeIter> xEntry = xTreeLB->make_iterator();
    bool bEntry = xTreeLB->get_iter_first(*xEntry);

    while (bEntry)
    {
        if (xTreeLB->get_iter_depth(*xEntry))
        {
            OptionsPageInfo* pPageInfo = weld::fromId<OptionsPageInfo*>(xTreeLB->get_id(*xEntry));
            if (pPageInfo->m_xPage)
                pPageInfo->m_xPage.reset();
        }
        bEntry = xTreeLB->iter_next(*xEntry);
    }
    xCurrentPageEntry.reset();
}

// store Options tree with their page names
void OfaTreeOptionsDialog::storeOptionsTree()
{
    m_aTreePageIds.clear();

    sal_uInt16 aParentId = 0;
    OUString sParentName;

    std::unique_ptr<weld::TreeIter> xEntry = xTreeLB->make_iterator();
    bool bEntry = xTreeLB->get_iter_first(*xEntry);

    while (bEntry)
    {
        OptionsGroupInfo* pGroupInfo = weld::fromId<OptionsGroupInfo*>(xTreeLB->get_id(*xEntry));
        bool bIsParentNode = !xTreeLB->get_iter_depth(*xEntry);

        if (bIsParentNode)
        {
            // Parent node
            sParentName = xTreeLB->get_text(*xEntry);
            aParentId = pGroupInfo->m_nDialogId;
            m_aTreePageIds.push_back(new OptionsPageIdInfo(sParentName, sParentName, aParentId, 0));
        }
        else
        {
            // Child node
            OUString sChildName = xTreeLB->get_text(*xEntry);
            OptionsPageInfo* pPageInfo = weld::fromId<OptionsPageInfo*>(xTreeLB->get_id(*xEntry));
            m_aTreePageIds.push_back(
                new OptionsPageIdInfo(sParentName, sChildName, aParentId, pPageInfo->m_nPageId));
        }
        bEntry = xTreeLB->iter_next(*xEntry);
    }
}

int OfaTreeOptionsDialog::applySearchFilter(const OUString& rSearchTerm)
{
    if (rSearchTerm.isEmpty())
    {
        clearOptionsDialog();
        xTreeLB->clear();
        Initialize(m_xFrame);

        return 0;
    }

    m_options.searchString = rSearchTerm;
    utl::TextSearch textSearch(m_options);

    clearOptionsDialog();

    if (xTreeLB->n_children() > 0)
        xTreeLB->clear();

    std::vector<std::pair<sal_uInt16, std::vector<sal_uInt16>>> aFoundIdsVector;

    for (std::size_t i = 0; i < m_aTreePageIds.size(); ++i)
    {
        const OUString sParentName = m_aTreePageIds[i]->m_sParentName;
        const OUString sPageName = m_aTreePageIds[i]->m_sPageName;
        const sal_uInt16 nParentId = m_aTreePageIds[i]->m_nParentId;
        const sal_uInt16 nPageId = m_aTreePageIds[i]->m_nPageId;

        const OUString sPageStrings = TreeOptHelper::getStringsFromDialog(nPageId);
        const OUString sPageNameAndStrings = sParentName + " " + sPageName + " " + sPageStrings;

        sal_Int32 aStartPos = 0;
        sal_Int32 aEndPos = sPageNameAndStrings.getLength();

        // check if rSearchTerm matches with sPageNameAndStrings
        if (textSearch.SearchForward(sPageNameAndStrings, &aStartPos, &aEndPos))
        {
            bool isFound = false;
            for (auto& aEntryId : aFoundIdsVector)
            {
                if (aEntryId.first == nParentId)
                {
                    isFound = true;
                    aEntryId.second.push_back(nPageId);
                }
            }

            if (!isFound)
                aFoundIdsVector.push_back({ nParentId, { nPageId } });
        }
    }

    showDialog(aFoundIdsVector);

    // if treeview is empty, return -1
    return xTreeLB->n_children() ? 0 : -1;
}

void OfaTreeOptionsDialog::showDialog(VectorOfMatchedIds& pSearchIds)
{
    //
    //     void generalOptions();      // SID_GENERAL_OPTIONS
    //     void loadAndSaveOptions();  // SID_FILTER_DLG
    //     void languageOptions();     // SID_LANGUAGE_OPTIONS
    //     void writerOptions();       // SID_SW_EDITOPTIONS
    //     void writerWebOptions();    // SID_SW_ONLINEOPTIONS
    //     void calcOptions();         // SID_SC_EDITOPTIONS
    //     void impressOptions();      // SID_SD_EDITOPTIONS
    //     void drawOptions();         // SID_SD_GRAPHIC_OPTIONS
    //     void mathOptions();         // SID_SM_EDITOPTIONS
    //     void databaseOptions();     // SID_SB_STARBASEOPTIONS
    //     void chartOptions();        // SID_SCH_EDITOPTIONS
    //     void internetOptions();     // SID_INET_DLG
    //

    for (auto& aEntryId : pSearchIds)
    {
        switch (aEntryId.first)
        {
            case SID_GENERAL_OPTIONS:
                generalOptions(aEntryId.second);
                break;

            case SID_FILTER_DLG:
                loadAndSaveOptions(aEntryId.second);
                break;

            case SID_LANGUAGE_OPTIONS:
                languageOptions(aEntryId.second);
                break;

            case SID_SW_EDITOPTIONS:
                writerOptions(aEntryId.second);
                break;

            case SID_SW_ONLINEOPTIONS:
                writerWebOptions(aEntryId.second);
                break;

            case SID_SC_EDITOPTIONS:
                calcOptions(aEntryId.second);
                break;

            case SID_SD_EDITOPTIONS:
                impressOptions(aEntryId.second);
                break;

            case SID_SD_GRAPHIC_OPTIONS:
                drawOptions(aEntryId.second);
                break;

            case SID_SM_EDITOPTIONS:
                mathOptions(aEntryId.second);
                break;

            case SID_SB_STARBASEOPTIONS:
                databaseOptions(aEntryId.second);
                break;

            case SID_SCH_EDITOPTIONS:
                chartOptions(aEntryId.second);
                break;

            case SID_INET_DLG:
                internetOptions(aEntryId.second);
                break;

            default:
                break;
        }
    }
}

void OfaTreeOptionsDialog::ApplyItemSets()
{
    std::unique_ptr<weld::TreeIter> xEntry = xTreeLB->make_iterator();
@@ -850,7 +1194,13 @@ void OfaTreeOptionsDialog::ActivateLastSelection()
    xTreeLB->scroll_to_row(*xEntry);
    xTreeLB->set_cursor(*xEntry);
    xTreeLB->select(*xEntry);
    xTreeLB->grab_focus();
    m_xSearchEdit->grab_focus();
    SelectHdl_Impl();

    /* initialize first 25 dialogs which are almost half of the dialogs
    in a row while Options dialog opens. then clear&reselect to avoid UI test failures. */
    initializeFirstNDialog(25);
    clearOptionsDialog();
    SelectHdl_Impl();
}

@@ -866,6 +1216,70 @@ void OfaTreeOptionsDialog::InitItemSets(OptionsGroupInfo& rGroupInfo)
            rGroupInfo.m_pInItemSet->GetRanges());
}

void OfaTreeOptionsDialog::initializeCurrentDialog(OptionsPageInfo*& pPageInfo,
                                                   std::unique_ptr<weld::TreeIter>& xEntry)
{
    std::unique_ptr<weld::TreeIter> xParent(xTreeLB->make_iterator(xEntry.get()));
    bool bParent = xTreeLB->iter_parent(*xParent);

    if (!bParent)
        return;

    if (pPageInfo->m_xPage)
    {
        TreeOptHelper::storeStringsOfDialog(pPageInfo->m_nPageId,
                                            pPageInfo->m_xPage->GetAllStrings());
        return;
    }

    OptionsGroupInfo* pGroupInfo = weld::fromId<OptionsGroupInfo*>(xTreeLB->get_id(*xParent));

    if (!pPageInfo->m_xPage && pPageInfo->m_nPageId > 0)
    {
        InitItemSets(*pGroupInfo);

        pPageInfo->m_xPage = ::CreateGeneralTabPage(pPageInfo->m_nPageId, xTabBox.get(), this,
                                                    *pGroupInfo->m_pInItemSet);

        if (!pPageInfo->m_xPage && pGroupInfo->m_pModule)
            pPageInfo->m_xPage = pGroupInfo->m_pModule->CreateTabPage(
                pPageInfo->m_nPageId, xTabBox.get(), this, *pGroupInfo->m_pInItemSet);

        DBG_ASSERT(pPageInfo->m_xPage, "tabpage could not created");
        if (pPageInfo->m_xPage)
        {
            SvtViewOptions aTabPageOpt(EViewType::TabPage, OUString::number(pPageInfo->m_nPageId));
            pPageInfo->m_xPage->SetUserData(GetViewOptUserItem(aTabPageOpt));
            pPageInfo->m_xPage->SetFrame(m_xFrame);
            pPageInfo->m_xPage->Reset(&*pGroupInfo->m_pInItemSet);
        }

        TreeOptHelper::storeStringsOfDialog(pPageInfo->m_nPageId,
                                            pPageInfo->m_xPage->GetAllStrings());

        pPageInfo->m_xPage->set_visible(false);
    }
    else if (0 == pPageInfo->m_nPageId && !pPageInfo->m_xExtPage)
    {
        if (!m_xContainerWinProvider.is())
            m_xContainerWinProvider
                = awt::ContainerWindowProvider::create(::comphelper::getProcessComponentContext());

        pPageInfo->m_xExtPage = std::make_unique<ExtensionsTabPage>(
            xTabBox.get(), pPageInfo->m_sPageURL, pPageInfo->m_sEventHdl, m_xContainerWinProvider);

        pPageInfo->m_xExtPage->Hide();
    }

    BuilderPage* pNewPage = pPageInfo->m_xPage.get();

    // fdo#58170 use current page's layout child HelpId, unless there isn't a current page
    OUString sHelpId(pNewPage ? pNewPage->GetHelpId() : OUString());
    if (sHelpId.isEmpty())
        sHelpId = HID_OFADLG_TREELISTBOX;
    xTreeLB->set_help_id(sHelpId);
}

void OfaTreeOptionsDialog::SelectHdl_Impl()
{
    std::unique_ptr<weld::TreeIter> xEntry(xTreeLB->make_iterator());
@@ -1307,15 +1721,12 @@ OUString OfaTreeOptionsDialog::getCurrentFactory_Impl( const Reference< XFrame >
    return sIdentifier;
}

void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
void OfaTreeOptionsDialog::generalOptions(const std::vector<sal_uInt16>& vPageId)
{
    m_xFrame = _xFrame;
    sal_uInt16 nGroup = 0;

    SvtOptionsDialogOptions aOptionsDlgOpt;
    sal_uInt16 nPageId;
    sal_uInt16 nPageId = 0;

    // %PRODUCTNAME options
    if ( !lcl_isOptionHidden( SID_GENERAL_OPTIONS, aOptionsDlgOpt ) )
    {
        setGroupName(u"ProductName", CuiResId(SID_GENERAL_OPTIONS_RES[0].first));
@@ -1351,11 +1762,23 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
                    continue;
            }

            AddTabPage( nPageId, sNewTitle, nGroup );
            if (vPageId.size() != 0)
            {
                if (std::find(vPageId.begin(), vPageId.end(), nPageId) != vPageId.end())
                    AddTabPage(nPageId, sNewTitle, nGroup);
            }
            else
                AddTabPage(nPageId, sNewTitle, nGroup);
        }
    }
}

    // Load and Save options
void OfaTreeOptionsDialog::loadAndSaveOptions(const std::vector<sal_uInt16>& vPageId)
{
    sal_uInt16 nGroup = 0;
    SvtOptionsDialogOptions aOptionsDlgOpt;
    sal_uInt16 nPageId = 0;

    if ( !lcl_isOptionHidden( SID_FILTER_DLG, aOptionsDlgOpt ) )
    {
        setGroupName( u"LoadSave", CuiResId(SID_FILTER_DLG_RES[0].first) );
@@ -1364,11 +1787,26 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
        {
            nPageId = static_cast<sal_uInt16>(SID_FILTER_DLG_RES[i].second);
            if ( !lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
                AddTabPage( nPageId, CuiResId(SID_FILTER_DLG_RES[i].first), nGroup );
            {
                if (vPageId.size() != 0)
                {
                    if (std::find(vPageId.begin(), vPageId.end(), nPageId) != vPageId.end())
                        AddTabPage(nPageId, CuiResId(SID_FILTER_DLG_RES[i].first), nGroup);
                }
                else
                    AddTabPage(nPageId, CuiResId(SID_FILTER_DLG_RES[i].first), nGroup);
            }
        }
    }
}

    // Language options
void OfaTreeOptionsDialog::languageOptions(const std::vector<sal_uInt16>& vPageId)
{
    sal_uInt16 nGroup = 0;
    SvtOptionsDialogOptions aOptionsDlgOpt;
    sal_uInt16 nPageId = 0;

    SvtCTLOptions aCTLLanguageOptions;
    if ( !lcl_isOptionHidden( SID_LANGUAGE_OPTIONS, aOptionsDlgOpt ) )
    {
        setGroupName(u"LanguageSettings", CuiResId(SID_LANGUAGE_OPTIONS_RES[0].first));
@@ -1389,14 +1827,28 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
            if ( ( RID_SVXPAGE_JSEARCH_OPTIONS != nPageId || SvtCJKOptions::IsJapaneseFindEnabled() ) &&
                 ( RID_SVXPAGE_ASIAN_LAYOUT != nPageId    || SvtCJKOptions::IsAsianTypographyEnabled() ) &&
                 ( RID_SVXPAGE_OPTIONS_CTL != nPageId     || SvtCTLOptions::IsCTLFontEnabled() ) )
                AddTabPage(nPageId, CuiResId(SID_LANGUAGE_OPTIONS_RES[i].first), nGroup);
            {
                if (vPageId.size() != 0)
                {
                    if (std::find(vPageId.begin(), vPageId.end(), nPageId) != vPageId.end())
                        AddTabPage(nPageId, CuiResId(SID_LANGUAGE_OPTIONS_RES[i].first), nGroup);
                }
                else
                    AddTabPage(nPageId, CuiResId(SID_LANGUAGE_OPTIONS_RES[i].first), nGroup);
            }
        }
    }
}

    OUString aFactory = getCurrentFactory_Impl( _xFrame );
    DBG_ASSERT( GetModuleIdentifier( _xFrame ) == aFactory, "S H I T!!!" );
void OfaTreeOptionsDialog::writerOptions(const std::vector<sal_uInt16>& vPageId)
{
    sal_uInt16 nGroup = 0;
    SvtOptionsDialogOptions aOptionsDlgOpt;
    sal_uInt16 nPageId = 0;

    // Writer and Writer/Web options
    OUString aFactory = getCurrentFactory_Impl( m_xFrame );
    DBG_ASSERT( GetModuleIdentifier( m_xFrame ) == aFactory, "S H I T!!!" );

    SvtModuleOptions aModuleOpt;
    if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::WRITER ) )
    {
@@ -1413,6 +1865,7 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
                else
                    setGroupName( u"Writer", CuiResId(SID_SW_EDITOPTIONS_RES[0].first) );
                nGroup = AddGroup(CuiResId(SID_SW_EDITOPTIONS_RES[0].first), pSwMod, pSwMod, SID_SW_EDITOPTIONS );
                SvtCTLOptions aCTLLanguageOptions;
                for ( size_t i = 1; i < std::size(SID_SW_EDITOPTIONS_RES); ++i )
                {
                    nPageId = static_cast<sal_uInt16>(SID_SW_EDITOPTIONS_RES[i].second);
@@ -1421,12 +1874,50 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
                    if ( ( RID_SW_TP_STD_FONT_CJK != nPageId || SvtCJKOptions::IsCJKFontEnabled() ) &&
                         ( RID_SW_TP_STD_FONT_CTL != nPageId || SvtCTLOptions::IsCTLFontEnabled() ) &&
                         ( RID_SW_TP_MAILCONFIG != nPageId || MailMergeCfgIsEmailSupported() ) )
                        AddTabPage( nPageId, CuiResId(SID_SW_EDITOPTIONS_RES[i].first), nGroup );
                    {
                        if (vPageId.size() != 0)
                        {
                            if (std::find(vPageId.begin(), vPageId.end(), nPageId) != vPageId.end())
                                AddTabPage(nPageId, CuiResId(SID_SW_EDITOPTIONS_RES[i].first),
                                           nGroup);
                        }
                        else
                            AddTabPage(nPageId, CuiResId(SID_SW_EDITOPTIONS_RES[i].first), nGroup);
                    }
                }
#ifdef DBG_UTIL
                AddTabPage( RID_SW_TP_OPTTEST_PAGE, "Internal Test", nGroup );
                if (vPageId.size() != 0)
                {
                    if (std::find(vPageId.begin(), vPageId.end(), RID_SW_TP_OPTTEST_PAGE)
                        != vPageId.end())
                        AddTabPage(RID_SW_TP_OPTTEST_PAGE, "Internal Test", nGroup);
                }
                else
                    AddTabPage(RID_SW_TP_OPTTEST_PAGE, "Internal Test", nGroup);
#endif
            }
        }
    }
}

void OfaTreeOptionsDialog::writerWebOptions(const std::vector<sal_uInt16>& vPageId)
{
    sal_uInt16 nGroup = 0;
    SvtOptionsDialogOptions aOptionsDlgOpt;
    sal_uInt16 nPageId = 0;

    OUString aFactory = getCurrentFactory_Impl( m_xFrame );
    DBG_ASSERT( GetModuleIdentifier( m_xFrame ) == aFactory, "S H I T!!!" );

    SvtModuleOptions aModuleOpt;
    if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::WRITER ) )
    {
        // text document
        if (   aFactory == "com.sun.star.text.TextDocument"
            || aFactory == "com.sun.star.text.WebDocument"
            || aFactory == "com.sun.star.text.GlobalDocument" )
        {
            SfxModule* pSwMod = SfxApplication::GetModule(SfxToolsModule::Writer);

            // HTML documents
            if ( !lcl_isOptionHidden( SID_SW_ONLINEOPTIONS, aOptionsDlgOpt ) )
@@ -1436,15 +1927,43 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
                {
                    nPageId = static_cast<sal_uInt16>(SID_SW_ONLINEOPTIONS_RES[i].second);
                    if ( !lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
                        AddTabPage(nPageId, CuiResId(SID_SW_ONLINEOPTIONS_RES[i].first), nGroup);
                    {
                        if (vPageId.size() != 0)
                        {
                            if (std::find(vPageId.begin(), vPageId.end(), nPageId) != vPageId.end())
                                AddTabPage(nPageId, CuiResId(SID_SW_ONLINEOPTIONS_RES[i].first),
                                           nGroup);
                        }
                        else
                            AddTabPage(nPageId, CuiResId(SID_SW_ONLINEOPTIONS_RES[i].first),
                                       nGroup);
                    }
                }
#ifdef DBG_UTIL
                AddTabPage( RID_SW_TP_OPTTEST_PAGE, "Internal Test", nGroup );
                if (vPageId.size() != 0)
                {
                    if (std::find(vPageId.begin(), vPageId.end(), RID_SW_TP_OPTTEST_PAGE)
                        != vPageId.end())
                        AddTabPage(RID_SW_TP_OPTTEST_PAGE, "Internal Test", nGroup);
                }
                else
                    AddTabPage(RID_SW_TP_OPTTEST_PAGE, "Internal Test", nGroup);
#endif
            }
        }
    }
}

void OfaTreeOptionsDialog::calcOptions(const std::vector<sal_uInt16>& vPageId)
{
    sal_uInt16 nGroup = 0;
    SvtOptionsDialogOptions aOptionsDlgOpt;
    sal_uInt16 nPageId = 0;

    OUString aFactory = getCurrentFactory_Impl( m_xFrame );
    DBG_ASSERT( GetModuleIdentifier( m_xFrame ) == aFactory, "S H I T!!!" );

    SvtModuleOptions aModuleOpt;
    // Calc options
    if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::CALC ) )
    {
@@ -1462,11 +1981,28 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
                    if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
                        continue;

                    AddTabPage( nPageId, CuiResId(SID_SC_EDITOPTIONS_RES[i].first), nGroup );
                    if (vPageId.size() != 0)
                    {
                        if (std::find(vPageId.begin(), vPageId.end(), nPageId) != vPageId.end())
                            AddTabPage(nPageId, CuiResId(SID_SC_EDITOPTIONS_RES[i].first), nGroup);
                    }
                    else
                        AddTabPage(nPageId, CuiResId(SID_SC_EDITOPTIONS_RES[i].first), nGroup);
                }
            }
        }
    }
}

void OfaTreeOptionsDialog::impressOptions(const std::vector<sal_uInt16>& vPageId)
{
    sal_uInt16 nGroup = 0;
    SvtOptionsDialogOptions aOptionsDlgOpt;
    sal_uInt16 nPageId = 0;

    OUString aFactory = getCurrentFactory_Impl( m_xFrame );
    DBG_ASSERT( GetModuleIdentifier( m_xFrame ) == aFactory, "S H I T!!!" );
    SvtModuleOptions aModuleOpt;

    // Impress options
    SfxModule* pSdMod = SfxApplication::GetModule( SfxToolsModule::Draw );
@@ -1485,13 +2021,31 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
                    if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
                        continue;

                    AddTabPage( nPageId, CuiResId(SID_SD_EDITOPTIONS_RES[i].first), nGroup );
                    if (vPageId.size() != 0)
                    {
                        if (std::find(vPageId.begin(), vPageId.end(), nPageId) != vPageId.end())
                            AddTabPage(nPageId, CuiResId(SID_SD_EDITOPTIONS_RES[i].first), nGroup);
                    }
                    else
                        AddTabPage(nPageId, CuiResId(SID_SD_EDITOPTIONS_RES[i].first), nGroup);
                }
            }
        }
    }
}

void OfaTreeOptionsDialog::drawOptions(const std::vector<sal_uInt16>& vPageId)
{
    sal_uInt16 nGroup = 0;
    SvtOptionsDialogOptions aOptionsDlgOpt;
    sal_uInt16 nPageId = 0;

    OUString aFactory = getCurrentFactory_Impl( m_xFrame );
    DBG_ASSERT( GetModuleIdentifier( m_xFrame ) == aFactory, "S H I T!!!" );
    SvtModuleOptions aModuleOpt;

    // Draw options
    SfxModule* pSdMod = SfxApplication::GetModule(SfxToolsModule::Draw);
    if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::DRAW ) )
    {
        if ( aFactory == "com.sun.star.drawing.DrawingDocument" )
@@ -1507,11 +2061,29 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
                    if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
                        continue;

                    AddTabPage( nPageId, CuiResId(SID_SD_GRAPHIC_OPTIONS_RES[i].first), nGroup );
                    if (vPageId.size() != 0)
                    {
                        if (std::find(vPageId.begin(), vPageId.end(), nPageId) != vPageId.end())
                            AddTabPage(nPageId, CuiResId(SID_SD_GRAPHIC_OPTIONS_RES[i].first),
                                       nGroup);
                    }
                    else
                        AddTabPage(nPageId, CuiResId(SID_SD_GRAPHIC_OPTIONS_RES[i].first), nGroup);
                }
            }
        }
    }
}

void OfaTreeOptionsDialog::mathOptions(const std::vector<sal_uInt16>& vPageId)
{
    sal_uInt16 nGroup = 0;
    SvtOptionsDialogOptions aOptionsDlgOpt;
    sal_uInt16 nPageId = 0;

    OUString aFactory = getCurrentFactory_Impl( m_xFrame );
    DBG_ASSERT( GetModuleIdentifier( m_xFrame ) == aFactory, "S H I T!!!" );
    SvtModuleOptions aModuleOpt;

    // Math options
    if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::MATH ) )
@@ -1527,11 +2099,29 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
                {
                    nPageId = static_cast<sal_uInt16>(SID_SM_EDITOPTIONS_RES[i].second);
                    if ( !lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
                        AddTabPage( nPageId, CuiResId(SID_SM_EDITOPTIONS_RES[i].first), nGroup );
                    {
                        if (vPageId.size() != 0)
                        {
                            if (std::find(vPageId.begin(), vPageId.end(), nPageId) != vPageId.end())
                                AddTabPage(nPageId, CuiResId(SID_SM_EDITOPTIONS_RES[i].first),
                                           nGroup);
                        }
                        else
                            AddTabPage(nPageId, CuiResId(SID_SM_EDITOPTIONS_RES[i].first), nGroup);
                    }
                }
            }
        }
    }
}

void OfaTreeOptionsDialog::databaseOptions(const std::vector<sal_uInt16>& vPageId)
{
    sal_uInt16 nGroup = 0;
    SvtOptionsDialogOptions aOptionsDlgOpt;
    sal_uInt16 nPageId = 0;

    SvtModuleOptions aModuleOpt;

    // Database - needed only if there is an application which integrates with databases
    if ( !lcl_isOptionHidden( SID_SB_STARBASEOPTIONS, aOptionsDlgOpt ) &&
@@ -1546,11 +2136,25 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
        {
            nPageId = static_cast<sal_uInt16>(SID_SB_STARBASEOPTIONS_RES[i].second);
            if ( !lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
                AddTabPage( nPageId, CuiResId(SID_SB_STARBASEOPTIONS_RES[i].first), nGroup );
            {
                if (vPageId.size() != 0)
                {
                    if (std::find(vPageId.begin(), vPageId.end(), nPageId) != vPageId.end())
                        AddTabPage(nPageId, CuiResId(SID_SB_STARBASEOPTIONS_RES[i].first), nGroup);
                }
                else
                    AddTabPage(nPageId, CuiResId(SID_SB_STARBASEOPTIONS_RES[i].first), nGroup);
            }
        }
    }
}

    // Chart options (always installed and active)
void OfaTreeOptionsDialog::chartOptions(const std::vector<sal_uInt16>& vPageId)
{
    sal_uInt16 nGroup = 0;
    SvtOptionsDialogOptions aOptionsDlgOpt;
    sal_uInt16 nPageId = 0;

    if ( !lcl_isOptionHidden( SID_SCH_EDITOPTIONS, aOptionsDlgOpt ) )
    {
        setGroupName( u"Charts", CuiResId(SID_SCH_EDITOPTIONS_RES[0].first) );
@@ -1559,11 +2163,25 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
        {
            nPageId = static_cast<sal_uInt16>(SID_SCH_EDITOPTIONS_RES[i].second);
            if ( !lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
               AddTabPage( nPageId, CuiResId(SID_SCH_EDITOPTIONS_RES[i].first), nGroup );
            {
                if (vPageId.size() != 0)
                {
                    if (std::find(vPageId.begin(), vPageId.end(), nPageId) != vPageId.end())
                        AddTabPage(nPageId, CuiResId(SID_SCH_EDITOPTIONS_RES[i].first), nGroup);
                }
                else
                    AddTabPage(nPageId, CuiResId(SID_SCH_EDITOPTIONS_RES[i].first), nGroup);
            }
        }
    }
}

    // Internet options
void OfaTreeOptionsDialog::internetOptions(const std::vector<sal_uInt16>& vPageId)
{
    sal_uInt16 nGroup = 0;
    SvtOptionsDialogOptions aOptionsDlgOpt;
    sal_uInt16 nPageId = 0;

    if ( lcl_isOptionHidden( SID_INET_DLG, aOptionsDlgOpt ) )
        return;

@@ -1580,10 +2198,59 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
        if ( nPageId == RID_SVXPAGE_INET_MAIL )
            continue;
#endif
        AddTabPage( nPageId, CuiResId(SID_INET_DLG_RES[i].first), nGroup );
        if (vPageId.size() != 0)
        {
            if (std::find(vPageId.begin(), vPageId.end(), nPageId) != vPageId.end())
                AddTabPage(nPageId, CuiResId(SID_INET_DLG_RES[i].first), nGroup);
        }
        else
            AddTabPage(nPageId, CuiResId(SID_INET_DLG_RES[i].first), nGroup);
    }
}

void OfaTreeOptionsDialog::Initialize(const Reference<XFrame>& _xFrame)
{
    m_xFrame = _xFrame;

    // %PRODUCTNAME options
    generalOptions();

    // Load and Save options
    loadAndSaveOptions();

    // Language options
    languageOptions();

    // Writer and Writer/Web options
    writerOptions();
    writerWebOptions();

    // Calc options
    calcOptions();

    // Impress options
    impressOptions();

    // Draw options
    drawOptions();

    // Math options
    mathOptions();

    // Database - needed only if there is an application which integrates with databases
    databaseOptions();

    // Chart options (always installed and active)
    chartOptions();

    // Internet options
    internetOptions();

    // store Options Dialogs with their page names and strings
    // in order to use them when searching
    storeOptionsTree();
}

static bool isNodeActive( OptionsNode const * pNode, Module* pModule )
{
    if ( !pNode )
diff --git a/cui/source/options/treeopthelper.cxx b/cui/source/options/treeopthelper.cxx
new file mode 100644
index 0000000..e486dbb
--- /dev/null
+++ b/cui/source/options/treeopthelper.cxx
@@ -0,0 +1,184 @@
/* -*- 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/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */

#include <fstream>
#include <treeopt.hxx>

#include <treeopt.hrc>
#include <helpids.h>
#include <svx/dialogs.hrc>
#include <svx/svxids.hrc>

namespace
{
struct PageIdToFileNameMap_Impl
{
    sal_uInt16 m_nPageId;
    OUString m_sContent;
};
}

static PageIdToFileNameMap_Impl FileMap_Impl[] = {

    // { PAGE-ID, CONTENT },

    // ProductName, SID_GENERAL_OPTIONS
    { RID_SFXPAGE_GENERAL, "" }, // UserData

    { OFA_TP_MISC, "" }, // General

    { OFA_TP_VIEW, "" }, // View

    { RID_SFXPAGE_PRINTOPTIONS, "" }, // Print

    { RID_SFXPAGE_PATH, "" }, // Paths

    { RID_SVX_FONT_SUBSTITUTION, "" }, // Fonts

    { RID_SVXPAGE_INET_SECURITY, "" }, // Security

    { RID_SVXPAGE_PERSONALIZATION, "" }, // Personalization
    { RID_SVXPAGE_COLORCONFIG, "" }, // ApplicationColors
    { RID_SVXPAGE_ACCESSIBILITYCONFIG, "" }, // Accessibility
    { RID_SVXPAGE_OPTIONS_JAVA, "" }, // Java
    { RID_SVXPAGE_BASICIDE_OPTIONS, "" }, // BasicIDEOptions
    { RID_SVXPAGE_ONLINEUPDATE, "" }, // OnlineUpdate
    { RID_SVXPAGE_OPENCL, "" }, // OpenCL

    // LanguageSettings, SID_LANGUAGE_OPTIONS
    { OFA_TP_LANGUAGES, "" }, // Languages
    { RID_SFXPAGE_LINGU, "" }, // WritingAids
    { RID_SVXPAGE_JSEARCH_OPTIONS, "" }, // SearchingInJapanese
    { RID_SVXPAGE_ASIAN_LAYOUT, "" }, // AsianLayout
    { RID_SVXPAGE_OPTIONS_CTL, "" }, // ComplexTextLayout
    { RID_SVXPAGE_LANGTOOL_OPTIONS, "" }, // LanguageTool Server
    { RID_SVXPAGE_DEEPL_OPTIONS, "" }, // DeepL Server

    // Internet, SID_INET_DLG
    { RID_SVXPAGE_INET_PROXY, "" }, // Proxy
    { RID_SVXPAGE_INET_MAIL, "" }, // Email

    // Load/Save, SID_FILTER_DLG
    { RID_SFXPAGE_SAVE, "" }, // General
    { SID_OPTFILTER_MSOFFICE, "" }, // VBA Properties
    { RID_OFAPAGE_MSFILTEROPT2, "" }, // Microsoft Office
    { RID_OFAPAGE_HTMLOPT, "" }, // HTML Compatibility

    // Writer, SID_SW_EDITOPTIONS
    { RID_SW_TP_OPTLOAD_PAGE, "" }, // General
    { RID_SW_TP_CONTENT_OPT, "" }, // View
    { RID_SW_TP_OPTSHDWCRSR, "" }, // FormattingAids
    { RID_SVXPAGE_GRID, "" }, // Grid
    { RID_SW_TP_STD_FONT, "" }, // BasicFontsWestern
    { RID_SW_TP_STD_FONT_CJK, "" }, // BasicFontsAsian
    { RID_SW_TP_STD_FONT_CTL, "" }, // BasicFontsCTL
    { RID_SW_TP_OPTPRINT_PAGE, "" }, // Print
    { RID_SW_TP_OPTTABLE_PAGE, "" }, // Table
    { RID_SW_TP_REDLINE_OPT, "" }, // Changes
    { RID_SW_TP_COMPARISON_OPT, "" }, // Comparison
    { RID_SW_TP_OPTCOMPATIBILITY_PAGE, "" }, // Compatibility
    { RID_SW_TP_OPTCAPTION_PAGE, "" }, // AutoCaption
    { RID_SW_TP_MAILCONFIG, "" }, // MailMerge
    { RID_SW_TP_OPTTEST_PAGE, "" }, // Internal Test (only in dev build)

    // WriterWeb, SID_SW_ONLINEOPTIONS
    { RID_SW_TP_HTML_CONTENT_OPT, "" }, // View
    { RID_SW_TP_HTML_OPTSHDWCRSR, "" }, // FormattingAids
    { RID_SW_TP_HTML_OPTGRID_PAGE, "" }, // Grid
    { RID_SW_TP_HTML_OPTPRINT_PAGE, "" }, // Print
    { RID_SW_TP_HTML_OPTTABLE_PAGE, "" }, // Table
    { RID_SW_TP_BACKGROUND, "" }, // Background
    { RID_SW_TP_OPTTEST_PAGE, "" }, // Internal Test (only in dev build)

    // Math, SID_SM_EDITOPTIONS
    { SID_SM_TP_PRINTOPTIONS, "" }, // Settings

    // Calc, SID_SC_EDITOPTIONS
    { SID_SC_TP_LAYOUT, "" }, // General
    { RID_SC_TP_DEFAULTS, "" }, // Defaults
    { SID_SC_TP_CONTENT, "" }, // View
    { SID_SC_TP_CALC, "" }, // Calculate
    { SID_SC_TP_FORMULA, "" }, // Formula
    { SID_SC_TP_USERLISTS, "" }, // SortLists
    { SID_SC_TP_CHANGES, "" }, // Changes
    { SID_SC_TP_COMPATIBILITY, "" }, // Compatibility
    { SID_SC_TP_GRID, "" }, // Grid
    { RID_SC_TP_PRINT, "" }, // Print

    // Impress, SID_SD_EDITOPTIONS
    { SID_SI_TP_MISC, "" }, // General
    { SID_SI_TP_CONTENTS, "" }, // View
    { SID_SI_TP_SNAP, "" }, // Grid
    { SID_SI_TP_PRINT, "" }, // Print

    // Draw, SID_SD_GRAPHIC_OPTIONS
    { SID_SD_TP_MISC, "" }, // General
    { SID_SD_TP_CONTENTS, "" }, // View
    { SID_SD_TP_SNAP, "" }, // Grid
    { SID_SD_TP_PRINT, "" }, // Print

    // Charts, SID_SCH_EDITOPTIONS
    { RID_OPTPAGE_CHART_DEFCOLORS, "" }, // DefaultColor

    // Base, SID_SB_STARBASEOPTIONS
    { SID_SB_CONNECTIONPOOLING, "" }, // Connections
    { SID_SB_DBREGISTEROPTIONS, "" } // Databases
};

void TreeOptHelper::storeStringsOfDialog(sal_uInt16 nPageId, const OUString& sPageStrings)
{
    for (PageIdToFileNameMap_Impl& rEntry : FileMap_Impl)
    {
        if (rEntry.m_nPageId == nPageId)
        {
            rEntry.m_sContent = sPageStrings.replaceAll("~", "");
            break;
        }
    }
}

/*
return the strings of:
- labels,
- check buttons,
- radio buttons,
- toggle buttons,
- link buttons,
- buttons

TODO:
- accessible-names
- accessible-descriptions
- tooltip-texts
*/
OUString TreeOptHelper::getStringsFromDialog(sal_uInt16 nPageId)
{
    if (nPageId == 0)
        return OUString();

    for (PageIdToFileNameMap_Impl& rEntry : FileMap_Impl)
    {
        if (rEntry.m_nPageId == nPageId)
            return rEntry.m_sContent;
    }

    return OUString();
}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx
index d1ece1c..23946aa 100644
--- a/cui/source/tabpages/tparea.cxx
+++ b/cui/source/tabpages/tparea.cxx
@@ -281,6 +281,18 @@ bool SvxAreaTabPage::FillItemSet_Impl( SfxItemSet* rAttrs)
    return static_cast<TTabPage&>( *m_xFillTabPage ).FillItemSet( rAttrs );
}

OUString SvxAreaTabPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString toggleButton[] = { "btnnone",    "btncolor", "btngradient",     "btnbitmap",
                                "btnpattern", "btnhatch", "btnusebackground" };

    for (const auto& toggle : toggleButton)
        sAllStrings += m_xBuilder->weld_toggle_button(toggle)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool SvxAreaTabPage::FillItemSet( SfxItemSet* rAttrs )
{
    FillType eFillType = static_cast<FillType>(maBox.GetCurrentButtonPos());
diff --git a/cui/uiconfig/ui/optionsdialog.ui b/cui/uiconfig/ui/optionsdialog.ui
index 33b1b99..06fe416 100644
--- a/cui/uiconfig/ui/optionsdialog.ui
+++ b/cui/uiconfig/ui/optionsdialog.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.38.2 -->
<!-- Generated with glade 3.40.0 -->
<interface domain="cui">
  <requires lib="gtk+" version="3.20"/>
  <object class="GtkTreeStore" id="liststore1">
@@ -137,37 +137,72 @@
            <property name="vexpand">True</property>
            <property name="spacing">6</property>
            <child>
              <object class="GtkScrolledWindow">
              <object class="GtkBox" id="box3">
                <property name="visible">True</property>
                <property name="can-focus">True</property>
                <property name="can-focus">False</property>
                <property name="vexpand">True</property>
                <property name="shadow-type">in</property>
                <property name="orientation">vertical</property>
                <property name="spacing">4</property>
                <child>
                  <object class="GtkTreeView" id="pages">
                    <property name="width-request">-1</property>
                  <object class="GtkEntry" id="searchEntry">
                    <property name="visible">True</property>
                    <property name="can-focus">True</property>
                    <property name="receives-default">True</property>
                    <property name="vexpand">True</property>
                    <property name="model">liststore1</property>
                    <property name="headers-visible">False</property>
                    <property name="search-column">0</property>
                    <property name="enable-tree-lines">True</property>
                    <child internal-child="selection">
                      <object class="GtkTreeSelection" id="Macro Library List-selection1"/>
                    <property name="valign">start</property>
                    <property name="truncate-multiline">True</property>
                    <property name="placeholder-text">Type to search</property>
                    <child internal-child="accessible">
                      <object class="AtkObject" id="searchEntry-atkobject">
                        <property name="AtkObject::accessible-description">Type here to search in the list of options.</property>
                      </object>
                    </child>
                  </object>
                  <packing>
                    <property name="expand">False</property>
                    <property name="fill">True</property>
                    <property name="position">0</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkScrolledWindow">
                    <property name="visible">True</property>
                    <property name="can-focus">True</property>
                    <property name="halign">baseline</property>
                    <property name="valign">baseline</property>
                    <property name="vexpand">True</property>
                    <property name="shadow-type">in</property>
                    <child>
                      <object class="GtkTreeViewColumn" id="treeviewcolumn2">
                        <property name="spacing">6</property>
                      <object class="GtkTreeView" id="pages">
                        <property name="width-request">-1</property>
                        <property name="visible">True</property>
                        <property name="can-focus">True</property>
                        <property name="receives-default">True</property>
                        <property name="vexpand">True</property>
                        <property name="model">liststore1</property>
                        <property name="headers-visible">False</property>
                        <property name="search-column">0</property>
                        <property name="enable-tree-lines">True</property>
                        <child internal-child="selection">
                          <object class="GtkTreeSelection"/>
                        </child>
                        <child>
                          <object class="GtkCellRendererText" id="cellrenderertext2"/>
                          <attributes>
                            <attribute name="text">0</attribute>
                          </attributes>
                          <object class="GtkTreeViewColumn" id="treeviewcolumn2">
                            <property name="spacing">6</property>
                            <child>
                              <object class="GtkCellRendererText" id="cellrenderertext2"/>
                              <attributes>
                                <attribute name="text">0</attribute>
                              </attributes>
                            </child>
                          </object>
                        </child>
                      </object>
                    </child>
                  </object>
                  <packing>
                    <property name="expand">False</property>
                    <property name="fill">True</property>
                    <property name="position">1</property>
                  </packing>
                </child>
              </object>
              <packing>
diff --git a/include/sfx2/printopt.hxx b/include/sfx2/printopt.hxx
index 2cc4b0a..a251616 100644
--- a/include/sfx2/printopt.hxx
+++ b/include/sfx2/printopt.hxx
@@ -74,6 +74,9 @@ public:

    SfxCommonPrintOptionsTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
    virtual             ~SfxCommonPrintOptionsTabPage() override;

    virtual OUString GetAllStrings() override;

    virtual bool        FillItemSet( SfxItemSet* rSet ) override;
    virtual void        Reset( const SfxItemSet* rSet ) override;

diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx
index f43df12..1b2bbad 100644
--- a/include/sfx2/tabdlg.hxx
+++ b/include/sfx2/tabdlg.hxx
@@ -266,6 +266,7 @@ public:
        return static_cast<const T*>(GetItem(rSet, sal_uInt16(nSlot), bDeep));
    }

    virtual OUString GetAllStrings();
    void SetFrame(const css::uno::Reference< css::frame::XFrame >& xFrame);
    css::uno::Reference< css::frame::XFrame > GetFrame() const;

diff --git a/include/svx/optgrid.hxx b/include/svx/optgrid.hxx
index 97ec7a2..223f2da 100644
--- a/include/svx/optgrid.hxx
+++ b/include/svx/optgrid.hxx
@@ -94,6 +94,8 @@ public:

    static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rAttrSet);

    virtual OUString GetAllStrings() override;

    virtual bool        FillItemSet( SfxItemSet* rSet ) override;
    virtual void        Reset( const SfxItemSet* rSet ) override;

diff --git a/sc/source/ui/inc/opredlin.hxx b/sc/source/ui/inc/opredlin.hxx
index e26591e..4cd5660 100644
--- a/sc/source/ui/inc/opredlin.hxx
+++ b/sc/source/ui/inc/opredlin.hxx
@@ -34,6 +34,8 @@ public:
    static std::unique_ptr<SfxTabPage>  Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet );
    virtual ~ScRedlineOptionsTabPage() override;

    virtual OUString GetAllStrings() override;

    virtual bool        FillItemSet( SfxItemSet* rSet ) override;
    virtual void        Reset( const SfxItemSet* rSet ) override;
};
diff --git a/sc/source/ui/inc/tpcalc.hxx b/sc/source/ui/inc/tpcalc.hxx
index 558eec3..87b4f90 100644
--- a/sc/source/ui/inc/tpcalc.hxx
+++ b/sc/source/ui/inc/tpcalc.hxx
@@ -30,6 +30,9 @@ public:
    ScTpCalcOptions(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet&  rCoreSet);
    static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rCoreSet);
    virtual ~ScTpCalcOptions() override;

    virtual OUString GetAllStrings() override;

    virtual bool        FillItemSet     ( SfxItemSet* rCoreSet ) override;
    virtual void        Reset           ( const SfxItemSet* rCoreSet ) override;
    virtual DeactivateRC   DeactivatePage  ( SfxItemSet* pSet ) override;
diff --git a/sc/source/ui/inc/tpcompatibility.hxx b/sc/source/ui/inc/tpcompatibility.hxx
index 942564f..4efdbc1 100644
--- a/sc/source/ui/inc/tpcompatibility.hxx
+++ b/sc/source/ui/inc/tpcompatibility.hxx
@@ -18,6 +18,8 @@ public:
    static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rCoreAttrs);
    virtual ~ScTpCompatOptions() override;

    virtual OUString GetAllStrings() override;

    virtual bool FillItemSet(SfxItemSet* rCoreAttrs) override;
    virtual void Reset(const SfxItemSet* rCoreAttrs) override;
    virtual DeactivateRC DeactivatePage(SfxItemSet* pSet ) override;
diff --git a/sc/source/ui/inc/tpdefaults.hxx b/sc/source/ui/inc/tpdefaults.hxx
index cabcf57..76ad8fc 100644
--- a/sc/source/ui/inc/tpdefaults.hxx
+++ b/sc/source/ui/inc/tpdefaults.hxx
@@ -18,6 +18,8 @@ public:
    static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rCoreSet);
    virtual ~ScTpDefaultsOptions() override;

    virtual OUString GetAllStrings() override;

    virtual bool FillItemSet(SfxItemSet* rCoreSet) override;
    virtual void Reset(const SfxItemSet* rCoreSet) override;
    virtual DeactivateRC DeactivatePage(SfxItemSet* pSet) override;
diff --git a/sc/source/ui/inc/tpformula.hxx b/sc/source/ui/inc/tpformula.hxx
index f920c7b..14a72b7 100644
--- a/sc/source/ui/inc/tpformula.hxx
+++ b/sc/source/ui/inc/tpformula.hxx
@@ -33,6 +33,8 @@ public:
    Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rCoreSet);
    virtual ~ScTpFormulaOptions() override;

    virtual OUString GetAllStrings() override;

    virtual bool FillItemSet(SfxItemSet* rCoreSet) override;
    virtual void Reset(const SfxItemSet* rCoreSet) override;
    virtual DeactivateRC DeactivatePage(SfxItemSet* pSet) override;
diff --git a/sc/source/ui/inc/tpprint.hxx b/sc/source/ui/inc/tpprint.hxx
index 09e78eb..3dc7d36 100644
--- a/sc/source/ui/inc/tpprint.hxx
+++ b/sc/source/ui/inc/tpprint.hxx
@@ -32,6 +32,8 @@ public:
    static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rCoreSet );
    virtual ~ScTpPrintOptions() override;

    virtual OUString GetAllStrings() override;

    virtual bool        FillItemSet( SfxItemSet* rCoreSet ) override;
    virtual void        Reset( const SfxItemSet* rCoreSet ) override;
    virtual DeactivateRC   DeactivatePage( SfxItemSet* pSet ) override;
diff --git a/sc/source/ui/inc/tpusrlst.hxx b/sc/source/ui/inc/tpusrlst.hxx
index ead6ee6..96d75ec 100644
--- a/sc/source/ui/inc/tpusrlst.hxx
+++ b/sc/source/ui/inc/tpusrlst.hxx
@@ -33,6 +33,9 @@ public:
    static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController,
                                          const SfxItemSet* rAttrSet);
    virtual ~ScTpUserLists() override;

    virtual OUString GetAllStrings() override;

    virtual bool        FillItemSet     ( SfxItemSet* rCoreAttrs ) override;
    virtual void        Reset           ( const SfxItemSet* rCoreAttrs ) override;
    virtual DeactivateRC   DeactivatePage  ( SfxItemSet* pSet ) override;
diff --git a/sc/source/ui/inc/tpview.hxx b/sc/source/ui/inc/tpview.hxx
index bce6fc2..65aed43 100644
--- a/sc/source/ui/inc/tpview.hxx
+++ b/sc/source/ui/inc/tpview.hxx
@@ -64,6 +64,9 @@ public:
    ScTpContentOptions(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rArgSet);
    static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rCoreSet);
    virtual ~ScTpContentOptions() override;

    virtual OUString GetAllStrings() override;

    virtual bool        FillItemSet     ( SfxItemSet* rCoreSet ) override;
    virtual void        Reset           ( const SfxItemSet* rCoreSet ) override;
    virtual void        ActivatePage( const SfxItemSet& ) override;
@@ -103,6 +106,9 @@ public:
    static  std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController,
                                          const SfxItemSet* rCoreSet);
    virtual ~ScTpLayoutOptions() override;

    virtual OUString GetAllStrings() override;

    virtual bool        FillItemSet     ( SfxItemSet* rCoreSet ) override;
    virtual void        Reset           ( const SfxItemSet* rCoreSet ) override;
    virtual void        ActivatePage( const SfxItemSet& ) override;
diff --git a/sc/source/ui/optdlg/opredlin.cxx b/sc/source/ui/optdlg/opredlin.cxx
index 963ea1b..4bce858 100644
--- a/sc/source/ui/optdlg/opredlin.cxx
+++ b/sc/source/ui/optdlg/opredlin.cxx
@@ -58,6 +58,17 @@ std::unique_ptr<SfxTabPage> ScRedlineOptionsTabPage::Create( weld::Container* pP
    return std::make_unique<ScRedlineOptionsTabPage>( pPage, pController, *rSet );
}

OUString ScRedlineOptionsTabPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label1", "label2", "label3", "label4", "label5" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool ScRedlineOptionsTabPage::FillItemSet( SfxItemSet* /* rSet */ )
{
    ScAppOptions aAppOptions=SC_MOD()->GetAppOptions();
diff --git a/sc/source/ui/optdlg/tpcalc.cxx b/sc/source/ui/optdlg/tpcalc.cxx
index ae76704..1188f25 100644
--- a/sc/source/ui/optdlg/tpcalc.cxx
+++ b/sc/source/ui/optdlg/tpcalc.cxx
@@ -159,6 +159,30 @@ void ScTpCalcOptions::Reset(const SfxItemSet* rCoreAttrs)
    CheckClickHdl(*m_xBtnIterate);
}

OUString ScTpCalcOptions::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[]
        = { "label5", "label1", "precft", "label2", "stepsft", "minchangeft", "label4", "label3" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString checkButton[]
        = { "case", "calc", "match", "lookup", "generalprec", "iterate", "threadingenabled" };

    for (const auto& check : checkButton)
        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";

    OUString radioButton[] = { "formulawildcards", "formularegex", "formulaliteral",
                               "datestd",          "datesc10",     "date1904" };

    for (const auto& radio : radioButton)
        sAllStrings += m_xBuilder->weld_radio_button(radio)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool ScTpCalcOptions::FillItemSet( SfxItemSet* rCoreAttrs )
{
    // every other options are updated in handlers
diff --git a/sc/source/ui/optdlg/tpcompatibility.cxx b/sc/source/ui/optdlg/tpcompatibility.cxx
index a9333e3..d7f6269 100644
--- a/sc/source/ui/optdlg/tpcompatibility.cxx
+++ b/sc/source/ui/optdlg/tpcompatibility.cxx
@@ -32,6 +32,19 @@ std::unique_ptr<SfxTabPage> ScTpCompatOptions::Create(weld::Container* pPage, we
    return std::make_unique<ScTpCompatOptions>(pPage, pController, *rCoreAttrs);
}

OUString ScTpCompatOptions::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label1", "label2" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    // id "keybindings" GtkComboBoxText is not included

    return sAllStrings.replaceAll("_", "");
}

bool ScTpCompatOptions::FillItemSet(SfxItemSet *rCoreAttrs)
{
    bool bRet = false;
diff --git a/sc/source/ui/optdlg/tpdefaults.cxx b/sc/source/ui/optdlg/tpdefaults.cxx
index 6e4d8dc..275da4e 100644
--- a/sc/source/ui/optdlg/tpdefaults.cxx
+++ b/sc/source/ui/optdlg/tpdefaults.cxx
@@ -40,6 +40,19 @@ std::unique_ptr<SfxTabPage> ScTpDefaultsOptions::Create(weld::Container* pPage, 
    return std::make_unique<ScTpDefaultsOptions>(pPage, pController, *rCoreAttrs);
}

OUString ScTpDefaultsOptions::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label1", "textsheetsnumber", "textsheetprefix" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    sAllStrings += m_xEdJumboSheets->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool ScTpDefaultsOptions::FillItemSet(SfxItemSet *rCoreSet)
{
    bool bRet = false;
diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx
index 1d894ff..6313060 100644
--- a/sc/source/ui/optdlg/tpformula.cxx
+++ b/sc/source/ui/optdlg/tpformula.cxx
@@ -258,6 +258,34 @@ std::unique_ptr<SfxTabPage> ScTpFormulaOptions::Create(weld::Container* pPage, w
    return std::make_unique<ScTpFormulaOptions>(pPage, pController, *rCoreSet);
}

OUString ScTpFormulaOptions::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label1", "formulasyntaxlabel",
                          "label3", "label6",
                          "label7", "label8",
                          "label2", "label4",
                          "label9", "label10" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString radioButton[] = { "calcdefault", "calccustom" };

    for (const auto& radio : radioButton)
        sAllStrings += m_xBuilder->weld_radio_button(radio)->get_label() + " ";

    OUString buttons[] = { "reset", "details" };

    for (const auto& btn : buttons)
        sAllStrings += m_xBuilder->weld_button(btn)->get_label() + " ";

    // check button
    sAllStrings += mxCbEnglishFuncName->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool ScTpFormulaOptions::FillItemSet(SfxItemSet* rCoreSet)
{
    bool bRet = false;
diff --git a/sc/source/ui/optdlg/tpprint.cxx b/sc/source/ui/optdlg/tpprint.cxx
index c257f6f..429928b 100644
--- a/sc/source/ui/optdlg/tpprint.cxx
+++ b/sc/source/ui/optdlg/tpprint.cxx
@@ -81,6 +81,22 @@ void ScTpPrintOptions::Reset( const SfxItemSet* rCoreSet )
    m_xForceBreaksCB->save_state();
}

OUString ScTpPrintOptions::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label1", "label2" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString checkButton[] = { "suppressCB", "forceBreaksCB", "printCB" };

    for (const auto& check : checkButton)
        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool ScTpPrintOptions::FillItemSet( SfxItemSet* rCoreAttrs )
{
    rCoreAttrs->ClearItem( SID_PRINT_SELECTEDSHEET );
diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx
index cb3c6b5..bce3b70 100644
--- a/sc/source/ui/optdlg/tpusrlst.cxx
+++ b/sc/source/ui/optdlg/tpusrlst.cxx
@@ -185,6 +185,22 @@ void ScTpUserLists::Reset( const SfxItemSet* rCoreAttrs )
    }
}

OUString ScTpUserLists::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "listslabel", "entrieslabel", "copyfromlabel" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString buttons[] = { "new", "discard", "add", "modify", "delete", "copy" };

    for (const auto& btn : buttons)
        sAllStrings += m_xBuilder->weld_button(btn)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool ScTpUserLists::FillItemSet( SfxItemSet* rCoreAttrs )
{
    // Changes aren't saved?
diff --git a/sc/source/ui/optdlg/tpview.cxx b/sc/source/ui/optdlg/tpview.cxx
index 982e9dc1..5bb4fc5 100644
--- a/sc/source/ui/optdlg/tpview.cxx
+++ b/sc/source/ui/optdlg/tpview.cxx
@@ -94,6 +94,26 @@ std::unique_ptr<SfxTabPage> ScTpContentOptions::Create( weld::Container* pPage, 
    return std::make_unique<ScTpContentOptions>(pPage, pController, *rCoreSet);
}

OUString ScTpContentOptions::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label4",   "label5", "label3",       "label1",        "grid_label",
                          "lbCursor", "label2", "objgrf_label", "diagram_label", "draw_label" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString checkButton[]
        = { "formula",   "nil",          "annot",   "formulamark", "value",  "anchor",
            "rangefind", "rowcolheader", "hscroll", "vscroll",     "tblreg", "outline",
            "cbSummary", "synczoom",     "break",   "guideline" };

    for (const auto& check : checkButton)
        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool    ScTpContentOptions::FillItemSet( SfxItemSet* rCoreSet )
{
    bool bRet = false;
@@ -340,6 +360,29 @@ std::unique_ptr<SfxTabPage> ScTpLayoutOptions::Create( weld::Container* pPage, w
    return xNew;
}

OUString ScTpLayoutOptions::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label1", "label4", "label5", "label6", "label3" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString checkButton[] = { "aligncb",   "editmodecb", "enter_paste_mode_cb",
                               "formatcb",  "exprefcb",   "sortrefupdatecb",
                               "markhdrcb", "replwarncb", "legacy_cell_selection_cb" };

    for (const auto& check : checkButton)
        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";

    OUString radioButton[] = { "alwaysrb", "requestrb", "neverrb" };

    for (const auto& radio : radioButton)
        sAllStrings += m_xBuilder->weld_radio_button(radio)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool    ScTpLayoutOptions::FillItemSet( SfxItemSet* rCoreSet )
{
    bool bRet = true;
diff --git a/sd/source/ui/dlg/prntopts.cxx b/sd/source/ui/dlg/prntopts.cxx
index 4b50875..4c56e70 100644
--- a/sd/source/ui/dlg/prntopts.cxx
+++ b/sd/source/ui/dlg/prntopts.cxx
@@ -69,6 +69,30 @@ SdPrintOptions::~SdPrintOptions()
{
}

OUString SdPrintOptions::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label3", "label2", "printlbl", "contentlbl" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString checkButton[] = { "frontcb", "backcb",    "papertryfrmprntrcb", "pagenmcb",
                               "datecb",  "timecb",    "hiddenpgcb",         "drawingcb",
                               "notecb",  "handoutcb", "outlinecb" };

    for (const auto& check : checkButton)
        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";

    OUString radioButton[] = { "pagedefaultrb", "fittopgrb",   "tilepgrb",    "brouchrb",
                               "defaultrb",     "grayscalerb", "blackwhiterb" };

    for (const auto& radio : radioButton)
        sAllStrings += m_xBuilder->weld_radio_button(radio)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool SdPrintOptions::FillItemSet( SfxItemSet* rAttrs )
{
    if( m_xCbxDraw->get_state_changed_from_saved() ||
diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx
index 6945907..0715a41 100644
--- a/sd/source/ui/dlg/tpoption.cxx
+++ b/sd/source/ui/dlg/tpoption.cxx
@@ -119,6 +119,22 @@ SdTpOptionsContents::~SdTpOptionsContents()
{
}

OUString SdTpOptionsContents::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label1" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString checkButton[] = { "ruler", "dragstripes", "handlesbezier", "moveoutline" };

    for (const auto& check : checkButton)
        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool SdTpOptionsContents::FillItemSet( SfxItemSet* rAttrs )
{
    bool bModified = false;
@@ -326,6 +342,27 @@ DeactivateRC SdTpOptionsMisc::DeactivatePage( SfxItemSet* pActiveSet )
    return DeactivateRC::LeavePage;
}

OUString SdTpOptionsMisc::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[]
        = { "newdoclbl", "label4", "label6",   "tabstoplabel", "label1",    "label7", "label2",
            "label5",    "label8", "widthlbl", "info1",        "heightlbl", "info2" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString checkButton[] = { "startwithwizard", "copywhenmove", "backgroundback",
                               "objalwymov",      "distortcb",    "cbCompatibility",
                               "enremotcont",     "enprsntcons",  "enprsntconsfullscreen",
                               "qickedit",        "textselected" };

    for (const auto& check : checkButton)
        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool SdTpOptionsMisc::FillItemSet( SfxItemSet* rAttrs )
{
    bool bModified = false;
diff --git a/sd/source/ui/inc/prntopts.hxx b/sd/source/ui/inc/prntopts.hxx
index 51c3a36..17037fe 100644
--- a/sd/source/ui/inc/prntopts.hxx
+++ b/sd/source/ui/inc/prntopts.hxx
@@ -59,6 +59,8 @@ public:
    static std::unique_ptr<SfxTabPage>
    Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet*);

    virtual OUString GetAllStrings() override;

    virtual bool FillItemSet(SfxItemSet*) override;
    virtual void Reset(const SfxItemSet*) override;

diff --git a/sd/source/ui/inc/tpoption.hxx b/sd/source/ui/inc/tpoption.hxx
index 9959163..55e4e4e 100644
--- a/sd/source/ui/inc/tpoption.hxx
+++ b/sd/source/ui/inc/tpoption.hxx
@@ -52,6 +52,8 @@ public:
    static  std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* );
    virtual ~SdTpOptionsContents() override;

    virtual OUString GetAllStrings() override;

    virtual bool FillItemSet( SfxItemSet* ) override;
    virtual void Reset( const SfxItemSet * ) override;
};
@@ -124,6 +126,8 @@ public:
    static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* );
    virtual ~SdTpOptionsMisc() override;

    virtual OUString GetAllStrings() override;

    virtual bool FillItemSet( SfxItemSet* ) override;
    virtual void Reset( const SfxItemSet * ) override;

diff --git a/sfx2/source/dialog/printopt.cxx b/sfx2/source/dialog/printopt.cxx
index d804bdf..bb8c67a 100644
--- a/sfx2/source/dialog/printopt.cxx
+++ b/sfx2/source/dialog/printopt.cxx
@@ -79,6 +79,36 @@ std::unique_ptr<SfxTabPage> SfxCommonPrintOptionsTabPage::Create(weld::Container
    return std::make_unique<SfxCommonPrintOptionsTabPage>(pPage, pController, *rAttrSet);
}

OUString SfxCommonPrintOptionsTabPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label4", "label6", "label2", "label3", "label1", "label5" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString checkButton[] = { "converttogray", "reducebitmaptrans", "reducebitmap", "reducetrans",
                               "papersize",     "paperorient",       "trans",        "reducegrad" };

    for (const auto& check : checkButton)
        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";

    OUString radioButton[] = { "printer",
                               "file",
                               "reducebitmapresol",
                               "reducebitmapnormal",
                               "reducebitmapoptimal",
                               "reducetransauto",
                               "reducetransnone",
                               "reducegradstripes",
                               "reducegradcolor" };

    for (const auto& radio : radioButton)
        sAllStrings += m_xBuilder->weld_radio_button(radio)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool SfxCommonPrintOptionsTabPage::FillItemSet( SfxItemSet* /*rSet*/ )
{
    std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index 34589ca..8f0f414 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -166,6 +166,19 @@ bool SfxTabPage::FillItemSet( SfxItemSet* )
    return false;
}

/*
Returns the visible strings of a dialog.

Supported items:
- label
- check button
- radio button
- toggle button
- link button
- button
*/
OUString SfxTabPage::GetAllStrings() { return OUString(); }

void SfxTabPage::Reset( const SfxItemSet* )
{
}
diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx
index f8fa5a9..ad28392 100644
--- a/starmath/inc/dialog.hxx
+++ b/starmath/inc/dialog.hxx
@@ -61,6 +61,8 @@ public:

    SmPrintOptionsTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet &rOptions);
    virtual ~SmPrintOptionsTabPage() override;

    virtual OUString GetAllStrings() override;
};

/**************************************************************************/
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index 7d8a837..a377e59 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -186,6 +186,28 @@ SmPrintOptionsTabPage::~SmPrintOptionsTabPage()
            pEdit->UpdateStatus();
}

OUString SmPrintOptionsTabPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label4", "label5", "label1", "label6" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString checkButton[]
        = { "title", "text", "frame", "norightspaces", "saveonlyusedsymbols", "autoclosebrackets" };

    for (const auto& check : checkButton)
        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";

    OUString radioButton[] = { "sizenormal", "sizescaled", "sizezoomed" };

    for (const auto& radio : radioButton)
        sAllStrings += m_xBuilder->weld_radio_button(radio)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool SmPrintOptionsTabPage::FillItemSet(SfxItemSet* rSet)
{
    sal_uInt16  nPrintSize;
diff --git a/svx/source/dialog/optgrid.cxx b/svx/source/dialog/optgrid.cxx
index 3cd12b4..ccbfe83 100644
--- a/svx/source/dialog/optgrid.cxx
+++ b/svx/source/dialog/optgrid.cxx
@@ -149,6 +149,26 @@ std::unique_ptr<SfxTabPage> SvxGridTabPage::Create(weld::Container* pPage, weld:
    return std::make_unique<SvxGridTabPage>(pPage, pController, rAttrSet);
}

OUString SvxGridTabPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[]
        = { "label1",    "label2", "flddrawx",  "flddrawy", "label6", "label7", "label3",
            "divisionx", "label4", "divisiony", "label5",   "label8", "label9" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString checkButton[]
        = { "usegridsnap", "gridvisible", "synchronize", "snaphelplines", "snapborder",
            "snapframe",   "snappoints",  "ortho",       "bigortho",      "rotate" };

    for (const auto& check : checkButton)
        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool SvxGridTabPage::FillItemSet( SfxItemSet* rCoreSet )
{
    if ( bAttrModified )
diff --git a/sw/source/ui/config/mailconfigpage.cxx b/sw/source/ui/config/mailconfigpage.cxx
index 4f2d996..3b8a5ec 100644
--- a/sw/source/ui/config/mailconfigpage.cxx
+++ b/sw/source/ui/config/mailconfigpage.cxx
@@ -130,6 +130,28 @@ std::unique_ptr<SfxTabPage> SwMailConfigPage::Create(weld::Container* pPage, wel
    return std::make_unique<SwMailConfigPage>(pPage, pController, *rAttrSet);
}

OUString SwMailConfigPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label1", "displayname_label", "address_label", "replyto_label",
                          "label2", "server_label",      "port_label" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString checkButton[] = { "replytocb", "secure" };

    for (const auto& check : checkButton)
        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";

    OUString buttons[] = { "serverauthentication", "test" };

    for (const auto& btn : buttons)
        sAllStrings += m_xBuilder->weld_button(btn)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool SwMailConfigPage::FillItemSet( SfxItemSet* /*rSet*/ )
{
    if (m_xDisplayNameED->get_value_changed_from_saved())
diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx
index 576ae35..7d6ecaf 100644
--- a/sw/source/ui/config/optcomp.cxx
+++ b/sw/source/ui/config/optcomp.cxx
@@ -356,6 +356,19 @@ std::unique_ptr<SfxTabPage> SwCompatibilityOptPage::Create(weld::Container* pPag
    return std::make_unique<SwCompatibilityOptPage>(pPage, pController, *rAttrSet);
}

OUString SwCompatibilityOptPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label2", "label11" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    sAllStrings += m_xDefaultPB->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool SwCompatibilityOptPage::FillItemSet( SfxItemSet*  )
{
    bool bModified = false;
diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx
index 2c3ef5a..14fe9a7 100644
--- a/sw/source/ui/config/optload.cxx
+++ b/sw/source/ui/config/optload.cxx
@@ -147,6 +147,29 @@ IMPL_LINK_NOARG(SwLoadOptPage, StandardizedPageCountCheckHdl, weld::Toggleable&,
    m_xStandardizedPageSizeNF->set_sensitive(m_xShowStandardizedPageCount->get_active());
}

OUString SwLoadOptPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label2",   "label1", "label3", "label5",
                          "tablabel", "label4", "label7", "labelstandardpages" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString checkButton[]
        = { "updatefields", "updatecharts", "usecharunit", "squaremode", "standardizedpageshow" };

    for (const auto& check : checkButton)
        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";

    OUString radioButton[] = { "always", "onrequest", "never" };

    for (const auto& radio : radioButton)
        sAllStrings += m_xBuilder->weld_radio_button(radio)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool SwLoadOptPage::FillItemSet( SfxItemSet* rSet )
{
    bool bRet = false;
@@ -541,6 +564,21 @@ std::unique_ptr<SfxTabPage> SwCaptionOptPage::Create(weld::Container* pPage, wel
    return std::make_unique<SwCaptionOptPage>(pPage, pController, *rAttrSet);
}

OUString SwCaptionOptPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label1",         "label13",     "label2",  "label7",  "numberingft",
                          "numseparatorft", "separatorft", "label18", "label11", "label4",
                          "label6",         "label10",     "label3" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    sAllStrings += m_xBuilder->weld_check_button("applyborder")->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool SwCaptionOptPage::FillItemSet( SfxItemSet* )
{
    bool bRet = false;
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 329462a..d9b5f77 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -212,6 +212,38 @@ void SwContentOptPage::Reset(const SfxItemSet* rSet)
    lcl_SelectMetricLB(*m_xVMetric, FN_VSCROLL_METRIC, *rSet);
}

OUString SwContentOptPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[]
        = { "guideslabel", "displaylabel",  "displayfl1",       "changeslabel", "label3",
            "hruler",      "settingslabel", "measureunitlabel", "outlinelabel" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString checkButton[] = { "helplines",
                               "graphics",
                               "tables",
                               "drawings",
                               "comments",
                               "resolvedcomments",
                               "hiddentextfield",
                               "hiddenparafield",
                               "changesinmargin",
                               "changestooltip",
                               "vruler",
                               "vrulerright",
                               "smoothscroll",
                               "outlinecontentvisibilitybutton",
                               "suboutlinelevelsascontent" };

    for (const auto& check : checkButton)
        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool SwContentOptPage::FillItemSet(SfxItemSet* rSet)
{
    const SwElemItem* pOldAttr = GetOldItem(GetItemSet(), FN_PARAM_ELEM);
@@ -352,6 +384,29 @@ std::unique_ptr<SfxTabPage> SwAddPrinterTabPage::Create( weld::Container* pPage,
    return std::make_unique<SwAddPrinterTabPage>(pPage, pController, *rAttrSet);
}

OUString SwAddPrinterTabPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label2", "label10", "label1", "label5", "4" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString checkButton[]
        = { "graphics",  "formcontrols", "background", "inblack", "hiddentext", "textplaceholder",
            "leftpages", "rightpages",   "brochure",   "rtl",     "blankpages", "papertray" };

    for (const auto& check : checkButton)
        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";

    OUString radioButton[] = { "none", "only", "end", "endpage", "inmargins" };

    for (const auto& radio : radioButton)
        sAllStrings += m_xBuilder->weld_radio_button(radio)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool    SwAddPrinterTabPage::FillItemSet( SfxItemSet* rCoreSet )
{
    if ( m_bAttrModified )
@@ -574,6 +629,20 @@ static void lcl_SetColl(SwWrtShell* pWrtShell, sal_uInt16 nType,
    pColl->SetFormatAttr(SvxFontHeightItem(nHeight, 100, nFontHeightWhich));
}

OUString SwStdFontTabPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label1",        "font_label", "size_label",    "default_label",
                          "heading_label", "list_label", "caption_label", "index_label" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    sAllStrings += m_xStandardPB->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool SwStdFontTabPage::FillItemSet( SfxItemSet* )
{
    SW_MOD()->GetModuleConfig()->SetDefaultFontInCurrDocOnly(false);
@@ -1011,6 +1080,30 @@ std::unique_ptr<SfxTabPage> SwTableOptionsTabPage::Create( weld::Container* pPag
    return std::make_unique<SwTableOptionsTabPage>(pPage, pController, *rAttrSet);
}

OUString SwTableOptionsTabPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[]
        = { "label1",  "label3",  "label4",  "label5",  "label6",  "label10", "label2",
            "label14", "label15", "label16", "label11", "label12", "label13" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString checkButton[] = { "header",        "repeatheader",     "dontsplit",   "border",
                               "numformatting", "numfmtformatting", "numalignment" };

    for (const auto& check : checkButton)
        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";

    OUString radioButton[] = { "fix", "fixprop", "var" };

    for (const auto& radio : radioButton)
        sAllStrings += m_xBuilder->weld_radio_button(radio)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool SwTableOptionsTabPage::FillItemSet( SfxItemSet* )
{
    bool bRet = false;
@@ -1242,6 +1335,25 @@ void SwShdwCursorOptionsTabPage::PageCreated( const SfxAllItemSet& aSet )
        m_pWrtShell = pWrtSh->GetValue();
}

OUString SwShdwCursorOptionsTabPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "layoutopt", "displayfl", "cursoropt",      "cursorlabel",
                          "fillmode",  "lbImage",   "lbDefaultAnchor" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString checkButton[]
        = { "mathbaseline", "paragraph",  "hyphens",   "spaces",       "nonbreak",   "tabs",
            "break",        "hiddentext", "bookmarks", "cursorinprot", "cursoronoff" };

    for (const auto& check : checkButton)
        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool SwShdwCursorOptionsTabPage::FillItemSet( SfxItemSet* rSet )
{
    SwShadowCursorItem aOpt;
@@ -1606,6 +1718,20 @@ std::unique_ptr<SfxTabPage> SwRedlineOptionsTabPage::Create( weld::Container* pP
    return std::make_unique<SwRedlineOptionsTabPage>(pPage, pController, *rSet);
}

OUString SwRedlineOptionsTabPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label2", "insert_label",  "insertcolor_label",
                          "label3", "deleted_label", "deletedcolor_label",
                          "label4", "changed_label", "changedcolor_label",
                          "label5", "markpos_label", "markcolor_label" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool SwRedlineOptionsTabPage::FillItemSet( SfxItemSet* )
{
    CharAttr *pAttr;
@@ -1992,6 +2118,27 @@ std::unique_ptr<SfxTabPage> SwCompareOptionsTabPage::Create( weld::Container* pP
    return std::make_unique<SwCompareOptionsTabPage>(pPage, pController, *rAttrSet);
}

OUString SwCompareOptionsTabPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString labels[] = { "label1", "setting" };

    for (const auto& label : labels)
        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";

    OUString checkButton[] = { "useRSID", "ignore", "storeRSID" };

    for (const auto& check : checkButton)
        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";

    OUString radioButton[] = { "auto", "byword", "bycharacter" };

    for (const auto& radio : radioButton)
        sAllStrings += m_xBuilder->weld_radio_button(radio)->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool SwCompareOptionsTabPage::FillItemSet( SfxItemSet* )
{
    bool bRet = false;
@@ -2128,6 +2275,22 @@ std::unique_ptr<SfxTabPage> SwTestTabPage::Create( weld::Container* pPage, weld:
    return std::make_unique<SwTestTabPage>(pPage, pController, *rAttrSet);
}

OUString SwTestTabPage::GetAllStrings()
{
    OUString sAllStrings;
    OUString checkButton[] = { "unused",           "dynamic",  "nocalm",
                               "wysiwygdbg",       "noidle",   "noscreenadj",
                               "winformat",        "noscroll", "DrawingLayerNotLoading",
                               "AutoFormatByInput" };

    for (const auto& check : checkButton)
        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";

    sAllStrings += m_xBuilder->weld_label("label1")->get_label() + " ";

    return sAllStrings.replaceAll("_", "");
}

bool    SwTestTabPage::FillItemSet( SfxItemSet* rCoreSet )
{

diff --git a/sw/source/uibase/inc/mailconfigpage.hxx b/sw/source/uibase/inc/mailconfigpage.hxx
index 734b39aa..4f63527 100644
--- a/sw/source/uibase/inc/mailconfigpage.hxx
+++ b/sw/source/uibase/inc/mailconfigpage.hxx
@@ -54,6 +54,8 @@ public:
    static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController,
                                     const SfxItemSet* rAttrSet);

    virtual OUString GetAllStrings() override;

    virtual bool        FillItemSet( SfxItemSet* rSet ) override;
    virtual void        Reset( const SfxItemSet* rSet ) override;
};
diff --git a/sw/source/uibase/inc/optcomp.hxx b/sw/source/uibase/inc/optcomp.hxx
index 42ebc49..c98f17f 100644
--- a/sw/source/uibase/inc/optcomp.hxx
+++ b/sw/source/uibase/inc/optcomp.hxx
@@ -67,6 +67,8 @@ public:

    static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet );

    virtual OUString GetAllStrings() override;

    virtual bool            FillItemSet( SfxItemSet* rSet ) override;
    virtual void            Reset( const SfxItemSet* rSet ) override;
};
diff --git a/sw/source/uibase/inc/optload.hxx b/sw/source/uibase/inc/optload.hxx
index 79a3b6f..2b582bf 100644
--- a/sw/source/uibase/inc/optload.hxx
+++ b/sw/source/uibase/inc/optload.hxx
@@ -88,6 +88,8 @@ public:
    static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController,
                                      const SfxItemSet* rAttrSet);

    virtual OUString GetAllStrings() override;

    virtual bool        FillItemSet( SfxItemSet* rSet ) override;
    virtual void        Reset( const SfxItemSet* rSet ) override;
};
@@ -188,6 +190,8 @@ public:
    static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController,
                                     const SfxItemSet* rAttrSet);

    virtual OUString GetAllStrings() override;

    virtual bool        FillItemSet( SfxItemSet* rSet ) override;
    virtual void        Reset( const SfxItemSet* rSet ) override;
};
diff --git a/sw/source/uibase/inc/optpage.hxx b/sw/source/uibase/inc/optpage.hxx
index 44e93eb..c4fa701 100644
--- a/sw/source/uibase/inc/optpage.hxx
+++ b/sw/source/uibase/inc/optpage.hxx
@@ -68,6 +68,8 @@ public:

    static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet);

    virtual OUString GetAllStrings() override;

    virtual bool FillItemSet(SfxItemSet* rSet) override;
    virtual void Reset(const SfxItemSet* rSet) override;
};
@@ -112,6 +114,8 @@ public:

    static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet);

    virtual OUString GetAllStrings() override;

    virtual bool FillItemSet(SfxItemSet* rSet) override;
    virtual void Reset(const SfxItemSet* rSet) override;
    void SetFax(const std::vector<OUString>& );
@@ -170,6 +174,8 @@ public:
    static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet);
    virtual ~SwStdFontTabPage() override;

    virtual OUString GetAllStrings() override;

    virtual bool FillItemSet(SfxItemSet* rSet) override;
    virtual void Reset(const SfxItemSet* rSet) override;

@@ -208,6 +214,8 @@ public:

    static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet);

    virtual OUString GetAllStrings() override;

    virtual bool FillItemSet(SfxItemSet* rSet) override;
    virtual void Reset(const SfxItemSet* rSet) override;

@@ -250,6 +258,8 @@ public:

    static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet);

    virtual OUString GetAllStrings() override;

    virtual bool FillItemSet( SfxItemSet* rSet ) override;
    virtual void Reset( const SfxItemSet* rSet ) override;

@@ -323,6 +333,8 @@ public:

    static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet);

    virtual OUString GetAllStrings() override;

    virtual bool FillItemSet( SfxItemSet* rSet ) override;
    virtual void Reset( const SfxItemSet* rSet ) override;
};
@@ -339,6 +351,8 @@ public:

    static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet);

    virtual OUString GetAllStrings() override;

    virtual bool FillItemSet( SfxItemSet* rSet ) override;
    virtual void Reset( const SfxItemSet* rSet ) override;

@@ -380,6 +394,8 @@ public:

    static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet );

    virtual OUString GetAllStrings() override;

    virtual bool FillItemSet( SfxItemSet* rSet ) override;
    virtual void Reset( const SfxItemSet* rSet ) override;
};