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

Noel Grandin noel.grandin at collabora.co.uk
Fri Jul 21 08:07:30 UTC 2017


 compilerplugins/clang/unusedfields.readonly.results |   22 --------
 sd/source/ui/animations/CategoryListBox.cxx         |    6 --
 sd/source/ui/animations/CategoryListBox.hxx         |    2 
 sd/source/ui/dlg/RemoteDialogClientBox.cxx          |   15 -----
 sd/source/ui/dlg/RemoteDialogClientBox.hxx          |    1 
 sd/source/ui/dlg/docprev.cxx                        |   17 ------
 sd/source/ui/dlg/filedlg.cxx                        |   40 --------------
 sd/source/ui/inc/docprev.hxx                        |    3 -
 sd/source/ui/inc/unomodel.hxx                       |    2 
 sd/source/ui/inc/unosrch.hxx                        |    1 
 sd/source/ui/presenter/PresenterCanvas.cxx          |   19 ------
 sd/source/ui/presenter/PresenterCanvas.hxx          |    4 -
 sd/source/ui/sidebar/LayoutMenu.cxx                 |    5 -
 sd/source/ui/sidebar/LayoutMenu.hxx                 |    5 -
 sd/source/ui/sidebar/PanelBase.cxx                  |    3 -
 sd/source/ui/sidebar/PanelBase.hxx                  |    1 
 sd/source/ui/unoidl/unomodel.cxx                    |   19 ------
 sd/source/ui/unoidl/unosrch.cxx                     |   16 -----
 sd/source/ui/view/ViewShellManager.cxx              |   55 +-------------------
 19 files changed, 11 insertions(+), 225 deletions(-)

New commits:
commit cf530f290d30e4f4decc143feebfdec9b3e0bc65
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Thu Jul 20 16:29:48 2017 +0200

    loplugin:unusedfields in sd
    
    Change-Id: I7f89e038f3d9bd0da658c7d3b8faec23d8a593db
    Reviewed-on: https://gerrit.libreoffice.org/40257
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/compilerplugins/clang/unusedfields.readonly.results b/compilerplugins/clang/unusedfields.readonly.results
index 7badc8cb155c..57665bcca364 100644
--- a/compilerplugins/clang/unusedfields.readonly.results
+++ b/compilerplugins/clang/unusedfields.readonly.results
@@ -1058,24 +1058,6 @@ sd/source/filter/eppt/epptbase.hxx:279
     PPTExParaSheet maParaLevel struct PPTExParaLevel [5]
 sd/source/filter/ppt/propread.hxx:142
     PropRead mApplicationCLSID sal_uInt8 [16]
-sd/source/ui/animations/CategoryListBox.hxx:43
-    sd::CategoryListBox maDoubleClickHdl Link<class sd::CategoryListBox &, void>
-sd/source/ui/dlg/filedlg.cxx:55
-    SdFileDialog_Imp mbUsableSelection _Bool
-sd/source/ui/dlg/RemoteDialogClientBox.hxx:91
-    sd::ClientBox m_bInCheckMode _Bool
-sd/source/ui/inc/docprev.hxx:41
-    SdDocPreviewWin aClickHdl Link<class SdDocPreviewWin &, void>
-sd/source/ui/inc/unomodel.hxx:110
-    SdXImpressDocument mxStyleFamilies css::uno::WeakReference<css::container::XNameAccess>
-sd/source/ui/inc/unomodel.hxx:111
-    SdXImpressDocument mxPresentation css::uno::WeakReference<css::presentation::XPresentation>
-sd/source/ui/inc/unosrch.hxx:46
-    SdUnoSearchReplaceShape mpShape css::drawing::XShape *
-sd/source/ui/presenter/PresenterCanvas.hxx:306
-    sd::presenter::PresenterCanvas maClipRectangle css::awt::Rectangle
-sd/source/ui/sidebar/LayoutMenu.hxx:128
-    sd::sidebar::LayoutMenu mbUseOwnScrollBar _Bool
 sd/source/ui/sidebar/MasterPageContainer.cxx:148
     sd::sidebar::MasterPageContainer::Implementation maLargePreviewBeingCreated class Image
 sd/source/ui/sidebar/MasterPageContainer.cxx:149
@@ -1084,12 +1066,8 @@ sd/source/ui/sidebar/MasterPageContainer.cxx:154
     sd::sidebar::MasterPageContainer::Implementation maLargePreviewNotAvailable class Image
 sd/source/ui/sidebar/MasterPageContainer.cxx:155
     sd::sidebar::MasterPageContainer::Implementation maSmallPreviewNotAvailable class Image
-sd/source/ui/sidebar/PanelBase.hxx:62
-    sd::sidebar::PanelBase mxSidebar css::uno::Reference<css::ui::XSidebar>
 sd/source/ui/slidesorter/inc/controller/SlsAnimator.hxx:97
     sd::slidesorter::controller::Animator maElapsedTime ::canvas::tools::ElapsedTime
-sd/source/ui/view/ViewShellManager.cxx:180
-    sd::ViewShellManager::Implementation mbKeepMainViewShellOnTop _Bool
 sdext/source/pdfimport/pdfparse/pdfentries.cxx:1018
     pdfparse::PDFFileImplData m_aOEntry sal_uInt8 [32]
 sdext/source/pdfimport/pdfparse/pdfentries.cxx:1019
diff --git a/sd/source/ui/animations/CategoryListBox.cxx b/sd/source/ui/animations/CategoryListBox.cxx
index ca332ea788d5..1d043272ee5a 100644
--- a/sd/source/ui/animations/CategoryListBox.cxx
+++ b/sd/source/ui/animations/CategoryListBox.cxx
@@ -81,11 +81,7 @@ IMPL_LINK_NOARG(CategoryListBox, implDoubleClickHdl, ListBox&, void)
 void CategoryListBox::MouseButtonUp( const MouseEvent& rMEvt )
 {
     ReleaseMouse();
-    if( rMEvt.IsLeft() && (rMEvt.GetClicks() == 2) )
-    {
-        maDoubleClickHdl.Call( *this );
-    }
-    else
+    if (!( rMEvt.IsLeft() && (rMEvt.GetClicks() == 2) ))
     {
         ListBox::MouseButtonUp( rMEvt );
     }
diff --git a/sd/source/ui/animations/CategoryListBox.hxx b/sd/source/ui/animations/CategoryListBox.hxx
index 37f6d3883f7b..535e27f1651c 100644
--- a/sd/source/ui/animations/CategoryListBox.hxx
+++ b/sd/source/ui/animations/CategoryListBox.hxx
@@ -39,8 +39,6 @@ public:
 
 private:
     virtual void    UserDraw( const UserDrawEvent& rUDEvt ) SAL_OVERRIDE;
-
-    Link<CategoryListBox&,void>     maDoubleClickHdl;
 };
 
 }
diff --git a/sd/source/ui/dlg/RemoteDialogClientBox.cxx b/sd/source/ui/dlg/RemoteDialogClientBox.cxx
index c32fc284e896..1c29c2f8324c 100644
--- a/sd/source/ui/dlg/RemoteDialogClientBox.cxx
+++ b/sd/source/ui/dlg/RemoteDialogClientBox.cxx
@@ -64,7 +64,6 @@ ClientBox::ClientBox( vcl::Window* pParent, WinBits nStyle ) :
     m_bHasScrollBar( false ),
     m_bHasActive( false ),
     m_bNeedsRecalc( true ),
-    m_bInCheckMode( false ),
     m_bAdjustActive( false ),
     m_bInDelete( false ),
     m_nActive( 0 ),
@@ -219,9 +218,6 @@ void ClientBox::selectEntry( const long nPos )
     //the whole painting operation. See issue i86993
     ::osl::ClearableMutexGuard guard(m_entriesMutex);
 
-    if ( m_bInCheckMode )
-        return;
-
     if ( m_bHasActive )
     {
         if ( nPos == m_nActive )
@@ -633,18 +629,11 @@ void ClientBox::addEntry( const std::shared_ptr<ClientInfo>& pClientInfo )
     }
     else
     {
-//         if ( !FindEntryPos( xEntry, 0, m_vEntries.size()-1, nPos ) )
-//         {
-            m_vEntries.insert( m_vEntries.begin()+nPos, xEntry );
-//         }
-//         else if ( !m_bInCheckMode )
-//         {
-//             OSL_FAIL( "ClientBox::addEntry(): Will not add duplicate entries"  );
-//         }
+        m_vEntries.insert( m_vEntries.begin()+nPos, xEntry );
     }
 
     //access to m_nActive must be guarded
-    if ( !m_bInCheckMode && m_bHasActive && ( m_nActive >= nPos ) )
+    if ( m_bHasActive && ( m_nActive >= nPos ) )
         m_nActive += 1;
 
     guard.clear();
diff --git a/sd/source/ui/dlg/RemoteDialogClientBox.hxx b/sd/source/ui/dlg/RemoteDialogClientBox.hxx
index f5c194efd358..5f63a8ec99b4 100644
--- a/sd/source/ui/dlg/RemoteDialogClientBox.hxx
+++ b/sd/source/ui/dlg/RemoteDialogClientBox.hxx
@@ -88,7 +88,6 @@ class ClientBox : public Control
     bool m_bHasScrollBar : 1;
     bool m_bHasActive : 1;
     bool m_bNeedsRecalc : 1;
-    bool m_bInCheckMode : 1;
     bool m_bAdjustActive : 1;
     bool m_bInDelete : 1;
     //Must be guarded together with m_vEntries to ensure a valid index at all times.
diff --git a/sd/source/ui/dlg/docprev.cxx b/sd/source/ui/dlg/docprev.cxx
index fb0130546a1f..e720d3a7a106 100644
--- a/sd/source/ui/dlg/docprev.cxx
+++ b/sd/source/ui/dlg/docprev.cxx
@@ -143,23 +143,6 @@ void SdDocPreviewWin::Paint( vcl::RenderContext& /*rRenderContext*/, const ::too
     }
 }
 
-bool SdDocPreviewWin::EventNotify( NotifyEvent& rNEvt )
-{
-    if ( rNEvt.GetType() == MouseNotifyEvent::MOUSEBUTTONDOWN )
-    {
-        const MouseEvent* pMEvt = rNEvt.GetMouseEvent();
-        if ( pMEvt->IsLeft() )
-        {
-            if( rNEvt.GetWindow() == this )
-            {
-                aClickHdl.Call(*this);
-            }
-        }
-    }
-
-    return Control::EventNotify(rNEvt);
-}
-
 void SdDocPreviewWin::updateViewSettings()
 {
     SvtAccessibilityOptions aAccOptions;
diff --git a/sd/source/ui/dlg/filedlg.cxx b/sd/source/ui/dlg/filedlg.cxx
index a52d1406bfe2..0286accd5ec4 100644
--- a/sd/source/ui/dlg/filedlg.cxx
+++ b/sd/source/ui/dlg/filedlg.cxx
@@ -52,12 +52,9 @@ private:
 
     css::uno::Reference< css::media::XPlayer > mxPlayer;
     ImplSVEvent * mnPlaySoundEvent;
-    bool mbUsableSelection;
     bool mbLabelPlaying;
     Idle maUpdateIdle;
 
-    void CheckSelectionState();
-
     DECL_LINK( PlayMusicHdl, void *, void );
     DECL_LINK( IsMusicStoppedHdl, Timer *, void );
 
@@ -65,8 +62,6 @@ public:
     explicit SdFileDialog_Imp();
     virtual ~SdFileDialog_Imp() override;
 
-    ErrCode Execute();
-
     // overwritten from FileDialogHelper, to receive user feedback
     virtual void SAL_CALL ControlStateChanged( const css::ui::dialogs::FilePickerEvent& aEvent ) override;
 };
@@ -77,10 +72,6 @@ void SAL_CALL SdFileDialog_Imp::ControlStateChanged( const css::ui::dialogs::Fil
 
     switch( aEvent.ElementId )
     {
-        case css::ui::dialogs::CommonFilePickerElementIds::LISTBOX_FILTER:
-            CheckSelectionState();
-            break;
-
         case css::ui::dialogs::ExtendedFilePickerElementIds::PUSHBUTTON_PLAY:
             if( mxControlAccess.is() )
             {
@@ -183,33 +174,9 @@ IMPL_LINK_NOARG(SdFileDialog_Imp, IsMusicStoppedHdl, Timer *, void)
     }
 }
 
-// check whether to disable the "selection" checkbox
-void SdFileDialog_Imp::CheckSelectionState()
-{
-    if( mbUsableSelection && mxControlAccess.is() )
-    {
-        OUString  aCurrFilter( GetCurrentFilter() );
-
-        try
-        {
-            if( aCurrFilter.isEmpty() || ( aCurrFilter == SdResId( STR_EXPORT_HTML_NAME ) ) )
-                mxControlAccess->enableControl( css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_SELECTION, false );
-            else
-                mxControlAccess->enableControl( css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_SELECTION, true );
-        }
-        catch (const css::lang::IllegalArgumentException&)
-        {
-#ifdef DBG_UTIL
-            OSL_FAIL( "Cannot access \"selection\" checkbox" );
-#endif
-        }
-    }
-}
-
 SdFileDialog_Imp::SdFileDialog_Imp() :
     FileDialogHelper( css::ui::dialogs::TemplateDescription::FILEOPEN_LINK_PLAY ),
     mnPlaySoundEvent( nullptr ),
-    mbUsableSelection( false ),
     mbLabelPlaying(false)
 {
     maUpdateIdle.SetInvokeHandler(LINK(this, SdFileDialog_Imp, IsMusicStoppedHdl));
@@ -242,13 +209,6 @@ SdFileDialog_Imp::~SdFileDialog_Imp()
         Application::RemoveUserEvent( mnPlaySoundEvent );
 }
 
-ErrCode SdFileDialog_Imp::Execute()
-{
-    // make sure selection checkbox is disabled if HTML is current filter!
-    CheckSelectionState();
-    return FileDialogHelper::Execute();
-}
-
 // -----------      SdOpenSoundFileDialog       -----------------------
 
 // these are simple forwarders
diff --git a/sd/source/ui/inc/docprev.hxx b/sd/source/ui/inc/docprev.hxx
index 32acb3059798..988c3bcd9f28 100644
--- a/sd/source/ui/inc/docprev.hxx
+++ b/sd/source/ui/inc/docprev.hxx
@@ -38,7 +38,6 @@ namespace sd {
 class SD_DLLPUBLIC SdDocPreviewWin : public Control, public SfxListener
 {
 protected:
-    Link<SdDocPreviewWin&,void> aClickHdl;
     Color           maDocumentColor;
     rtl::Reference< sd::SlideShow > mxSlideShow;
 
@@ -59,8 +58,6 @@ public:
     virtual void    dispose() override;
     virtual void    Resize() override;
 
-    virtual bool    EventNotify( NotifyEvent& rNEvt ) override;
-
     virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
 
 };
diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx
index 0e34762e51fb..60e14e173baa 100644
--- a/sd/source/ui/inc/unomodel.hxx
+++ b/sd/source/ui/inc/unomodel.hxx
@@ -107,8 +107,6 @@ private:
     css::uno::WeakReference< css::drawing::XDrawPages > mxMasterPagesAccess;
     css::uno::WeakReference< css::container::XNameAccess > mxLayerManager;
     css::uno::WeakReference< css::container::XNameContainer > mxCustomPresentationAccess;
-    css::uno::WeakReference< css::container::XNameAccess > mxStyleFamilies;
-    css::uno::WeakReference< css::presentation::XPresentation > mxPresentation;
     css::uno::WeakReference< css::i18n::XForbiddenCharacters > mxForbiddenCharacters;
     css::uno::Reference< css::container::XNameAccess > mxLinks;
 
diff --git a/sd/source/ui/inc/unosrch.hxx b/sd/source/ui/inc/unosrch.hxx
index 601a20d880dc..884659b09814 100644
--- a/sd/source/ui/inc/unosrch.hxx
+++ b/sd/source/ui/inc/unosrch.hxx
@@ -43,7 +43,6 @@ class SdUnoSearchReplaceDescriptor;
 class SdUnoSearchReplaceShape : public css::util::XReplaceable
 {
 protected:
-    css::drawing::XShape* mpShape;
     css::drawing::XDrawPage* mpPage;
 
     css::uno::Reference< css::text::XTextRange >  Search( const css::uno::Reference< css::text::XTextRange >&  xText, SdUnoSearchReplaceDescriptor* pDescr ) throw();
diff --git a/sd/source/ui/presenter/PresenterCanvas.cxx b/sd/source/ui/presenter/PresenterCanvas.cxx
index dc74ca43d4a4..67154a396bc8 100644
--- a/sd/source/ui/presenter/PresenterCanvas.cxx
+++ b/sd/source/ui/presenter/PresenterCanvas.cxx
@@ -107,7 +107,6 @@ PresenterCanvas::PresenterCanvas (
       mxSharedWindow(rxSharedWindow),
       mxWindow(rxWindow),
       maOffset(),
-      maClipRectangle(),
       mbOffsetUpdatePending(true)
 {
     if (mxWindow.is())
@@ -589,22 +588,8 @@ awt::Point PresenterCanvas::GetOffset (const Reference<awt::XWindow>& rxBaseWind
 
     // Get the bounding box of the window and create a range in the
     // coordinate system of the child window.
-    ::tools::Rectangle aLocalClip;
-    if (maClipRectangle.Width <= 0 || maClipRectangle.Height <= 0)
-    {
-        // No clip rectangle has been set via SetClip by the pane.
-        // Use the window extents instead.
-        aLocalClip = pWindow->GetWindowExtentsRelative(pSharedWindow);
-    }
-    else
-    {
-        // Use a previously given clip rectangle.
-        aLocalClip = ::tools::Rectangle(
-            maClipRectangle.X + rOffset.X,
-            maClipRectangle.Y + rOffset.Y,
-            maClipRectangle.X + maClipRectangle.Width + rOffset.X,
-            maClipRectangle.Y + maClipRectangle.Height + rOffset.Y);
-    }
+    // Use the window extents.
+    ::tools::Rectangle aLocalClip = pWindow->GetWindowExtentsRelative(pSharedWindow);
 
     // The local clip rectangle is used to clip the view state clipping
     // polygon.
diff --git a/sd/source/ui/presenter/PresenterCanvas.hxx b/sd/source/ui/presenter/PresenterCanvas.hxx
index 76555ac88c31..071a234bdbdb 100644
--- a/sd/source/ui/presenter/PresenterCanvas.hxx
+++ b/sd/source/ui/presenter/PresenterCanvas.hxx
@@ -301,10 +301,6 @@ private:
     */
     std::shared_ptr<CanvasUpdateRequester> m_pUpdateRequester;
 
-    /** The clip rectangle as given to SetClip().
-    */
-    css::awt::Rectangle maClipRectangle;
-
     /** When this flag is true (it is set to true after every call to
         updateScreen()) then the next call to MergeViewState updates the
         maOffset member.  A possible optimization would set this flag only
diff --git a/sd/source/ui/sidebar/LayoutMenu.cxx b/sd/source/ui/sidebar/LayoutMenu.cxx
index 1c6782d424a8..801d646345c3 100644
--- a/sd/source/ui/sidebar/LayoutMenu.cxx
+++ b/sd/source/ui/sidebar/LayoutMenu.cxx
@@ -129,7 +129,6 @@ LayoutMenu::LayoutMenu (
       DragSourceHelper(this),
       DropTargetHelper(this),
       mrBase(rViewShellBase),
-      mbUseOwnScrollBar(false),
       mxListener(nullptr),
       mbSelectionUpdatePending(true),
       mbIsMainViewChangePending(false),
@@ -162,8 +161,6 @@ void LayoutMenu::implConstruct( DrawDocShell& rDocumentShell )
         | WB_MENUSTYLEVALUESET
         | WB_NO_DIRECTSELECT
         );
-    if (mbUseOwnScrollBar)
-        SetStyle (GetStyle() | WB_VSCROLL);
     SetExtraSpacing(2);
     SetSelectHdl (LINK(this, LayoutMenu, ClickHandler));
     InvalidateContent();
@@ -237,7 +234,7 @@ AutoLayout LayoutMenu::GetSelectedAutoLayout()
 ui::LayoutSize LayoutMenu::GetHeightForWidth (const sal_Int32 nWidth)
 {
     sal_Int32 nPreferredHeight = 200;
-    if ( ! mbUseOwnScrollBar && GetItemCount()>0)
+    if (GetItemCount()>0)
     {
         Image aImage = GetItemImage(GetItemId(0));
         Size aItemSize = CalcItemSizePixel (aImage.GetSizePixel());
diff --git a/sd/source/ui/sidebar/LayoutMenu.hxx b/sd/source/ui/sidebar/LayoutMenu.hxx
index 9aa001d066f8..2b5823f9f92f 100644
--- a/sd/source/ui/sidebar/LayoutMenu.hxx
+++ b/sd/source/ui/sidebar/LayoutMenu.hxx
@@ -122,11 +122,6 @@ public:
 private:
     ViewShellBase& mrBase;
 
-    /** Do we use our own scroll bar or is viewport handling done by
-        our parent?
-    */
-    bool mbUseOwnScrollBar;
-
     /** If we are asked for the preferred window size, then use this
         many columns for the calculation.
     */
diff --git a/sd/source/ui/sidebar/PanelBase.cxx b/sd/source/ui/sidebar/PanelBase.cxx
index 3a342ef95e1a..0a6e0fbb7770 100644
--- a/sd/source/ui/sidebar/PanelBase.cxx
+++ b/sd/source/ui/sidebar/PanelBase.cxx
@@ -26,7 +26,6 @@ PanelBase::PanelBase (
     ViewShellBase& rViewShellBase)
     : Control(pParentWindow),
       mpWrappedControl(nullptr),
-      mxSidebar(),
       mrViewShellBase(rViewShellBase)
 {
 #ifdef DEBUG
@@ -69,8 +68,6 @@ bool PanelBase::ProvideWrappedControl()
         mpWrappedControl.reset(CreateWrappedControl(this, mrViewShellBase));
         if (mpWrappedControl)
             mpWrappedControl->Show();
-        if (mxSidebar.is())
-            mxSidebar->requestLayout();
     }
     return mpWrappedControl.get() != nullptr;
 }
diff --git a/sd/source/ui/sidebar/PanelBase.hxx b/sd/source/ui/sidebar/PanelBase.hxx
index 6d2dfb7b9b41..9d28cecec0a7 100644
--- a/sd/source/ui/sidebar/PanelBase.hxx
+++ b/sd/source/ui/sidebar/PanelBase.hxx
@@ -59,7 +59,6 @@ protected:
         ViewShellBase& rViewShellBase) = 0;
 
 private:
-    css::uno::Reference<css::ui::XSidebar> mxSidebar;
     ViewShellBase& mrViewShellBase;
 
     bool ProvideWrappedControl();
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index b7de3cd93df0..96bf0ed6261e 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -2679,25 +2679,6 @@ void SAL_CALL SdXImpressDocument::dispose()
             SfxBaseModel::dispose();
             mbDisposed = true;
 
-            uno::Reference< container::XNameAccess > xStyles(mxStyleFamilies);
-            if( xStyles.is() )
-            {
-                uno::Reference< lang::XComponent > xComp( xStyles, uno::UNO_QUERY );
-                if( xComp.is() )
-                    xComp->dispose();
-
-                xStyles = nullptr;
-            }
-
-            uno::Reference< presentation::XPresentation > xPresentation( mxPresentation );
-            if( xPresentation.is() )
-            {
-                uno::Reference< css::presentation::XPresentation2 > xPres( mpDoc->getPresentation().get() );
-                uno::Reference< lang::XComponent > xPresComp( xPres, uno::UNO_QUERY );
-                if( xPresComp.is() )
-                    xPresComp->dispose();
-            }
-
             uno::Reference< container::XNameAccess > xLinks( mxLinks );
             if( xLinks.is() )
             {
diff --git a/sd/source/ui/unoidl/unosrch.cxx b/sd/source/ui/unoidl/unosrch.cxx
index f51b7481be6c..98f966079017 100644
--- a/sd/source/ui/unoidl/unosrch.cxx
+++ b/sd/source/ui/unoidl/unosrch.cxx
@@ -88,8 +88,7 @@ public:
   */
 
 SdUnoSearchReplaceShape::SdUnoSearchReplaceShape( drawing::XDrawPage* pPage ) throw()
-    : mpShape(nullptr)
-    , mpPage(pPage)
+    : mpPage(pPage)
 {
 }
 
@@ -131,10 +130,6 @@ sal_Int32 SAL_CALL SdUnoSearchReplaceShape::replaceAll( const uno::Reference< ut
             xShapes = nullptr;
         }
     }
-    else
-    {
-        xShape = mpShape;
-    }
 
     while( xShape.is() )
     {
@@ -231,10 +226,7 @@ uno::Reference< css::container::XIndexAccess > SAL_CALL SdUnoSearchReplaceShape:
             xShapes = nullptr;
         }
     }
-    else
-    {
-        xShape = mpShape;
-    }
+
     while( xShape.is() )
     {
         // find in xShape
@@ -330,10 +322,6 @@ uno::Reference< drawing::XShape >  SdUnoSearchReplaceShape::GetCurrentShape() co
             }
         }
     }
-    else if( mpShape )
-    {
-        xShape = mpShape;
-    }
 
     return xShape;
 
diff --git a/sd/source/ui/view/ViewShellManager.cxx b/sd/source/ui/view/ViewShellManager.cxx
index a1968d06b84a..54d79200213f 100644
--- a/sd/source/ui/view/ViewShellManager.cxx
+++ b/sd/source/ui/view/ViewShellManager.cxx
@@ -58,7 +58,6 @@ public:
     explicit ShellDescriptor (ShellId nId);
     ShellDescriptor (const ShellDescriptor& rDescriptor);
     ShellDescriptor& operator= (const ShellDescriptor& rDescriptor);
-    bool IsMainViewShell() const;
     vcl::Window* GetWindow() const;
 };
 
@@ -174,11 +173,6 @@ private:
 
     int mnUpdateLockCount;
 
-    /** When this flag is set then the main view shell is always kept at the
-        top of the shell stack.
-    */
-    bool mbKeepMainViewShellOnTop;
-
     /** The UpdateShellStack() method can be called recursively.  This flag
         is used to communicate between different levels of invocation: if
         the stack has been updated in an inner call the outer call can (has
@@ -361,7 +355,6 @@ ViewShellManager::Implementation::Implementation (
       maShellFactories(),
       maActiveViewShells(),
       mnUpdateLockCount(0),
-      mbKeepMainViewShellOnTop(false),
       mbShellStackIsUpToDate(true),
       mpFormShell(nullptr),
       mpFormShellParent(nullptr),
@@ -485,22 +478,7 @@ void ViewShellManager::Implementation::ActivateShell (const ShellDescriptor& rDe
     // Put shell on top of the active view shells.
     if (rDescriptor.mpShell != nullptr)
     {
-        // Determine where to put the view shell on the stack.  By default
-        // it is put on top of the stack.  When the view shell of the center
-        // pane is to be kept top most and the new view shell is not
-        // displayed in the center pane then it is inserted at the position
-        // one below the top.
-        ActiveShellList::iterator iInsertPosition (maActiveViewShells.begin());
-        if (iInsertPosition != maActiveViewShells.end()
-            && mbKeepMainViewShellOnTop
-            && ! rDescriptor.IsMainViewShell()
-            && iInsertPosition->IsMainViewShell())
-        {
-            ++iInsertPosition;
-        }
-        maActiveViewShells.insert(
-            iInsertPosition,
-            rDescriptor);
+        maActiveViewShells.insert( maActiveViewShells.begin(), rDescriptor);
     }
 }
 
@@ -621,23 +599,13 @@ void ViewShellManager::Implementation::MoveToTop (const SfxShell& rShell)
         // the case in mind that mbKeepMainViewShellOnTop is true.  Shells
         // that are not the main view shell are placed on the second-to-top
         // position in this case.
-            if (iShell == maActiveViewShells.begin()
-            && (iShell->IsMainViewShell() || ! mbKeepMainViewShellOnTop))
+        if (iShell == maActiveViewShells.begin())
         {
             // The shell is at the top position and is either a) the main
             // view shell or b) another shell but the main view shell is not
             // kept at the top position.  We do not have to move the shell.
             bMove = false;
         }
-        else if (iShell == ++maActiveViewShells.begin()
-            && ! iShell->IsMainViewShell()
-            && mbKeepMainViewShellOnTop)
-        {
-            // The shell is a the second-to-top position, not the main view
-            // shell and the main view shell is kept at the top position.
-            // Therefore we do not have to move the shell.
-            bMove = false;
-        }
     }
     else
     {
@@ -658,15 +626,7 @@ void ViewShellManager::Implementation::MoveToTop (const SfxShell& rShell)
         TakeShellsFromStack(&rShell);
         maActiveViewShells.erase(iShell);
 
-        // Find out whether to insert at the top or one below.
-        ActiveShellList::iterator aInsertPosition (maActiveViewShells.begin());
-        if (mbKeepMainViewShellOnTop && ! aDescriptor.IsMainViewShell())
-        {
-            if (maActiveViewShells.back().IsMainViewShell())
-                ++aInsertPosition;
-        }
-
-        maActiveViewShells.insert(aInsertPosition, aDescriptor);
+        maActiveViewShells.insert(maActiveViewShells.begin(), aDescriptor);
     }
 }
 
@@ -1234,15 +1194,6 @@ ShellDescriptor& ShellDescriptor::operator= (const ShellDescriptor& rDescriptor)
     return *this;
 }
 
-bool ShellDescriptor::IsMainViewShell() const
-{
-    ViewShell* pViewShell = dynamic_cast<ViewShell*>(mpShell);
-    if (pViewShell != nullptr)
-        return pViewShell->IsMainViewShell();
-    else
-        return false;
-}
-
 vcl::Window* ShellDescriptor::GetWindow() const
 {
     ViewShell* pViewShell = dynamic_cast<ViewShell*>(mpShell);


More information about the Libreoffice-commits mailing list