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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Sep 26 21:28:10 UTC 2018


 sd/source/ui/dlg/headerfooterdlg.cxx |   26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

New commits:
commit d077b30dba618daace0373e9b7e7fe84f982c6aa
Author:     Markus Mohrhard <markus.mohrhard at googlemail.com>
AuthorDate: Wed Sep 26 12:37:11 2018 +0200
Commit:     Markus Mohrhard <markus.mohrhard at googlemail.com>
CommitDate: Wed Sep 26 23:27:44 2018 +0200

    make the UI element IDs locally unique in impress header footer dlg
    
    Change-Id: I368405acc7dfbd210cfc0115e58e993846ab9497
    Reviewed-on: https://gerrit.libreoffice.org/60985
    Tested-by: Jenkins
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sd/source/ui/dlg/headerfooterdlg.cxx b/sd/source/ui/dlg/headerfooterdlg.cxx
index f876f3d54221..318688a8aec6 100644
--- a/sd/source/ui/dlg/headerfooterdlg.cxx
+++ b/sd/source/ui/dlg/headerfooterdlg.cxx
@@ -385,6 +385,27 @@ void HeaderFooterDialog::change( SdUndoGroup* pUndoGroup, SdPage* pPage, const H
     pPage->setHeaderFooterSettings( rNewSettings );
 }
 
+namespace {
+
+void recursive_rename_ui_element(vcl::Window& rWindow, const OUString& rPrefix)
+{
+    OUString aID = rWindow.get_id();
+    if (aID.isEmpty())
+    {
+        rWindow.set_id(rPrefix +  aID);
+    }
+
+    size_t nChildCount = rWindow.GetChildCount();
+    for (size_t i = 0; i < nChildCount; ++i)
+    {
+        vcl::Window* pChild = rWindow.GetChild(i);
+        if (pChild)
+            recursive_rename_ui_element(*pChild, rPrefix);
+    }
+}
+
+}
+
 HeaderFooterTabPage::HeaderFooterTabPage( vcl::Window* pWindow, SdDrawDocument* pDoc, SdPage* pActualPage, bool bHandoutMode ) :
         TabPage( pWindow, "HeaderFooterTab", "modules/simpress/ui/headerfootertab.ui" ),
         mpDoc(pDoc),
@@ -443,6 +464,11 @@ HeaderFooterTabPage::HeaderFooterTabPage( vcl::Window* pWindow, SdDrawDocument*
     mpCBDateTimeLanguage->SelectLanguage( meOldLanguage );
 
     FillFormatList(0);
+
+    if (mbHandoutMode)
+        recursive_rename_ui_element(*this, "handout");
+    else
+        recursive_rename_ui_element(*this, "slide");
 }
 
 HeaderFooterTabPage::~HeaderFooterTabPage()


More information about the Libreoffice-commits mailing list