loplugin:unusedfields in sd

Change-Id: I7f89e038f3d9bd0da658c7d3b8faec23d8a593db
Reviewed-on: https://gerrit.libreoffice.org/40257
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2017-07-20 16:29:48 +02:00
parent 5e4b4eecb1
commit cf530f290d
19 changed files with 11 additions and 225 deletions

View File

@@ -1058,24 +1058,6 @@ sd/source/filter/eppt/epptbase.hxx:279
PPTExParaSheet maParaLevel struct PPTExParaLevel [5] PPTExParaSheet maParaLevel struct PPTExParaLevel [5]
sd/source/filter/ppt/propread.hxx:142 sd/source/filter/ppt/propread.hxx:142
PropRead mApplicationCLSID sal_uInt8 [16] 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/source/ui/sidebar/MasterPageContainer.cxx:148
sd::sidebar::MasterPageContainer::Implementation maLargePreviewBeingCreated class Image sd::sidebar::MasterPageContainer::Implementation maLargePreviewBeingCreated class Image
sd/source/ui/sidebar/MasterPageContainer.cxx:149 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::sidebar::MasterPageContainer::Implementation maLargePreviewNotAvailable class Image
sd/source/ui/sidebar/MasterPageContainer.cxx:155 sd/source/ui/sidebar/MasterPageContainer.cxx:155
sd::sidebar::MasterPageContainer::Implementation maSmallPreviewNotAvailable class Image 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/source/ui/slidesorter/inc/controller/SlsAnimator.hxx:97
sd::slidesorter::controller::Animator maElapsedTime ::canvas::tools::ElapsedTime 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 sdext/source/pdfimport/pdfparse/pdfentries.cxx:1018
pdfparse::PDFFileImplData m_aOEntry sal_uInt8 [32] pdfparse::PDFFileImplData m_aOEntry sal_uInt8 [32]
sdext/source/pdfimport/pdfparse/pdfentries.cxx:1019 sdext/source/pdfimport/pdfparse/pdfentries.cxx:1019

View File

@@ -81,11 +81,7 @@ IMPL_LINK_NOARG(CategoryListBox, implDoubleClickHdl, ListBox&, void)
void CategoryListBox::MouseButtonUp( const MouseEvent& rMEvt ) void CategoryListBox::MouseButtonUp( const MouseEvent& rMEvt )
{ {
ReleaseMouse(); ReleaseMouse();
if( rMEvt.IsLeft() && (rMEvt.GetClicks() == 2) ) if (!( rMEvt.IsLeft() && (rMEvt.GetClicks() == 2) ))
{
maDoubleClickHdl.Call( *this );
}
else
{ {
ListBox::MouseButtonUp( rMEvt ); ListBox::MouseButtonUp( rMEvt );
} }

View File

@@ -39,8 +39,6 @@ public:
private: private:
virtual void UserDraw( const UserDrawEvent& rUDEvt ) SAL_OVERRIDE; virtual void UserDraw( const UserDrawEvent& rUDEvt ) SAL_OVERRIDE;
Link<CategoryListBox&,void> maDoubleClickHdl;
}; };
} }

View File

@@ -64,7 +64,6 @@ ClientBox::ClientBox( vcl::Window* pParent, WinBits nStyle ) :
m_bHasScrollBar( false ), m_bHasScrollBar( false ),
m_bHasActive( false ), m_bHasActive( false ),
m_bNeedsRecalc( true ), m_bNeedsRecalc( true ),
m_bInCheckMode( false ),
m_bAdjustActive( false ), m_bAdjustActive( false ),
m_bInDelete( false ), m_bInDelete( false ),
m_nActive( 0 ), m_nActive( 0 ),
@@ -219,9 +218,6 @@ void ClientBox::selectEntry( const long nPos )
//the whole painting operation. See issue i86993 //the whole painting operation. See issue i86993
::osl::ClearableMutexGuard guard(m_entriesMutex); ::osl::ClearableMutexGuard guard(m_entriesMutex);
if ( m_bInCheckMode )
return;
if ( m_bHasActive ) if ( m_bHasActive )
{ {
if ( nPos == m_nActive ) if ( nPos == m_nActive )
@@ -633,18 +629,11 @@ void ClientBox::addEntry( const std::shared_ptr<ClientInfo>& pClientInfo )
} }
else else
{ {
// if ( !FindEntryPos( xEntry, 0, m_vEntries.size()-1, nPos ) ) m_vEntries.insert( m_vEntries.begin()+nPos, xEntry );
// {
m_vEntries.insert( m_vEntries.begin()+nPos, xEntry );
// }
// else if ( !m_bInCheckMode )
// {
// OSL_FAIL( "ClientBox::addEntry(): Will not add duplicate entries" );
// }
} }
//access to m_nActive must be guarded //access to m_nActive must be guarded
if ( !m_bInCheckMode && m_bHasActive && ( m_nActive >= nPos ) ) if ( m_bHasActive && ( m_nActive >= nPos ) )
m_nActive += 1; m_nActive += 1;
guard.clear(); guard.clear();

View File

@@ -88,7 +88,6 @@ class ClientBox : public Control
bool m_bHasScrollBar : 1; bool m_bHasScrollBar : 1;
bool m_bHasActive : 1; bool m_bHasActive : 1;
bool m_bNeedsRecalc : 1; bool m_bNeedsRecalc : 1;
bool m_bInCheckMode : 1;
bool m_bAdjustActive : 1; bool m_bAdjustActive : 1;
bool m_bInDelete : 1; bool m_bInDelete : 1;
//Must be guarded together with m_vEntries to ensure a valid index at all times. //Must be guarded together with m_vEntries to ensure a valid index at all times.

View File

@@ -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() void SdDocPreviewWin::updateViewSettings()
{ {
SvtAccessibilityOptions aAccOptions; SvtAccessibilityOptions aAccOptions;

View File

@@ -52,12 +52,9 @@ private:
css::uno::Reference< css::media::XPlayer > mxPlayer; css::uno::Reference< css::media::XPlayer > mxPlayer;
ImplSVEvent * mnPlaySoundEvent; ImplSVEvent * mnPlaySoundEvent;
bool mbUsableSelection;
bool mbLabelPlaying; bool mbLabelPlaying;
Idle maUpdateIdle; Idle maUpdateIdle;
void CheckSelectionState();
DECL_LINK( PlayMusicHdl, void *, void ); DECL_LINK( PlayMusicHdl, void *, void );
DECL_LINK( IsMusicStoppedHdl, Timer *, void ); DECL_LINK( IsMusicStoppedHdl, Timer *, void );
@@ -65,8 +62,6 @@ public:
explicit SdFileDialog_Imp(); explicit SdFileDialog_Imp();
virtual ~SdFileDialog_Imp() override; virtual ~SdFileDialog_Imp() override;
ErrCode Execute();
// overwritten from FileDialogHelper, to receive user feedback // overwritten from FileDialogHelper, to receive user feedback
virtual void SAL_CALL ControlStateChanged( const css::ui::dialogs::FilePickerEvent& aEvent ) override; 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 ) switch( aEvent.ElementId )
{ {
case css::ui::dialogs::CommonFilePickerElementIds::LISTBOX_FILTER:
CheckSelectionState();
break;
case css::ui::dialogs::ExtendedFilePickerElementIds::PUSHBUTTON_PLAY: case css::ui::dialogs::ExtendedFilePickerElementIds::PUSHBUTTON_PLAY:
if( mxControlAccess.is() ) 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() : SdFileDialog_Imp::SdFileDialog_Imp() :
FileDialogHelper( css::ui::dialogs::TemplateDescription::FILEOPEN_LINK_PLAY ), FileDialogHelper( css::ui::dialogs::TemplateDescription::FILEOPEN_LINK_PLAY ),
mnPlaySoundEvent( nullptr ), mnPlaySoundEvent( nullptr ),
mbUsableSelection( false ),
mbLabelPlaying(false) mbLabelPlaying(false)
{ {
maUpdateIdle.SetInvokeHandler(LINK(this, SdFileDialog_Imp, IsMusicStoppedHdl)); maUpdateIdle.SetInvokeHandler(LINK(this, SdFileDialog_Imp, IsMusicStoppedHdl));
@@ -242,13 +209,6 @@ SdFileDialog_Imp::~SdFileDialog_Imp()
Application::RemoveUserEvent( mnPlaySoundEvent ); Application::RemoveUserEvent( mnPlaySoundEvent );
} }
ErrCode SdFileDialog_Imp::Execute()
{
// make sure selection checkbox is disabled if HTML is current filter!
CheckSelectionState();
return FileDialogHelper::Execute();
}
// ----------- SdOpenSoundFileDialog ----------------------- // ----------- SdOpenSoundFileDialog -----------------------
// these are simple forwarders // these are simple forwarders

View File

@@ -38,7 +38,6 @@ namespace sd {
class SD_DLLPUBLIC SdDocPreviewWin : public Control, public SfxListener class SD_DLLPUBLIC SdDocPreviewWin : public Control, public SfxListener
{ {
protected: protected:
Link<SdDocPreviewWin&,void> aClickHdl;
Color maDocumentColor; Color maDocumentColor;
rtl::Reference< sd::SlideShow > mxSlideShow; rtl::Reference< sd::SlideShow > mxSlideShow;
@@ -59,8 +58,6 @@ public:
virtual void dispose() override; virtual void dispose() override;
virtual void Resize() override; virtual void Resize() override;
virtual bool EventNotify( NotifyEvent& rNEvt ) override;
virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
}; };

View File

@@ -107,8 +107,6 @@ private:
css::uno::WeakReference< css::drawing::XDrawPages > mxMasterPagesAccess; css::uno::WeakReference< css::drawing::XDrawPages > mxMasterPagesAccess;
css::uno::WeakReference< css::container::XNameAccess > mxLayerManager; css::uno::WeakReference< css::container::XNameAccess > mxLayerManager;
css::uno::WeakReference< css::container::XNameContainer > mxCustomPresentationAccess; 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::WeakReference< css::i18n::XForbiddenCharacters > mxForbiddenCharacters;
css::uno::Reference< css::container::XNameAccess > mxLinks; css::uno::Reference< css::container::XNameAccess > mxLinks;

View File

@@ -43,7 +43,6 @@ class SdUnoSearchReplaceDescriptor;
class SdUnoSearchReplaceShape : public css::util::XReplaceable class SdUnoSearchReplaceShape : public css::util::XReplaceable
{ {
protected: protected:
css::drawing::XShape* mpShape;
css::drawing::XDrawPage* mpPage; css::drawing::XDrawPage* mpPage;
css::uno::Reference< css::text::XTextRange > Search( const css::uno::Reference< css::text::XTextRange >& xText, SdUnoSearchReplaceDescriptor* pDescr ) throw(); css::uno::Reference< css::text::XTextRange > Search( const css::uno::Reference< css::text::XTextRange >& xText, SdUnoSearchReplaceDescriptor* pDescr ) throw();

View File

@@ -107,7 +107,6 @@ PresenterCanvas::PresenterCanvas (
mxSharedWindow(rxSharedWindow), mxSharedWindow(rxSharedWindow),
mxWindow(rxWindow), mxWindow(rxWindow),
maOffset(), maOffset(),
maClipRectangle(),
mbOffsetUpdatePending(true) mbOffsetUpdatePending(true)
{ {
if (mxWindow.is()) 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 // Get the bounding box of the window and create a range in the
// coordinate system of the child window. // coordinate system of the child window.
::tools::Rectangle aLocalClip; // Use the window extents.
if (maClipRectangle.Width <= 0 || maClipRectangle.Height <= 0) ::tools::Rectangle aLocalClip = pWindow->GetWindowExtentsRelative(pSharedWindow);
{
// 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);
}
// The local clip rectangle is used to clip the view state clipping // The local clip rectangle is used to clip the view state clipping
// polygon. // polygon.

View File

@@ -301,10 +301,6 @@ private:
*/ */
std::shared_ptr<CanvasUpdateRequester> m_pUpdateRequester; 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 /** When this flag is true (it is set to true after every call to
updateScreen()) then the next call to MergeViewState updates the updateScreen()) then the next call to MergeViewState updates the
maOffset member. A possible optimization would set this flag only maOffset member. A possible optimization would set this flag only

View File

@@ -129,7 +129,6 @@ LayoutMenu::LayoutMenu (
DragSourceHelper(this), DragSourceHelper(this),
DropTargetHelper(this), DropTargetHelper(this),
mrBase(rViewShellBase), mrBase(rViewShellBase),
mbUseOwnScrollBar(false),
mxListener(nullptr), mxListener(nullptr),
mbSelectionUpdatePending(true), mbSelectionUpdatePending(true),
mbIsMainViewChangePending(false), mbIsMainViewChangePending(false),
@@ -162,8 +161,6 @@ void LayoutMenu::implConstruct( DrawDocShell& rDocumentShell )
| WB_MENUSTYLEVALUESET | WB_MENUSTYLEVALUESET
| WB_NO_DIRECTSELECT | WB_NO_DIRECTSELECT
); );
if (mbUseOwnScrollBar)
SetStyle (GetStyle() | WB_VSCROLL);
SetExtraSpacing(2); SetExtraSpacing(2);
SetSelectHdl (LINK(this, LayoutMenu, ClickHandler)); SetSelectHdl (LINK(this, LayoutMenu, ClickHandler));
InvalidateContent(); InvalidateContent();
@@ -237,7 +234,7 @@ AutoLayout LayoutMenu::GetSelectedAutoLayout()
ui::LayoutSize LayoutMenu::GetHeightForWidth (const sal_Int32 nWidth) ui::LayoutSize LayoutMenu::GetHeightForWidth (const sal_Int32 nWidth)
{ {
sal_Int32 nPreferredHeight = 200; sal_Int32 nPreferredHeight = 200;
if ( ! mbUseOwnScrollBar && GetItemCount()>0) if (GetItemCount()>0)
{ {
Image aImage = GetItemImage(GetItemId(0)); Image aImage = GetItemImage(GetItemId(0));
Size aItemSize = CalcItemSizePixel (aImage.GetSizePixel()); Size aItemSize = CalcItemSizePixel (aImage.GetSizePixel());

View File

@@ -122,11 +122,6 @@ public:
private: private:
ViewShellBase& mrBase; 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 /** If we are asked for the preferred window size, then use this
many columns for the calculation. many columns for the calculation.
*/ */

View File

@@ -26,7 +26,6 @@ PanelBase::PanelBase (
ViewShellBase& rViewShellBase) ViewShellBase& rViewShellBase)
: Control(pParentWindow), : Control(pParentWindow),
mpWrappedControl(nullptr), mpWrappedControl(nullptr),
mxSidebar(),
mrViewShellBase(rViewShellBase) mrViewShellBase(rViewShellBase)
{ {
#ifdef DEBUG #ifdef DEBUG
@@ -69,8 +68,6 @@ bool PanelBase::ProvideWrappedControl()
mpWrappedControl.reset(CreateWrappedControl(this, mrViewShellBase)); mpWrappedControl.reset(CreateWrappedControl(this, mrViewShellBase));
if (mpWrappedControl) if (mpWrappedControl)
mpWrappedControl->Show(); mpWrappedControl->Show();
if (mxSidebar.is())
mxSidebar->requestLayout();
} }
return mpWrappedControl.get() != nullptr; return mpWrappedControl.get() != nullptr;
} }

View File

@@ -59,7 +59,6 @@ protected:
ViewShellBase& rViewShellBase) = 0; ViewShellBase& rViewShellBase) = 0;
private: private:
css::uno::Reference<css::ui::XSidebar> mxSidebar;
ViewShellBase& mrViewShellBase; ViewShellBase& mrViewShellBase;
bool ProvideWrappedControl(); bool ProvideWrappedControl();

View File

@@ -2679,25 +2679,6 @@ void SAL_CALL SdXImpressDocument::dispose()
SfxBaseModel::dispose(); SfxBaseModel::dispose();
mbDisposed = true; 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 ); uno::Reference< container::XNameAccess > xLinks( mxLinks );
if( xLinks.is() ) if( xLinks.is() )
{ {

View File

@@ -88,8 +88,7 @@ public:
*/ */
SdUnoSearchReplaceShape::SdUnoSearchReplaceShape( drawing::XDrawPage* pPage ) throw() 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; xShapes = nullptr;
} }
} }
else
{
xShape = mpShape;
}
while( xShape.is() ) while( xShape.is() )
{ {
@@ -231,10 +226,7 @@ uno::Reference< css::container::XIndexAccess > SAL_CALL SdUnoSearchReplaceShape:
xShapes = nullptr; xShapes = nullptr;
} }
} }
else
{
xShape = mpShape;
}
while( xShape.is() ) while( xShape.is() )
{ {
// find in xShape // find in xShape
@@ -330,10 +322,6 @@ uno::Reference< drawing::XShape > SdUnoSearchReplaceShape::GetCurrentShape() co
} }
} }
} }
else if( mpShape )
{
xShape = mpShape;
}
return xShape; return xShape;

View File

@@ -58,7 +58,6 @@ public:
explicit ShellDescriptor (ShellId nId); explicit ShellDescriptor (ShellId nId);
ShellDescriptor (const ShellDescriptor& rDescriptor); ShellDescriptor (const ShellDescriptor& rDescriptor);
ShellDescriptor& operator= (const ShellDescriptor& rDescriptor); ShellDescriptor& operator= (const ShellDescriptor& rDescriptor);
bool IsMainViewShell() const;
vcl::Window* GetWindow() const; vcl::Window* GetWindow() const;
}; };
@@ -174,11 +173,6 @@ private:
int mnUpdateLockCount; 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 /** The UpdateShellStack() method can be called recursively. This flag
is used to communicate between different levels of invocation: if is used to communicate between different levels of invocation: if
the stack has been updated in an inner call the outer call can (has the stack has been updated in an inner call the outer call can (has
@@ -361,7 +355,6 @@ ViewShellManager::Implementation::Implementation (
maShellFactories(), maShellFactories(),
maActiveViewShells(), maActiveViewShells(),
mnUpdateLockCount(0), mnUpdateLockCount(0),
mbKeepMainViewShellOnTop(false),
mbShellStackIsUpToDate(true), mbShellStackIsUpToDate(true),
mpFormShell(nullptr), mpFormShell(nullptr),
mpFormShellParent(nullptr), mpFormShellParent(nullptr),
@@ -485,22 +478,7 @@ void ViewShellManager::Implementation::ActivateShell (const ShellDescriptor& rDe
// Put shell on top of the active view shells. // Put shell on top of the active view shells.
if (rDescriptor.mpShell != nullptr) if (rDescriptor.mpShell != nullptr)
{ {
// Determine where to put the view shell on the stack. By default maActiveViewShells.insert( maActiveViewShells.begin(), rDescriptor);
// 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);
} }
} }
@@ -621,23 +599,13 @@ void ViewShellManager::Implementation::MoveToTop (const SfxShell& rShell)
// the case in mind that mbKeepMainViewShellOnTop is true. Shells // the case in mind that mbKeepMainViewShellOnTop is true. Shells
// that are not the main view shell are placed on the second-to-top // that are not the main view shell are placed on the second-to-top
// position in this case. // position in this case.
if (iShell == maActiveViewShells.begin() if (iShell == maActiveViewShells.begin())
&& (iShell->IsMainViewShell() || ! mbKeepMainViewShellOnTop))
{ {
// The shell is at the top position and is either a) the main // 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 // 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. // kept at the top position. We do not have to move the shell.
bMove = false; 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 else
{ {
@@ -658,15 +626,7 @@ void ViewShellManager::Implementation::MoveToTop (const SfxShell& rShell)
TakeShellsFromStack(&rShell); TakeShellsFromStack(&rShell);
maActiveViewShells.erase(iShell); maActiveViewShells.erase(iShell);
// Find out whether to insert at the top or one below. maActiveViewShells.insert(maActiveViewShells.begin(), aDescriptor);
ActiveShellList::iterator aInsertPosition (maActiveViewShells.begin());
if (mbKeepMainViewShellOnTop && ! aDescriptor.IsMainViewShell())
{
if (maActiveViewShells.back().IsMainViewShell())
++aInsertPosition;
}
maActiveViewShells.insert(aInsertPosition, aDescriptor);
} }
} }
@@ -1234,15 +1194,6 @@ ShellDescriptor& ShellDescriptor::operator= (const ShellDescriptor& rDescriptor)
return *this; 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 vcl::Window* ShellDescriptor::GetWindow() const
{ {
ViewShell* pViewShell = dynamic_cast<ViewShell*>(mpShell); ViewShell* pViewShell = dynamic_cast<ViewShell*>(mpShell);