[Libreoffice-commits] core.git: vcl/source

Markus Mohrhard markus.mohrhard at googlemail.com
Tue Feb 6 14:49:30 UTC 2018


 vcl/source/window/btndlg.cxx |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit 82abf9d5e2e5ca208dd801eda243b88daaa81620
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue Feb 6 11:51:07 2018 +0100

    uitest: set ids for all standard buttons automatically
    
    Change-Id: I48cb6f67150aa5aeab97a1aa1c381188c0db9358
    Reviewed-on: https://gerrit.libreoffice.org/49287
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/vcl/source/window/btndlg.cxx b/vcl/source/window/btndlg.cxx
index be9644c5b7ce..9bbffc417bb8 100644
--- a/vcl/source/window/btndlg.cxx
+++ b/vcl/source/window/btndlg.cxx
@@ -303,6 +303,14 @@ void ButtonDialog::AddButton( StandardButtonType eType, sal_uInt16 nId,
            (eType == StandardButtonType::Cancel && pItem->mpPushButton->GetType() == WindowType::CANCELBUTTON) ||
            (eType == StandardButtonType::Help   && pItem->mpPushButton->GetType() == WindowType::HELPBUTTON)) )
     {
+        std::map<StandardButtonType, OUString> mapButtonTypeToID = {{StandardButtonType::Yes, "yes"},
+            {StandardButtonType::No, "no"}, {StandardButtonType::Retry, "retry"},
+            {StandardButtonType::Close, "close"}, {StandardButtonType::More, "more"},
+            {StandardButtonType::Ignore, "ignore"}, {StandardButtonType::Abort, "abort"},
+            {StandardButtonType::Less, "less"}, {StandardButtonType::Count, "count"}};
+        auto itr = mapButtonTypeToID.find(eType);
+        if (itr != mapButtonTypeToID.end())
+            pItem->mpPushButton->set_id(itr->second);
         pItem->mpPushButton->SetText( Button::GetStandardText( eType ) );
     }
 


More information about the Libreoffice-commits mailing list