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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Nov 7 10:34:13 UTC 2018


 sd/source/ui/sidebar/SlideBackground.cxx |   46 +++++++++++++------------------
 sd/source/ui/sidebar/SlideBackground.hxx |    3 +-
 sd/source/ui/view/drviews1.cxx           |   12 ++++----
 3 files changed, 28 insertions(+), 33 deletions(-)

New commits:
commit 92b56816cd9b568b808cb880be920d26bc9e2693
Author:     Mark Dobo <mrkropen18 at gmail.com>
AuthorDate: Tue Nov 6 18:36:47 2018 +0100
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Wed Nov 7 11:32:37 2018 +0100

    tdf#113660 - Wrong label on sidebar slide pane after switching to handout view
    
    +simplifying variable assignment
    
    Change-Id: I2f43783d6e58c16f9200d44f7f34b05974ee0772
    Reviewed-on: https://gerrit.libreoffice.org/62970
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
    Tested-by: Tamás Zolnai <tamas.zolnai at collabora.com>

diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx
index b3b54bfde71d..930423a170a9 100644
--- a/sd/source/ui/sidebar/SlideBackground.cxx
+++ b/sd/source/ui/sidebar/SlideBackground.cxx
@@ -113,7 +113,8 @@ SlideBackground::SlideBackground(
     mpGradientItem(),
     mpHatchItem(),
     mpBitmapItem(),
-    mbEditModeChangePending(false),
+    mbSwitchModeToNormal(false),
+    mbSwitchModeToMaster(false),
     mxFrame(rxFrame),
     maContext(),
     maDrawOtherContext(vcl::EnumContext::Application::Draw, vcl::EnumContext::Context::DrawPage),
@@ -480,38 +481,31 @@ IMPL_LINK(SlideBackground, EventMultiplexerListener,
             populateMasterSlideDropdown();
             break;
         case EventMultiplexerEventId::EditModeNormal:
+            mbSwitchModeToNormal = true;
+            break;
         case EventMultiplexerEventId::EditModeMaster:
-            mbEditModeChangePending = true;
+            mbSwitchModeToMaster = true;
             break;
         case EventMultiplexerEventId::EditViewSelection:
         case EventMultiplexerEventId::EndTextEdit:
         {
-            if (mbEditModeChangePending)
+            if ( mbSwitchModeToMaster )
             {
-                ViewShell* pMainViewShell = mrBase.GetMainViewShell().get();
-
-                if (pMainViewShell)
-                {
-                    DrawViewShell* pDrawViewShell = static_cast<DrawViewShell*>(pMainViewShell);
-                    EditMode eMode = pDrawViewShell->GetEditMode();
-
-                    if ( eMode == EditMode::MasterPage)
-                    {
-                        if( IsImpress() )
-                            SetPanelTitle(SdResId(STR_MASTERSLIDE_NAME));
-                        else
-                            SetPanelTitle(SdResId(STR_MASTERPAGE_NAME));
-                    }
-                    else // EditMode::Page
-                    {
-                        if( IsImpress() )
-                            SetPanelTitle(SdResId(STR_SLIDE_NAME));
-                        else
-                            SetPanelTitle(SdResId(STR_PAGE_NAME));
-                    }
-                }
-                mbEditModeChangePending = false;
+                if( IsImpress() )
+                    SetPanelTitle(SdResId(STR_MASTERSLIDE_NAME));
+                else
+                    SetPanelTitle(SdResId(STR_MASTERPAGE_NAME));
+                mbSwitchModeToMaster = false;
             }
+            else if ( mbSwitchModeToNormal )
+            {
+                if( IsImpress() )
+                    SetPanelTitle(SdResId(STR_SLIDE_NAME));
+                else
+                    SetPanelTitle(SdResId(STR_PAGE_NAME));
+                mbSwitchModeToNormal = false;
+            }
+
         }
         break;
         case EventMultiplexerEventId::CurrentPageChanged:
diff --git a/sd/source/ui/sidebar/SlideBackground.hxx b/sd/source/ui/sidebar/SlideBackground.hxx
index a1035ec5aab1..136e8cbdc556 100644
--- a/sd/source/ui/sidebar/SlideBackground.hxx
+++ b/sd/source/ui/sidebar/SlideBackground.hxx
@@ -120,7 +120,8 @@ private:
     std::unique_ptr< XFillHatchItem >       mpHatchItem;
     std::unique_ptr< XFillBitmapItem >      mpBitmapItem;
 
-    bool mbEditModeChangePending;
+    bool mbSwitchModeToNormal;
+    bool mbSwitchModeToMaster;
 
     css::uno::Reference<css::frame::XFrame> mxFrame;
     vcl::EnumContext maContext;
diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index f51470312c4a..365a3b57b21e 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -343,6 +343,12 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
 
         sal_uInt16 nActualPageId = maTabControl->GetPageId(0);
 
+        if (mePageKind == PageKind::Handout)
+        {
+            // at handouts only allow MasterPage
+            eEMode = EditMode::MasterPage;
+        }
+
         GetViewShellBase().GetDrawController().FireChangeEditMode (eEMode == EditMode::MasterPage);
         GetViewShellBase().GetDrawController().FireChangeLayerMode (bIsLayerModeActive);
 
@@ -356,12 +362,6 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
             pLayerBar->EndEditMode();
         maTabControl->EndEditMode();
 
-        if (mePageKind == PageKind::Handout)
-        {
-            // at handouts only allow MasterPage
-            eEMode = EditMode::MasterPage;
-        }
-
         GetViewShellBase().GetDrawController().BroadcastContextChange();
 
         meEditMode = eEMode;


More information about the Libreoffice-commits mailing list