summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-06-23 15:20:23 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-06-24 08:12:28 +0000
commit1506b14a7ed546c3e78625eaac667bdd5e60f57f (patch)
treec73e9ab2b69a74af4c3a6bcc67413e97b0529e8f /sfx2
parent0c73e7364b2fe4a8b24eca536f60a7a4228ddb25 (diff)
loplugin:singlevalfields in sfx2
Change-Id: Ice6d47ccbc3ebf8971887b8b64c0d6860c76eec8 Reviewed-on: https://gerrit.libreoffice.org/26602 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/appdata.cxx1
-rw-r--r--sfx2/source/appl/childwin.cxx7
-rw-r--r--sfx2/source/appl/workwin.cxx17
-rw-r--r--sfx2/source/control/objface.cxx4
-rw-r--r--sfx2/source/control/thumbnailview.cxx13
-rw-r--r--sfx2/source/dialog/tabdlg.cxx6
-rw-r--r--sfx2/source/doc/doctempl.cxx4
-rw-r--r--sfx2/source/doc/objmisc.cxx14
-rw-r--r--sfx2/source/doc/objxtor.cxx2
-rw-r--r--sfx2/source/doc/templatedlg.cxx31
-rw-r--r--sfx2/source/explorer/nochaos.cxx5
-rw-r--r--sfx2/source/inc/appdata.hxx1
-rw-r--r--sfx2/source/inc/objshimp.hxx2
-rw-r--r--sfx2/source/inc/workwin.hxx10
-rw-r--r--sfx2/source/sidebar/DeckTitleBar.cxx1
-rw-r--r--sfx2/source/sidebar/MenuButton.cxx50
-rw-r--r--sfx2/source/sidebar/PanelTitleBar.cxx1
-rw-r--r--sfx2/source/sidebar/SidebarController.cxx18
-rw-r--r--sfx2/source/sidebar/TabItem.cxx32
-rw-r--r--sfx2/source/view/impviewframe.hxx2
-rw-r--r--sfx2/source/view/viewfrm.cxx49
-rw-r--r--sfx2/source/view/viewimp.hxx1
-rw-r--r--sfx2/source/view/viewsh.cxx3
23 files changed, 68 insertions, 206 deletions
diff --git a/sfx2/source/appl/appdata.cxx b/sfx2/source/appl/appdata.cxx
index 92a315b825a1..e60ec8a6ef83 100644
--- a/sfx2/source/appl/appdata.cxx
+++ b/sfx2/source/appl/appdata.cxx
@@ -104,7 +104,6 @@ SfxAppData_Impl::SfxAppData_Impl( SfxApplication* )
, pPool(nullptr)
, pProgress(nullptr)
, nDocModalMode(0)
- , nAutoTabPageId(0)
, nRescheduleLocks(0)
, nInReschedule(0)
, m_xImeStatusWindow(new sfx2::appl::ImeStatusWindow(comphelper::getProcessComponentContext()))
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx
index 116e3865d325..1d1fdb8ed16f 100644
--- a/sfx2/source/appl/childwin.cxx
+++ b/sfx2/source/appl/childwin.cxx
@@ -61,7 +61,6 @@ struct SfxChildWindow_Impl
SfxChildWinFactory* pFact;
bool bHideNotDelete;
bool bVisible;
- bool bHideAtToggle;
bool bWantsFocus;
SfxModule* pContextModule;
SfxWorkWindow* pWorkWin;
@@ -162,7 +161,6 @@ SfxChildWindow::SfxChildWindow(vcl::Window *pParentWindow, sal_uInt16 nId)
{
pImpl->pFact = nullptr;
pImpl->bHideNotDelete = false;
- pImpl->bHideAtToggle = false;
pImpl->bWantsFocus = true;
pImpl->bVisible = true;
pImpl->pContextModule = nullptr;
@@ -558,11 +556,6 @@ bool SfxChildWindow::IsHideNotDelete() const
return pImpl->bHideNotDelete;
}
-bool SfxChildWindow::IsHideAtToggle() const
-{
- return pImpl->bHideAtToggle;
-}
-
void SfxChildWindow::SetWantsFocus( bool bSet )
{
pImpl->bWantsFocus = bSet;
diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
index 537405c13447..0b7711bfb1ae 100644
--- a/sfx2/source/appl/workwin.cxx
+++ b/sfx2/source/appl/workwin.cxx
@@ -1295,7 +1295,7 @@ void SfxWorkWindow::UpdateChildWindows_Impl()
{
SfxChildWindow *pChildWin = pCW->pWin;
bool bCreate = false;
- if ( pCW->nId && !pCW->bDisabled && (pCW->aInfo.nFlags & SfxChildWindowFlags::ALWAYSAVAILABLE || IsVisible_Impl( pCW->nVisibility ) ) )
+ if ( pCW->nId && (pCW->aInfo.nFlags & SfxChildWindowFlags::ALWAYSAVAILABLE || IsVisible_Impl( pCW->nVisibility ) ) )
{
// In the context is an appropriate ChildWindow allowed;
// it is also turned on?
@@ -1493,7 +1493,7 @@ void SfxWorkWindow::UpdateStatusBar_Impl()
// No status bar, if no ID is required or when in FullScreenView or
// if disabled
if ( aStatBar.nId && IsDockingAllowed() && bInternalDockingAllowed && bShowStatusBar &&
- ( (aStatBar.bOn && !bIsFullScreen) || aStatBar.bTemp ) )
+ aStatBar.bOn && !bIsFullScreen )
{
// Id has changed, thus create a suitable Statusbarmanager, this takes
// over the current status bar;
@@ -1876,16 +1876,9 @@ void SfxWorkWindow::ToggleChildWindow_Impl(sal_uInt16 nId, bool bSetFocus)
if ( pChild->QueryClose() )
{
pCW->bCreate = false;
- if ( pChild->IsHideAtToggle() )
- {
- ShowChildWindow_Impl( nId, false, bSetFocus );
- }
- else
- {
- // The Window should be switched off
- pChild->SetVisible_Impl( false );
- RemoveChildWin_Impl( pCW );
- }
+ // The Window should be switched off
+ pChild->SetVisible_Impl( false );
+ RemoveChildWin_Impl( pCW );
}
}
else
diff --git a/sfx2/source/control/objface.cxx b/sfx2/source/control/objface.cxx
index be06109248d0..49983e40d2f0 100644
--- a/sfx2/source/control/objface.cxx
+++ b/sfx2/source/control/objface.cxx
@@ -55,14 +55,12 @@ struct SfxObjectUI_Impl
{
sal_uInt16 nPos;
sal_uInt32 nResId;
- bool bVisible;
bool bContext;
sal_uInt32 nFeature;
SfxObjectUI_Impl(sal_uInt16 n, sal_uInt32 nId, sal_uInt32 nFeat) :
nPos(n),
nResId(nId),
- bVisible(true),
bContext(false),
nFeature(nFeat)
{
@@ -541,7 +539,7 @@ bool SfxInterface::IsObjectBarVisible(sal_uInt16 nNo) const
assert( nNo<pImplData->aObjectBars.size() );
- return pImplData->aObjectBars[nNo]->bVisible;
+ return true;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx
index b510328e4539..a6a48e89ccaf 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -133,7 +133,6 @@ void ThumbnailView::AppendItem(ThumbnailViewItem *pItem)
void ThumbnailView::ImplInit()
{
mpScrBar = nullptr;
- mnHeaderHeight = 0;
mnItemWidth = 0;
mnItemHeight = 0;
mnItemPadding = 0;
@@ -297,11 +296,11 @@ void ThumbnailView::CalculateItemPositions (bool bScrollBarUsed)
mnCols = 1;
// calculate maximum number of visible rows
- mnVisLines = (sal_uInt16)((aWinSize.Height()-mnHeaderHeight) / (mnItemHeight));
+ mnVisLines = (sal_uInt16)(aWinSize.Height() / mnItemHeight);
// calculate empty space
long nHSpace = aWinSize.Width()-nScrBarWidth - mnCols*mnItemWidth;
- long nVSpace = aWinSize.Height()-mnHeaderHeight - mnVisLines*mnItemHeight;
+ long nVSpace = aWinSize.Height() - mnVisLines*mnItemHeight;
long nHItemSpace = nHSpace / (mnCols+1);
long nVItemSpace = nVSpace / (mnVisLines+1);
@@ -322,12 +321,12 @@ void ThumbnailView::CalculateItemPositions (bool bScrollBarUsed)
long nItemHeightOffset = mnItemHeight + nVItemSpace;
long nHiddenLines = (static_cast<long>(
( mnLines - 1 ) * nItemHeightOffset * nScrollRatio ) -
- nVItemSpace - mnHeaderHeight) /
+ nVItemSpace ) /
nItemHeightOffset;
// calculate offsets
long nStartX = nHItemSpace;
- long nStartY = nVItemSpace + mnHeaderHeight;
+ long nStartY = nVItemSpace;
// calculate and draw items
long x = nStartX;
@@ -411,8 +410,8 @@ void ThumbnailView::CalculateItemPositions (bool bScrollBarUsed)
mbScroll = mnLines > mnVisLines;
- Point aPos( aWinSize.Width() - nScrBarWidth, mnHeaderHeight );
- Size aSize( nScrBarWidth, aWinSize.Height() - mnHeaderHeight );
+ Point aPos( aWinSize.Width() - nScrBarWidth, 0 );
+ Size aSize( nScrBarWidth, aWinSize.Height() );
mpScrBar->SetPosSizePixel( aPos, aSize );
mpScrBar->SetRangeMax( (nCurCount+mnCols-1)*mnFineness/mnCols);
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index 84dcd1c7b500..0562aa1bfc87 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -559,12 +559,6 @@ void SfxTabDialog::Start_Impl()
if ( USHRT_MAX != m_nAppPageId )
nActPage = m_nAppPageId;
- else
- {
- sal_uInt16 nAutoTabPageId = SfxGetpApp()->Get_Impl()->nAutoTabPageId;
- if ( nAutoTabPageId )
- nActPage = nAutoTabPageId;
- }
if ( TAB_PAGE_NOTFOUND == m_pTabCtrl->GetPagePos( nActPage ) )
nActPage = m_pTabCtrl->GetPageId( 0 );
diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx
index 422ab12ee126..fde185a60987 100644
--- a/sfx2/source/doc/doctempl.cxx
+++ b/sfx2/source/doc/doctempl.cxx
@@ -119,8 +119,6 @@ class DocTempl_EntryData_Impl
OUString maTitle;
OUString maOwnURL;
OUString maTargetURL;
- bool mbIsOwner : 1;
- bool mbDidConvert: 1;
private:
RegionData_Impl* GetParent() const { return mpParent; }
@@ -1231,8 +1229,6 @@ DocTempl_EntryData_Impl::DocTempl_EntryData_Impl( RegionData_Impl* pParent,
mpParent = pParent;
maTitle = SfxDocumentTemplates::ConvertResourceString(
STR_TEMPLATE_NAME1_DEF, STR_TEMPLATE_NAME1, NUM_TEMPLATE_NAMES, rTitle );
- mbIsOwner = false;
- mbDidConvert= false;
}
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 67e3eff94dbc..d461bc00516e 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -256,12 +256,6 @@ void SfxObjectShell::ResetError()
}
-bool SfxObjectShell::IsTemplate() const
-{
- return pImpl->bIsTemplate;
-}
-
-
void SfxObjectShell::EnableSetModified( bool bEnable )
{
#ifdef DBG_UTIL
@@ -792,7 +786,6 @@ OUString SfxObjectShell::GetTitle
bRecur = true;
OUString aTitle;
- SfxObjectShell *pThis = const_cast<SfxObjectShell*>(this);
if ( pMed )
{
@@ -804,19 +797,12 @@ OUString SfxObjectShell::GetTitle
if ( aTitle.isEmpty() )
aTitle = GetTitle( SFX_TITLE_FILENAME );
- if ( IsTemplate() )
- pThis->SetTitle( aTitle );
bRecur = false;
return aTitle;
}
else if (SFX_TITLE_APINAME == nMaxLength )
return GetAPIName();
- // Special case templates:
- if( IsTemplate() && !pImpl->aTitle.isEmpty() &&
- ( nMaxLength == SFX_TITLE_CAPTION || nMaxLength == SFX_TITLE_PICKLIST ) )
- return pImpl->aTitle;
-
// Picklist/Caption is mapped
if ( pMed && ( nMaxLength == SFX_TITLE_CAPTION || nMaxLength == SFX_TITLE_PICKLIST ) )
{
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 8c59eece176c..dc996183252b 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -216,7 +216,6 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell )
,bIsSaving( false)
,bPasswd( false)
,bIsNamedVisible( false)
- ,bIsTemplate(false)
,bIsAbortingImport ( false)
,bImportDone ( false)
,bInPrepareClose( false )
@@ -248,7 +247,6 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell )
,nFlagsInProgress( SfxLoadedFlags::NONE )
,bModalMode( false )
,bRunningMacro( false )
- ,bReloadAvailable( false )
,nAutoLoadLocks( 0 )
,eFlags( SfxObjectShellFlags::UNDEFINED )
,bReadOnlyUI( false )
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 42b7dfe12cc7..e7f5d0658c2e 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -162,7 +162,6 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg(vcl::Window *parent)
: ModalDialog(parent, "TemplateDialog", "sfx/ui/templatedlg.ui"),
maSelTemplates(cmpSelectionItems),
mxDesktop( Desktop::create(comphelper::getProcessComponentContext()) ),
- mbIsSynced(false),
maRepositories()
{
get(mpSearchFilter, "search_filter");
@@ -1461,31 +1460,27 @@ bool SfxTemplateManagerDlg::insertRepository(const OUString &rName, const OUStri
maRepositories.push_back(pItem);
- mbIsSynced = false;
return true;
}
void SfxTemplateManagerDlg::syncRepositories() const
{
- if (!mbIsSynced)
- {
- uno::Reference < uno::XComponentContext > pContext(comphelper::getProcessComponentContext());
- std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create(pContext));
-
- size_t nSize = maRepositories.size();
- uno::Sequence<OUString> aUrls(nSize);
- uno::Sequence<OUString> aNames(nSize);
+ uno::Reference < uno::XComponentContext > pContext(comphelper::getProcessComponentContext());
+ std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create(pContext));
- for(size_t i = 0; i < nSize; ++i)
- {
- aUrls[i] = maRepositories[i]->getURL();
- aNames[i] = maRepositories[i]->maTitle;
- }
+ size_t nSize = maRepositories.size();
+ uno::Sequence<OUString> aUrls(nSize);
+ uno::Sequence<OUString> aNames(nSize);
- officecfg::Office::Common::Misc::TemplateRepositoryUrls::set(aUrls, batch);
- officecfg::Office::Common::Misc::TemplateRepositoryNames::set(aNames, batch);
- batch->commit();
+ for(size_t i = 0; i < nSize; ++i)
+ {
+ aUrls[i] = maRepositories[i]->getURL();
+ aNames[i] = maRepositories[i]->maTitle;
}
+
+ officecfg::Office::Common::Misc::TemplateRepositoryUrls::set(aUrls, batch);
+ officecfg::Office::Common::Misc::TemplateRepositoryNames::set(aNames, batch);
+ batch->commit();
}
static bool lcl_getServiceName ( const OUString &rFileURL, OUString &rName )
diff --git a/sfx2/source/explorer/nochaos.cxx b/sfx2/source/explorer/nochaos.cxx
index b99d7fbc7d08..f19d39395926 100644
--- a/sfx2/source/explorer/nochaos.cxx
+++ b/sfx2/source/explorer/nochaos.cxx
@@ -35,7 +35,7 @@ class CntItemPool;
class CntStaticPoolDefaults_Impl
{
- sal_uInt32 m_nItems;
+ static const sal_uInt32 m_nItems = 1;
SfxPoolItem** m_ppDefaults;
SfxItemInfo* m_pItemInfos;
@@ -179,8 +179,7 @@ CntStaticPoolDefaults_Impl::~CntStaticPoolDefaults_Impl()
CntStaticPoolDefaults_Impl::CntStaticPoolDefaults_Impl( CntItemPool* /*pPool*/ )
-: m_nItems( 1 ),
- m_ppDefaults( new SfxPoolItem* [ m_nItems ] ),
+: m_ppDefaults( new SfxPoolItem* [ m_nItems ] ),
m_pItemInfos( new SfxItemInfo [ m_nItems ] )
{
memset( m_ppDefaults, 0, sizeof( SfxPoolItem* ) * m_nItems );
diff --git a/sfx2/source/inc/appdata.hxx b/sfx2/source/inc/appdata.hxx
index 696b13899341..71fabc3e47b4 100644
--- a/sfx2/source/inc/appdata.hxx
+++ b/sfx2/source/inc/appdata.hxx
@@ -103,7 +103,6 @@ public:
SfxProgress* pProgress;
sal_uInt16 nDocModalMode; // counts documents in modal mode
- sal_uInt16 nAutoTabPageId;
sal_uInt16 nRescheduleLocks;
sal_uInt16 nInReschedule;
diff --git a/sfx2/source/inc/objshimp.hxx b/sfx2/source/inc/objshimp.hxx
index 1a338bebcd18..22cb4c660e39 100644
--- a/sfx2/source/inc/objshimp.hxx
+++ b/sfx2/source/inc/objshimp.hxx
@@ -80,7 +80,6 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess
bIsSaving:1,
bPasswd:1,
bIsNamedVisible:1,
- bIsTemplate:1,
bIsAbortingImport:1, // Import operation should be canceled.
bImportDone : 1, // Import finished already? For auto reload of Docs.
bInPrepareClose : 1,
@@ -115,7 +114,6 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess
SfxLoadedFlags nFlagsInProgress;
bool bModalMode;
bool bRunningMacro;
- bool bReloadAvailable;
sal_uInt16 nAutoLoadLocks;
SfxObjectShellFlags eFlags;
bool bReadOnlyUI;
diff --git a/sfx2/source/inc/workwin.hxx b/sfx2/source/inc/workwin.hxx
index dcc0fd3dd51a..d9a68d6c25a0 100644
--- a/sfx2/source/inc/workwin.hxx
+++ b/sfx2/source/inc/workwin.hxx
@@ -62,18 +62,16 @@ struct SfxObjectBar_Impl
};
-// This struct makes all relevant Informationen available of the status bar
+// This struct makes all relevant Information available of the status bar
struct SfxStatBar_Impl
{
sal_uInt16 nId;
bool bOn;
- bool bTemp;
SfxStatBar_Impl() :
nId(0),
- bOn(true),
- bTemp(false)
+ bOn(true)
{}
};
@@ -122,7 +120,6 @@ struct SfxChildWin_Impl
SfxChild_Impl* pCli; // != 0 at direct Children
sal_uInt16 nVisibility;
bool bEnable;
- bool bDisabled;
SfxChildWin_Impl( sal_uInt32 nID ) :
nSaveId((sal_uInt16) (nID & 0xFFFF) ),
@@ -132,8 +129,7 @@ struct SfxChildWin_Impl
bCreate(false),
pCli(nullptr),
nVisibility( SFX_VISIBILITY_UNVISIBLE ),
- bEnable( true ),
- bDisabled( false )
+ bEnable( true )
{}
};
diff --git a/sfx2/source/sidebar/DeckTitleBar.cxx b/sfx2/source/sidebar/DeckTitleBar.cxx
index 31214fb66f2d..22ddec13eb1b 100644
--- a/sfx2/source/sidebar/DeckTitleBar.cxx
+++ b/sfx2/source/sidebar/DeckTitleBar.cxx
@@ -41,7 +41,6 @@ DeckTitleBar::DeckTitleBar (const OUString& rsTitle,
vcl::Window* pParentWindow,
const std::function<void()>& rCloserAction)
: TitleBar(rsTitle, pParentWindow, GetBackgroundPaint())
- , mnCloserItemIndex(1)
, maCloserAction(rCloserAction)
, mbIsCloserVisible(false)
{
diff --git a/sfx2/source/sidebar/MenuButton.cxx b/sfx2/source/sidebar/MenuButton.cxx
index 428cdafac4bb..ef749459bc32 100644
--- a/sfx2/source/sidebar/MenuButton.cxx
+++ b/sfx2/source/sidebar/MenuButton.cxx
@@ -31,45 +31,33 @@ namespace sfx2 { namespace sidebar {
MenuButton::MenuButton (vcl::Window* pParentWindow)
: CheckBox(pParentWindow),
- mbIsLeftButtonDown(false),
- mePaintType(PT_Theme)
+ mbIsLeftButtonDown(false)
{
#ifdef DEBUG
SetText(OUString("MenuButton"));
#endif
}
-void MenuButton::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rUpdateArea)
+void MenuButton::Paint(vcl::RenderContext& rRenderContext, const Rectangle& /*rUpdateArea*/)
{
- switch (mePaintType)
- {
- case PT_Theme:
- default:
- {
- const bool bIsSelected (IsChecked());
- const bool bIsHighlighted (IsMouseOver() || HasFocus());
- DrawHelper::DrawRoundedRectangle(
- rRenderContext,
- Rectangle(Point(0,0), GetSizePixel()),
- 3,
- (bIsHighlighted || bIsSelected
- ? Theme::GetColor(Theme::Color_TabItemBorder)
- : Color(0xffffffff)),
- (bIsHighlighted
- ? Theme::GetPaint(Theme::Paint_TabItemBackgroundHighlight)
- : Theme::GetPaint(Theme::Paint_TabItemBackgroundNormal)));
+ const bool bIsSelected (IsChecked());
+ const bool bIsHighlighted (IsMouseOver() || HasFocus());
+ DrawHelper::DrawRoundedRectangle(
+ rRenderContext,
+ Rectangle(Point(0,0), GetSizePixel()),
+ 3,
+ (bIsHighlighted || bIsSelected
+ ? Theme::GetColor(Theme::Color_TabItemBorder)
+ : Color(0xffffffff)),
+ (bIsHighlighted
+ ? Theme::GetPaint(Theme::Paint_TabItemBackgroundHighlight)
+ : Theme::GetPaint(Theme::Paint_TabItemBackgroundNormal)));
- const Image aIcon(Button::GetModeImage());
- const Size aIconSize(aIcon.GetSizePixel());
- const Point aIconLocation((GetSizePixel().Width() - aIconSize.Width()) / 2,
- (GetSizePixel().Height() - aIconSize.Height()) / 2);
- rRenderContext.DrawImage(aIconLocation, aIcon);
- break;
- }
- case PT_Native:
- Button::Paint(rRenderContext, rUpdateArea);
- break;
- }
+ const Image aIcon(Button::GetModeImage());
+ const Size aIconSize(aIcon.GetSizePixel());
+ const Point aIconLocation((GetSizePixel().Width() - aIconSize.Width()) / 2,
+ (GetSizePixel().Height() - aIconSize.Height()) / 2);
+ rRenderContext.DrawImage(aIconLocation, aIcon);
}
void MenuButton::MouseMove (const MouseEvent& rEvent)
diff --git a/sfx2/source/sidebar/PanelTitleBar.cxx b/sfx2/source/sidebar/PanelTitleBar.cxx
index c91cef31254f..7a16f337e102 100644
--- a/sfx2/source/sidebar/PanelTitleBar.cxx
+++ b/sfx2/source/sidebar/PanelTitleBar.cxx
@@ -46,7 +46,6 @@ PanelTitleBar::PanelTitleBar(const OUString& rsTitle,
: TitleBar(rsTitle, pParentWindow, GetBackgroundPaint()),
mbIsLeftButtonDown(false),
mpPanel(pPanel),
- mnMenuItemIndex(1),
mxFrame(),
msMoreOptionsCommand()
{
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index 43d88844852a..78de65dcc0fb 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -108,7 +108,6 @@ SidebarController::SidebarController (
maAsynchronousDeckSwitch(),
mbIsDeckRequestedOpen(),
mbIsDeckOpen(),
- mbCanDeckBeOpened(true),
mnSavedSidebarWidth(pParentWindow->GetSizePixel().Width()),
maFocusManager([this](const Panel& rPanel){ return this->ShowPanel(rPanel); }),
mxReadOnlyModeDispatch(),
@@ -349,18 +348,13 @@ void SidebarController::NotifyResize()
mnSavedSidebarWidth = nWidth;
bool bIsDeckVisible;
- if (mbCanDeckBeOpened)
- {
- const bool bIsOpening (nWidth > mnWidthOnSplitterButtonDown);
- if (bIsOpening)
- bIsDeckVisible = nWidth >= nTabBarDefaultWidth + gnWidthOpenThreshold;
- else
- bIsDeckVisible = nWidth >= nTabBarDefaultWidth + gnWidthCloseThreshold;
- mbIsDeckRequestedOpen = bIsDeckVisible;
- UpdateCloseIndicator(!bIsDeckVisible);
- }
+ const bool bIsOpening (nWidth > mnWidthOnSplitterButtonDown);
+ if (bIsOpening)
+ bIsDeckVisible = nWidth >= nTabBarDefaultWidth + gnWidthOpenThreshold;
else
- bIsDeckVisible = false;
+ bIsDeckVisible = nWidth >= nTabBarDefaultWidth + gnWidthCloseThreshold;
+ mbIsDeckRequestedOpen = bIsDeckVisible;
+ UpdateCloseIndicator(!bIsDeckVisible);
if (mpCurrentDeck)
{
diff --git a/sfx2/source/sidebar/TabItem.cxx b/sfx2/source/sidebar/TabItem.cxx
index 8c45b6567d71..13bc9914ef12 100644
--- a/sfx2/source/sidebar/TabItem.cxx
+++ b/sfx2/source/sidebar/TabItem.cxx
@@ -32,8 +32,7 @@ namespace sfx2 { namespace sidebar {
TabItem::TabItem (vcl::Window* pParentWindow)
: ImageRadioButton(pParentWindow),
- mbIsLeftButtonDown(false),
- mePaintType(PT_Theme)
+ mbIsLeftButtonDown(false)
{
SetStyle(GetStyle() | WB_TABSTOP | WB_DIALOGCONTROL | WB_NOPOINTERFOCUS);
SetBackground(Theme::GetPaint(Theme::Paint_TabBarBackground).GetWallpaper());
@@ -42,16 +41,11 @@ TabItem::TabItem (vcl::Window* pParentWindow)
#endif
}
-void TabItem::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rUpdateArea)
+void TabItem::Paint(vcl::RenderContext& rRenderContext, const Rectangle& /*UpdateArea*/)
{
- switch (mePaintType)
- {
- case PT_Theme:
- default:
- {
- const bool bIsSelected (IsChecked());
- const bool bIsHighlighted (IsMouseOver() || HasFocus());
- DrawHelper::DrawRoundedRectangle(
+ const bool bIsSelected (IsChecked());
+ const bool bIsHighlighted (IsMouseOver() || HasFocus());
+ DrawHelper::DrawRoundedRectangle(
rRenderContext,
Rectangle(Point(0,0), GetSizePixel()),
Theme::GetInteger(Theme::Int_ButtonCornerRadius),
@@ -62,17 +56,11 @@ void TabItem::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rUpdate
? Theme::GetPaint(Theme::Paint_TabItemBackgroundHighlight)
: Theme::GetPaint(Theme::Paint_TabItemBackgroundNormal));
- const Image aIcon(Button::GetModeImage());
- const Size aIconSize (aIcon.GetSizePixel());
- const Point aIconLocation((GetSizePixel().Width() - aIconSize.Width()) / 2,
- (GetSizePixel().Height() - aIconSize.Height()) / 2);
- rRenderContext.DrawImage(aIconLocation, aIcon, IsEnabled() ? DrawImageFlags::NONE : DrawImageFlags::Disable);
- break;
- }
- case PT_Native:
- Button::Paint(rRenderContext, rUpdateArea);
- break;
- }
+ const Image aIcon(Button::GetModeImage());
+ const Size aIconSize (aIcon.GetSizePixel());
+ const Point aIconLocation((GetSizePixel().Width() - aIconSize.Width()) / 2,
+ (GetSizePixel().Height() - aIconSize.Height()) / 2);
+ rRenderContext.DrawImage(aIconLocation, aIcon, IsEnabled() ? DrawImageFlags::NONE : DrawImageFlags::Disable);
}
void TabItem::MouseMove(const MouseEvent& rEvent)
diff --git a/sfx2/source/view/impviewframe.hxx b/sfx2/source/view/impviewframe.hxx
index 6b128ea7b440..20ef4cfe521b 100644
--- a/sfx2/source/view/impviewframe.hxx
+++ b/sfx2/source/view/impviewframe.hxx
@@ -40,7 +40,6 @@ struct SfxViewFrame_Impl
sal_uInt16 nDocViewNo;
sal_uInt16 nCurViewId;
bool bResizeInToOut:1;
- bool bDontOverwriteResizeInToOut:1;
bool bObjLocked:1;
bool bReloading:1;
bool bIsDowning:1;
@@ -58,7 +57,6 @@ struct SfxViewFrame_Impl
, nDocViewNo(0)
, nCurViewId(0)
, bResizeInToOut(false)
- , bDontOverwriteResizeInToOut(false)
, bObjLocked(false)
, bReloading(false)
, bIsDowning(false)
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 28ea8f5dba9c..a98f8912616f 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -259,31 +259,6 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
return;
}
}
-
- // If only a reload of the graphics for one or more child frames
- // should be made
- SfxFrame& rFrame = GetFrame();
- if ( pParent == &rFrame && rFrame.GetChildFrameCount() )
- {
- bool bReloadAvailable = false;
- SfxFrameIterator aIter( rFrame, false );
- SfxFrame *pChild = aIter.FirstFrame();
- while ( pChild )
- {
- SfxFrame *pNext = aIter.NextFrame( *pChild );
- SfxObjectShell *pShell = pChild->GetCurrentDocument();
- if( pShell && pShell->Get_Impl()->bReloadAvailable )
- {
- bReloadAvailable = true;
- pChild->GetCurrentViewFrame()->ExecuteSlot( rReq );
- }
- pChild = pNext;
- }
-
- // The top level frame itself has no graphics!
- if ( bReloadAvailable )
- return;
- }
}
else
{
@@ -870,31 +845,13 @@ void SfxViewFrame::StateReload_Impl( SfxItemSet& rSet )
case SID_RELOAD:
{
- SfxFrame* pFrame = &GetTopFrame();
-
if ( !pSh || !pSh->CanReload_Impl() || pSh->GetCreateMode() == SfxObjectCreateMode::EMBEDDED )
rSet.DisableItem(nWhich);
else
{
// If any ChildFrame is reloadable, the slot is enabled,
// so you can perfom CTRL-Reload
- bool bReloadAvailable = false;
- SfxFrameIterator aFrameIter( *pFrame, true );
- for( SfxFrame* pNextFrame = aFrameIter.FirstFrame();
- pFrame;
- pNextFrame = pNextFrame ?
- aFrameIter.NextFrame( *pNextFrame ) : nullptr )
- {
- SfxObjectShell *pShell = pFrame->GetCurrentDocument();
- if( pShell && pShell->Get_Impl()->bReloadAvailable )
- {
- bReloadAvailable = true;
- break;
- }
- pFrame = pNextFrame;
- }
-
- rSet.Put( SfxBoolItem( nWhich, bReloadAvailable));
+ rSet.Put( SfxBoolItem( nWhich, false));
}
break;
@@ -1373,7 +1330,6 @@ IMPL_LINK_NOARG_TYPED(SfxViewFrame, SwitchReadOnlyHandler, Button*, void)
void SfxViewFrame::Construct_Impl( SfxObjectShell *pObjSh )
{
m_pImpl->bResizeInToOut = true;
- m_pImpl->bDontOverwriteResizeInToOut = false;
m_pImpl->bObjLocked = false;
m_pImpl->pFocusWin = nullptr;
m_pImpl->pActiveChild = nullptr;
@@ -1611,8 +1567,7 @@ SfxViewFrame* SfxViewFrame::GetParentViewFrame_Impl() const
void SfxViewFrame::ForceOuterResize_Impl()
{
- if ( !m_pImpl->bDontOverwriteResizeInToOut )
- m_pImpl->bResizeInToOut = true;
+ m_pImpl->bResizeInToOut = true;
}
bool SfxViewFrame::IsResizeInToOut_Impl() const
diff --git a/sfx2/source/view/viewimp.hxx b/sfx2/source/view/viewimp.hxx
index fe3b4940e43f..fa3e6800c016 100644
--- a/sfx2/source/view/viewimp.hxx
+++ b/sfx2/source/view/viewimp.hxx
@@ -45,7 +45,6 @@ struct SfxViewShell_Impl
bool m_bControllerSet;
SfxShellArr_Impl aArr;
Size aMargin;
- sal_uInt16 m_nPrinterLocks;
bool m_bCanPrint;
bool m_bHasPrintOptions;
bool m_bIsShowView;
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index fc23ebb6d1c0..b4b8ad1af320 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -240,7 +240,6 @@ public:
SfxViewShell_Impl::SfxViewShell_Impl(SfxViewShellFlags const nFlags)
: aInterceptorContainer( aMutex )
, m_bControllerSet(false)
-, m_nPrinterLocks(0)
, m_bCanPrint(nFlags & SfxViewShellFlags::CAN_PRINT)
, m_bHasPrintOptions(nFlags & SfxViewShellFlags::HAS_PRINTOPTIONS)
, m_bIsShowView(!(nFlags & SfxViewShellFlags::NO_SHOW))
@@ -709,7 +708,7 @@ void SfxViewShell::GetState_Impl( SfxItemSet &rSet )
case SID_SETUPPRINTER:
case SID_PRINTER_NAME:
{
- bool bEnabled = pImpl->m_bCanPrint && !pImpl->m_nPrinterLocks
+ bool bEnabled = pImpl->m_bCanPrint
&& !Application::GetSettings().GetMiscSettings().GetDisablePrinting();
if ( bEnabled )
{