Kaydet (Commit) 604bc943 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:unusedfields readonly fields

Change-Id: I6629926df06f71ff86e9fb23ae4fc1ae73bc9406
Reviewed-on: https://gerrit.libreoffice.org/40360Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst a43187d9
......@@ -159,7 +159,7 @@ void SvxHyperlinkTabPageBase::InitStdControls ()
if ( pFrame )
{
std::unique_ptr<TargetList> pList(new TargetList);
pFrame->GetTargetList(*pList);
SfxFrame::GetDefaultTargetList(*pList);
if( !pList->empty() )
{
size_t nCount = pList->size();
......
......@@ -105,7 +105,6 @@ private:
sal_uInt16 nHtmlMode;
bool bAllowShowSelector : 1;
bool bIsGraphicValid : 1;
bool bLinkOnly : 1;
bool bHighlighting : 1;
bool m_bColorSelected : 1;
Graphic aBgdGraphic;
......
......@@ -316,7 +316,6 @@ SvxBackgroundTabPage::SvxBackgroundTabPage(vcl::Window* pParent, const SfxItemSe
, nHtmlMode(0)
, bAllowShowSelector(true)
, bIsGraphicValid(false)
, bLinkOnly(false)
, bHighlighting(false)
, m_bColorSelected(false)
, pPageImpl(new SvxBackgroundPage_Impl)
......@@ -894,7 +893,7 @@ void SvxBackgroundTabPage::ShowBitmapUI_Impl()
m_pBitmapContainer->Show();
m_pFileFrame->Show();
m_pBtnLink->Show(!bLinkOnly && !(nHtmlMode & HTMLMODE_ON));
m_pBtnLink->Show(!(nHtmlMode & HTMLMODE_ON));
m_pTypeFrame->Show();
......@@ -1079,7 +1078,7 @@ IMPL_LINK_NOARG(SvxBackgroundTabPage, BrowseHdl_Impl, Button*, void)
OUString aStrBrowse(get<vcl::Window>("findgraphicsft")->GetText());
pImportDlg = new SvxOpenGraphicDialog( aStrBrowse );
if ( bHtml || bLinkOnly )
if ( bHtml )
pImportDlg->EnableLink(false);
pImportDlg->SetPath( aBgdGraphicPath, m_pBtnLink->IsChecked() );
......@@ -1122,7 +1121,7 @@ IMPL_LINK( SvxBackgroundTabPage, LoadIdleHdl_Impl, Timer*, pIdle, void )
// new file chosen
aBgdGraphicPath = pImportDlg->GetPath();
aBgdGraphicFilter = pImportDlg->GetCurrentFilter();
bool bLink = ( nHtmlMode & HTMLMODE_ON ) || bLinkOnly || pImportDlg->IsAsLink();
bool bLink = ( nHtmlMode & HTMLMODE_ON ) || pImportDlg->IsAsLink();
m_pBtnLink->Check( bLink );
m_pBtnLink->Enable();
......
......@@ -224,7 +224,6 @@ private:
uno::Reference< task::XInteractionHandler > m_xInteractionHdl;
// guarded by Application::GetSolarMutex():
uno::Reference< task::XAbortChannel > m_abort;
bool m_stop;
};
......@@ -250,15 +249,10 @@ UpdateDialog::Thread::Thread(
}
void UpdateDialog::Thread::stop() {
uno::Reference< task::XAbortChannel > abort;
{
SolarMutexGuard g;
abort = m_abort;
m_stop = true;
}
if (abort.is()) {
abort->sendAbort();
}
m_updateInformation->cancel();
}
......
......@@ -148,7 +148,6 @@ struct State
maFontVariant("normal"),
mnFontWeight(400.0),
meTextAnchor(BEFORE),
meTextDisplayAlign(BEFORE),
maCurrentColor(0.0),
mbVisibility(true),
meFillType(SOLID),
......@@ -188,7 +187,6 @@ struct State
double mnFontWeight;
TextAlign meTextAnchor; // text-anchor
TextAlign meTextDisplayAlign; // display-align
ARGBColor maCurrentColor;
bool mbVisibility;
......@@ -233,7 +231,6 @@ inline bool operator==(const State& rLHS, const State& rRHS )
rLHS.maFontVariant==rRHS.maFontVariant &&
rLHS.mnFontWeight==rRHS.mnFontWeight &&
rLHS.meTextAnchor==rRHS.meTextAnchor &&
rLHS.meTextDisplayAlign==rRHS.meTextDisplayAlign &&
rLHS.maCurrentColor==rRHS.maCurrentColor &&
rLHS.mbVisibility==rRHS.mbVisibility &&
rLHS.meFillType==rRHS.meFillType &&
......@@ -285,7 +282,6 @@ namespace std
^ size_t(rState.maFontVariant.hashCode())
^ std::hash<double>()(rState.mnFontWeight)
^ size_t(rState.meTextAnchor)
^ size_t(rState.meTextDisplayAlign)
^ size_t(rState.mbVisibility)
^ size_t(rState.meFillType)
^ std::hash<double>()(rState.mnFillOpacity)
......
......@@ -43,7 +43,6 @@ CGM::CGM(uno::Reference< frame::XModel > const & rModel)
, mnXFraction(0)
, mnYFraction(0)
, mbAngReverse(false)
, mpGraphic(nullptr)
, mbStatus(true)
, mbMetaFile(false)
, mbIsFinished(false)
......@@ -72,13 +71,6 @@ CGM::CGM(uno::Reference< frame::XModel > const & rModel)
CGM::~CGM()
{
if ( mpGraphic )
{
mpGDIMetaFile->Stop();
mpGDIMetaFile->SetPrefMapMode( MapMode() );
mpGDIMetaFile->SetPrefSize( Size( static_cast< long >( mnOutdx ), static_cast< long >( mnOutdy ) ) );
*mpGraphic = Graphic( *mpGDIMetaFile );
}
for(sal_uInt8* i : maDefRepList)
delete [] i;
maDefRepList.clear();
......
......@@ -56,8 +56,6 @@ class CGM
double mnYFraction;
bool mbAngReverse; // AngularDirection
Graphic* mpGraphic;
bool mbStatus;
bool mbMetaFile;
bool mbIsFinished;
......
......@@ -73,7 +73,6 @@ class SfxDispatcher;
namespace tools { class Rectangle; }
class SfxRequest;
class SystemWindow;
class SfxFrameArr_Impl;
typedef ::std::vector<OUString> TargetList;
......@@ -97,7 +96,6 @@ class SFX2_DLLPUBLIC SfxFrame : public SvCompatWeakBase<SfxFrame>
friend class SfxFrameWindow_Impl;
private:
SfxFrameArr_Impl* pChildArr;
std::unique_ptr< SfxFrame_Impl > pImpl;
VclPtr<vcl::Window> pWindow;
......@@ -116,8 +114,6 @@ public:
vcl::Window& GetWindow() const { return *pWindow;}
void CancelTransfers();
bool DoClose();
sal_uInt16 GetChildFrameCount() const;
SfxFrame* GetChildFrame( sal_uInt16 nPos ) const;
void SetPresentationMode( bool bSet );
SystemWindow* GetSystemWindow() const;
......@@ -130,7 +126,6 @@ public:
sal_uInt32 GetFrameType() const;
static void GetDefaultTargetList( TargetList& );
void GetTargetList( TargetList& ) const;
void UpdateDescriptor( SfxObjectShell const *pDoc );
void Resize();
const css::uno::Reference< css::frame::XFrame >&
......
......@@ -148,8 +148,8 @@ public:
bool DoClose();
sal_uIntPtr GetFrameType() const
{ return GetFrame().GetFrameType(); }
void GetTargetList( TargetList& rList ) const
{ GetFrame().GetTargetList( rList ); }
static void GetTargetList( TargetList& rList )
{ SfxFrame::GetDefaultTargetList( rList ); }
void SetModalMode( bool );
bool IsInModalMode() const;
......
......@@ -147,7 +147,6 @@ class SVX_DLLPUBLIC SdrUndoAttrObj : public SdrUndoObj
protected:
SfxItemSet* pUndoSet;
SfxItemSet* pRedoSet;
SfxItemSet* pRepeatSet;
// FIXME: Or should we better remember the StyleSheetNames?
rtl::Reference< SfxStyleSheetBase > mxUndoStyleSheet;
......@@ -175,9 +174,6 @@ public:
virtual OUString GetComment() const override;
virtual OUString GetSdrRepeatComment(SdrView& rView) const override;
virtual void SdrRepeat(SdrView& rView) override;
virtual bool CanSdrRepeat(SdrView& rView) const override;
};
/**
......
......@@ -207,7 +207,7 @@ void ScDrawView::UpdateIMap( SdrObject* pObj )
pImageMap = &pIMapInfo->GetImageMap();
// handle target list
pViewData->GetViewShell()->GetViewFrame()->GetTargetList( aTargetList );
SfxViewFrame::GetTargetList( aTargetList );
// handle graphics from object
if ( dynamic_cast<const SdrGrafObj*>( pObj) != nullptr )
......
......@@ -49,6 +49,8 @@
#include "DrawDocShell.hxx"
#include "drawview.hxx"
#include "sdabstdlg.hxx"
#include <memory>
namespace sd {
void DrawViewShell::UpdateIMapDlg( SdrObject* pObj )
......@@ -58,7 +60,7 @@ void DrawViewShell::UpdateIMapDlg( SdrObject* pObj )
{
Graphic aGraphic;
ImageMap* pIMap = nullptr;
TargetList* pTargetList = nullptr;
std::unique_ptr<TargetList> pTargetList;
SdIMapInfo* pIMapInfo = SdDrawDocument::GetIMapInfo( pObj );
// get graphic from shape
......@@ -69,14 +71,11 @@ void DrawViewShell::UpdateIMapDlg( SdrObject* pObj )
if ( pIMapInfo )
{
pIMap = const_cast<ImageMap*>(&pIMapInfo->GetImageMap());
pTargetList = new TargetList;
GetViewFrame()->GetTargetList( *pTargetList );
pTargetList.reset(new TargetList);
SfxViewFrame::GetTargetList( *pTargetList );
}
SvxIMapDlgChildWindow::UpdateIMapDlg( aGraphic, pIMap, pTargetList, pObj );
// We can delete the target list
delete pTargetList;
SvxIMapDlgChildWindow::UpdateIMapDlg( aGraphic, pIMap, pTargetList.get(), pObj );
}
}
......
......@@ -101,12 +101,6 @@ SfxFrame::~SfxFrame()
pFramesArr_Impl->erase( it );
delete pImpl->pDescr;
if ( pChildArr )
{
DBG_ASSERT( pChildArr->empty(), "Children are not removed!" );
delete pChildArr;
}
}
bool SfxFrame::DoClose()
......@@ -173,9 +167,6 @@ bool SfxFrame::DocIsModified_Impl()
if ( pImpl->pCurrentViewFrame && pImpl->pCurrentViewFrame->GetObjectShell() &&
pImpl->pCurrentViewFrame->GetObjectShell()->IsModified() )
return true;
for( sal_uInt16 nPos = GetChildFrameCount(); nPos--; )
if( (*pChildArr)[ nPos ]->DocIsModified_Impl() )
return true;
return false;
}
......@@ -210,13 +201,6 @@ bool SfxFrame::PrepareClose_Impl( bool bUI )
bRet = pCur->PrepareClose( bUI );
}
if ( bRet )
{
// if this frame has child frames, ask them too
for( sal_uInt16 nPos = GetChildFrameCount(); bRet && nPos--; )
bRet = (*pChildArr)[ nPos ]->PrepareClose_Impl( bUI );
}
pImpl->bPrepClosing = false;
}
......@@ -228,17 +212,6 @@ bool SfxFrame::PrepareClose_Impl( bool bUI )
}
SfxFrame* SfxFrame::GetChildFrame( sal_uInt16 nPos ) const
{
if ( pChildArr && pChildArr->size() > nPos )
{
DBG_ASSERT( nPos < pChildArr->size(), "Wrong Index!");
return (*pChildArr)[nPos];
}
return nullptr;
}
bool SfxFrame::IsClosing_Impl() const
{
return pImpl->bClosing;
......@@ -249,11 +222,6 @@ void SfxFrame::SetIsClosing_Impl()
pImpl->bClosing = true;
}
sal_uInt16 SfxFrame::GetChildFrameCount() const
{
return pChildArr ? pChildArr->size() : 0;
}
void SfxFrame::CancelTransfers()
{
if( !pImpl->bInCancelTransfers )
......@@ -274,11 +242,6 @@ void SfxFrame::CancelTransfers()
}
}
// First stop multiload Frames
sal_uInt16 nCount = GetChildFrameCount();
for( sal_uInt16 n = 0; n<nCount; n++ )
GetChildFrame( n )->CancelTransfers();
// Check if StarOne-Loader should be canceled
SfxFrameWeakRef wFrame( this );
if (wFrame.is())
......@@ -298,11 +261,6 @@ bool SfxFrame::IsAutoLoadLocked_Impl() const
if ( !pObjSh || !pObjSh->IsAutoLoadLocked() )
return false;
// Its children are locked?
for ( sal_uInt16 n = GetChildFrameCount(); n--; )
if ( !GetChildFrame(n)->IsAutoLoadLocked_Impl() )
return false;
// otherwise allow AutoLoad
return true;
}
......@@ -339,28 +297,14 @@ void SfxFrame::GetViewData_Impl()
if( pViewFrame && pViewFrame->GetViewShell() )
{
SfxItemSet *pSet = GetDescriptor()->GetArgs();
bool bGetViewData = false;
if ( GetController().is() && pSet->GetItemState( SID_VIEW_DATA ) != SfxItemState::SET )
{
css::uno::Any aData = GetController()->getViewData();
pSet->Put( SfxUsrAnyItem( SID_VIEW_DATA, aData ) );
bGetViewData = true;
}
if ( pViewFrame->GetCurViewId() )
pSet->Put( SfxUInt16Item( SID_VIEW_ID, (sal_uInt16)pViewFrame->GetCurViewId() ) );
if ( pChildArr )
{
// For Framesets also the data from the ChildViews have to be processed
sal_uInt16 nCount = pChildArr->size();
for ( sal_uInt16 n=nCount; n>0; n--)
{
SfxFrame* pFrame = (*pChildArr)[n-1];
if ( bGetViewData )
pFrame->GetDescriptor()->GetArgs()->ClearItem( SID_VIEW_DATA );
pFrame->GetViewData_Impl();
}
}
}
}
......@@ -437,22 +381,6 @@ void SfxFrame::GetDefaultTargetList(TargetList& rList)
rList.push_back( OUString( "_self" ) );
}
void SfxFrame::GetTargetList( TargetList& rList ) const
{
SfxFrame::GetDefaultTargetList(rList);
SfxViewFrame* pView = GetCurrentViewFrame();
if( pView && pView->GetViewShell() && pChildArr )
{
sal_uInt16 nCount = pChildArr->size();
for ( sal_uInt16 n=0; n<nCount; n++)
{
SfxFrame* pFrame = (*pChildArr)[n];
pFrame->GetTargetList( rList );
}
}
}
void SfxFrame::InsertTopFrame_Impl( SfxFrame* pFrame )
{
SfxFrameArr_Impl& rArr = *SfxGetpApp()->Get_Impl()->pTopFrames;
......
......@@ -288,7 +288,6 @@ SfxFrame* SfxFrame::Create( const Reference < XFrame >& i_rFrame )
SfxFrame::SfxFrame( vcl::Window& i_rContainerWindow )
:SvCompatWeakBase<SfxFrame>( this )
,pChildArr( nullptr )
,pWindow( nullptr )
{
Construct_Impl();
......
......@@ -264,7 +264,6 @@ SdrUndoAttrObj::SdrUndoAttrObj(SdrObject& rNewObj, bool bStyleSheet1, bool bSave
: SdrUndoObj(rNewObj)
, pUndoSet(nullptr)
, pRedoSet(nullptr)
, pRepeatSet(nullptr)
, mxUndoStyleSheet()
, mxRedoStyleSheet()
, bHaveToTakeRedoSet(true)
......@@ -311,7 +310,6 @@ SdrUndoAttrObj::~SdrUndoAttrObj()
{
delete pUndoSet;
delete pRedoSet;
delete pRepeatSet;
delete pUndoGroup;
delete pTextUndo;
delete pTextRedo;
......@@ -521,19 +519,6 @@ OUString SdrUndoAttrObj::GetComment() const
return aStr;
}
void SdrUndoAttrObj::SdrRepeat(SdrView& rView)
{
if(pRepeatSet)
{
rView.SetAttrToMarked(*pRepeatSet, false);
}
}
bool SdrUndoAttrObj::CanSdrRepeat(SdrView& rView) const
{
return (pRepeatSet!=nullptr && rView.AreObjectsMarked());
}
OUString SdrUndoAttrObj::GetSdrRepeatComment(SdrView& /*rView*/) const
{
OUString aStr;
......
......@@ -174,8 +174,7 @@ SwCharURLPage::SwCharURLPage(vcl::Window* pParent, const SfxItemSet& rCoreSet)
m_pNotVisitedLB->SaveValue();
std::unique_ptr<TargetList> pList( new TargetList );
const SfxFrame& rFrame = pView->GetViewFrame()->GetFrame();
rFrame.GetTargetList(*pList);
SfxFrame::GetDefaultTargetList(*pList);
if ( !pList->empty() )
{
size_t nCount = pList->size();
......
......@@ -2763,7 +2763,7 @@ void SwFrameURLPage::Reset( const SfxItemSet *rSet )
if ( SfxItemState::SET == rSet->GetItemState( SID_DOCFRAME, true, &pItem))
{
std::unique_ptr<TargetList> pList(new TargetList);
static_cast<const SfxFrameItem*>(pItem)->GetFrame()->GetTargetList(*pList);
SfxFrame::GetDefaultTargetList(*pList);
if( !pList->empty() )
{
size_t nCount = pList->size();
......
......@@ -165,7 +165,7 @@ static void lcl_UpdateIMapDlg( SwWrtShell& rSh )
void* pEditObj = GraphicType::NONE != nGrfType && GraphicType::Default != nGrfType
? rSh.GetIMapInventor() : nullptr;
std::unique_ptr<TargetList> pList(new TargetList);
rSh.GetView().GetViewFrame()->GetFrame().GetTargetList(*pList);
SfxFrame::GetDefaultTargetList(*pList);
SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_URL, RES_URL>{} );
rSh.GetFlyFrameAttr( aSet );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment