summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-05-25 09:05:21 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-05-26 07:50:33 +0000
commit74713b34a36577f19eb3194246de73fa4f2bb741 (patch)
tree334f601b030923ab621a92bae3f512ff67c99374 /sfx2
parent132f7b2a8cc986ee79c4124ed2bc368d6dfaa418 (diff)
loplugin:unusedmethods
Change-Id: Ib36bc0e87d00abb638cbfec511cd13b6179eabda Reviewed-on: https://gerrit.libreoffice.org/25431 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/sfxpicklist.cxx129
-rw-r--r--sfx2/source/control/templatelocalview.cxx47
-rw-r--r--sfx2/source/control/thumbnailview.cxx9
-rw-r--r--sfx2/source/doc/frmdescr.cxx36
-rw-r--r--sfx2/source/doc/templatedlg.cxx11
-rw-r--r--sfx2/source/inc/sfxpicklist.hxx4
-rw-r--r--sfx2/source/inc/slotserv.hxx15
7 files changed, 3 insertions, 248 deletions
diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx
index 31ec4e51e027..676ada7afad0 100644
--- a/sfx2/source/appl/sfxpicklist.cxx
+++ b/sfx2/source/appl/sfxpicklist.cxx
@@ -76,63 +76,6 @@ class StringLength : public ::cppu::WeakImplHelper< XStringWidth >
}
};
-void SfxPickList::CreatePicklistMenuTitle( Menu* pMenu, sal_uInt16 nItemId, const OUString& aURLString, sal_uInt32 nNo )
-{
- OUStringBuffer aPickEntry;
-
- if ( nNo < 9 )
- {
- aPickEntry.append('~');
- aPickEntry.append(OUString::number(nNo + 1));
- }
- else if ( nNo == 9 )
- aPickEntry.append("1~0");
- else
- aPickEntry.append(OUString::number(nNo + 1));
- aPickEntry.append(": ");
-
- INetURLObject aURL( aURLString );
- OUString aTipHelpText;
- OUString aAccessibleName = aPickEntry.toString();
-
- if ( aURL.GetProtocol() == INetProtocol::File )
- {
- // Do handle file URL differently => convert it to a system
- // path and abbreviate it with a special function:
- OUString aFileSystemPath( aURL.getFSysPath( INetURLObject::FSYS_DETECT ) );
-
- OUString aSystemPath( aFileSystemPath );
- OUString aCompactedSystemPath;
-
- aTipHelpText = aSystemPath;
- aAccessibleName += aSystemPath;
- oslFileError nError = osl_abbreviateSystemPath( aSystemPath.pData, &aCompactedSystemPath.pData, 46, nullptr );
- if ( !nError )
- aPickEntry.append( aCompactedSystemPath );
- else
- aPickEntry.append( aFileSystemPath );
-
- if ( aPickEntry.getLength() > 50 )
- {
- aPickEntry.setLength( 47 );
- aPickEntry.append("...");
- }
- }
- else
- {
- // Use INetURLObject to abbreviate all other URLs
- OUString aShortURL;
- aShortURL = aURL.getAbbreviated( m_xStringLength, 46, INetURLObject::DECODE_UNAMBIGUOUS );
- aPickEntry.append(aShortURL);
- aTipHelpText = aURLString;
- aAccessibleName += aURLString;
- }
-
- // Set menu item text, tip help and accessible name
- pMenu->SetItemText( nItemId, aPickEntry.toString() );
- pMenu->SetTipHelpText( nItemId, aTipHelpText );
- pMenu->SetAccessibleName( nItemId, aAccessibleName );
-}
namespace
{
@@ -261,78 +204,6 @@ SfxPickList::~SfxPickList()
RemovePickListEntries();
}
-void SfxPickList::CreatePickListEntries()
-{
- RemovePickListEntries();
-
- // Reading the pick list
- Sequence< Sequence< PropertyValue > > seqPicklist = SvtHistoryOptions().GetList( ePICKLIST );
-
- sal_uInt32 nCount = seqPicklist.getLength();
- sal_uInt32 nEntries = ::std::min( m_nAllowedMenuSize, nCount );
-
- for( sal_uInt32 nItem=0; nItem < nEntries; ++nItem )
- {
- Sequence< PropertyValue > seqPropertySet = seqPicklist[ nItem ];
-
- INetURLObject aURL;
- OUString sURL;
- OUString sFilter;
- OUString sTitle;
-
- sal_uInt32 nPropertyCount = seqPropertySet.getLength();
- for( sal_uInt32 nProperty=0; nProperty<nPropertyCount; ++nProperty )
- {
- if( seqPropertySet[nProperty].Name == HISTORY_PROPERTYNAME_URL )
- {
- seqPropertySet[nProperty].Value >>= sURL;
- }
- else if( seqPropertySet[nProperty].Name == HISTORY_PROPERTYNAME_FILTER )
- {
- seqPropertySet[nProperty].Value >>= sFilter;
- }
- else if( seqPropertySet[nProperty].Name == HISTORY_PROPERTYNAME_TITLE )
- {
- seqPropertySet[nProperty].Value >>= sTitle;
- }
- }
-
- aURL.SetSmartURL( sURL );
- aURL.SetPass( OUString() );
-
- PickListEntry *pPick = new PickListEntry( aURL.GetMainURL( INetURLObject::NO_DECODE ), sFilter );
- m_aPicklistVector.push_back( pPick );
- }
-}
-
-void SfxPickList::ExecuteEntry( sal_uInt32 nIndex )
-{
- ::osl::ClearableMutexGuard aGuard( thePickListMutex::get() );
-
- PickListEntry *pPick = SfxPickList::Get().GetPickListEntry( nIndex );
-
- if ( pPick )
- {
- SfxRequest aReq( SID_OPENDOC, SfxCallMode::ASYNCHRON, SfxGetpApp()->GetPool() );
- aReq.AppendItem( SfxStringItem( SID_FILE_NAME, pPick->aName ));
- aReq.AppendItem( SfxStringItem( SID_REFERER, "private:user" ) );
- aReq.AppendItem( SfxStringItem( SID_TARGETNAME, "_default" ) );
- OUString aFilter( pPick->aFilter );
- aGuard.clear();
-
- sal_Int32 nPos = aFilter.indexOf('|');
- if( nPos != -1 )
- {
- OUString aOptions(aFilter.copy(nPos+1));
- aFilter = aFilter.copy( 0, nPos );
- aReq.AppendItem( SfxStringItem(SID_FILE_FILTEROPTIONS, aOptions));
- }
-
- aReq.AppendItem(SfxStringItem( SID_FILTER_NAME, aFilter ));
- aReq.AppendItem( SfxBoolItem( SID_TEMPLATE, false ) );
- SfxGetpApp()->ExecuteSlot( aReq );
- }
-}
void SfxPickList::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
diff --git a/sfx2/source/control/templatelocalview.cxx b/sfx2/source/control/templatelocalview.cxx
index 2070a4836396..f985d3cfffad 100644
--- a/sfx2/source/control/templatelocalview.cxx
+++ b/sfx2/source/control/templatelocalview.cxx
@@ -238,17 +238,6 @@ IMPL_LINK_TYPED(TemplateLocalView, ContextMenuSelectHdl, Menu*, pMenu, bool)
return false;
}
-sal_uInt16 TemplateLocalView::getCurRegionItemId() const
-{
- for (TemplateContainerItem* pRegion : maRegions)
- {
- if (pRegion->mnRegionId == mnCurRegionId-1)
- return pRegion->mnId;
- }
-
- return 0;
-}
-
sal_uInt16 TemplateLocalView::getRegionId(size_t pos) const
{
assert(pos < maRegions.size());
@@ -662,42 +651,6 @@ bool TemplateLocalView::copyFrom(const sal_uInt16 nRegionItemId, const BitmapEx
return false;
}
-bool TemplateLocalView::copyFrom(const OUString &rPath)
-{
- assert(mnCurRegionId);
-
- TemplateContainerItem *pRegItem = maRegions[mnCurRegionId-1];
-
- sal_uInt16 nId = getNextItemId();
- sal_uInt16 nDocId = 0;
- sal_uInt16 nRegionId = pRegItem->mnRegionId;
-
- OUString aPath(rPath);
-
- if (!pRegItem->maTemplates.empty())
- nDocId = (pRegItem->maTemplates.back()).nDocId+1;
-
- if (!mpDocTemplates->CopyFrom(nRegionId,nDocId,aPath))
- return false;
-
- TemplateItemProperties aTemplate;
- aTemplate.nId = nId;
- aTemplate.nDocId = nDocId;
- aTemplate.nRegionId = nRegionId;
- aTemplate.aName = aPath;
- aTemplate.aThumbnail = TemplateAbstractView::fetchThumbnail(rPath,
- TEMPLATE_THUMBNAIL_MAX_WIDTH,
- TEMPLATE_THUMBNAIL_MAX_HEIGHT);
- aTemplate.aPath = rPath;
- aTemplate.aRegionName = getRegionName(nRegionId);
-
- pRegItem->maTemplates.push_back(aTemplate);
-
- insertItem(aTemplate);
-
- return true;
-}
-
bool TemplateLocalView::copyFrom (TemplateContainerItem *pItem, const OUString &rPath)
{
sal_uInt16 nId = 1;
diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx
index 894db1e56cd5..6f68e8444292 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -1213,15 +1213,6 @@ void ThumbnailView::filterItems(const std::function<bool (const ThumbnailViewIte
Invalidate();
}
-void ThumbnailView::sortItems(const std::function<bool (const ThumbnailViewItem*, const ThumbnailViewItem*)> &func)
-{
- std::sort(mItemList.begin(),mItemList.end(),func);
-
- CalculateItemPositions();
-
- Invalidate();
-}
-
bool ThumbnailView::renameItem(ThumbnailViewItem*, const OUString&)
{
// Do nothing by default
diff --git a/sfx2/source/doc/frmdescr.cxx b/sfx2/source/doc/frmdescr.cxx
index 86c654a8b206..964e8777de81 100644
--- a/sfx2/source/doc/frmdescr.cxx
+++ b/sfx2/source/doc/frmdescr.cxx
@@ -40,15 +40,11 @@ struct SfxFrameDescriptor_Impl
SfxFrameDescriptor::SfxFrameDescriptor() :
aMargin( -1, -1 ),
- nWidth( 0L ),
eScroll( ScrollingAuto ),
- eSizeSelector( SIZE_ABS ),
bHasBorder( true ),
bHasBorderSet( false ),
- nItemId( 0 ),
bResizeHorizontal( true ),
bResizeVertical( true ),
- bHasUI( true ),
bReadOnly( false ),
pImpl( new SfxFrameDescriptor_Impl )
{
@@ -93,38 +89,6 @@ bool SfxFrameDescriptor::IsEditable() const
return pImpl->bEditable;
}
-SfxFrameDescriptor* SfxFrameDescriptor::Clone() const
-{
- SfxFrameDescriptor *pFrame = new SfxFrameDescriptor;
-
- pFrame->aURL = aURL;
- pFrame->aActualURL = aActualURL;
- pFrame->aName = aName;
- pFrame->aMargin = aMargin;
- pFrame->nWidth = nWidth;
- pFrame->eSizeSelector = eSizeSelector;
- pFrame->eScroll = eScroll;
- pFrame->bResizeHorizontal = bResizeHorizontal;
- pFrame->bResizeVertical = bResizeVertical;
- pFrame->bHasBorder = bHasBorder;
- pFrame->bHasBorderSet = bHasBorderSet;
- pFrame->bHasUI = bHasUI;
- pFrame->SetReadOnly( IsReadOnly() );
- pFrame->SetEditable( IsEditable() );
- if ( pImpl->pWallpaper )
- pFrame->pImpl->pWallpaper = new Wallpaper( *pImpl->pWallpaper );
- if( pImpl->pArgs )
- {
- // Currently in the clone of SfxAllItemSets there is still a bug ...
- pFrame->pImpl->pArgs = new SfxAllItemSet( SfxGetpApp()->GetPool() );
- pFrame->pImpl->pArgs->Put(*pImpl->pArgs);
- }
-
- pFrame->nItemId = nItemId;
-
- return pFrame;
-}
-
void SfxFrameDescriptor::SetWallpaper( const Wallpaper& rWallpaper )
{
DELETEZ( pImpl->pWallpaper );
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index ee43d48c77b2..156e0c2b5948 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -1245,17 +1245,6 @@ void SfxTemplateManagerDlg::OnCategoryDelete()
mpCBFolder->SelectEntryPos(0);
}
-void SfxTemplateManagerDlg::OnRepositoryDelete()
-{
- if(deleteRepository(mpRemoteView->getCurRegionId()))
- {
- // switch to local view
- switchMainView(true);
-
- createRepositoryMenu();
- }
-}
-
void SfxTemplateManagerDlg::createRepositoryMenu()
{
mpRepositoryMenu->Clear();
diff --git a/sfx2/source/inc/sfxpicklist.hxx b/sfx2/source/inc/sfxpicklist.hxx
index a9a13ae7ff1f..8cfd1904700f 100644
--- a/sfx2/source/inc/sfxpicklist.hxx
+++ b/sfx2/source/inc/sfxpicklist.hxx
@@ -47,9 +47,7 @@ class SfxPickList : public SfxListener
SfxPickList( sal_uInt32 nMenuSize );
virtual ~SfxPickList();
- void CreatePicklistMenuTitle( Menu* pMenu, sal_uInt16 nItemId, const OUString& aURL, sal_uInt32 nNo );
PickListEntry* GetPickListEntry( sal_uInt32 nIndex );
- void CreatePickListEntries();
void RemovePickListEntries();
/**
* Adds the given document to the pick list (recent documents) if it satisfies
@@ -62,8 +60,6 @@ class SfxPickList : public SfxListener
static SfxPickList& Get();
static void ensure() { Get(); }
- static void ExecuteEntry( sal_uInt32 nIndex );
-
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
};
diff --git a/sfx2/source/inc/slotserv.hxx b/sfx2/source/inc/slotserv.hxx
index 34e02d3b3fca..31564746fd66 100644
--- a/sfx2/source/inc/slotserv.hxx
+++ b/sfx2/source/inc/slotserv.hxx
@@ -25,26 +25,17 @@ class SfxSlotServer
{
private:
const SfxSlot* _pSlot;
- sal_uInt16 _nShellLevel;
+ sal_uInt16 _nShellLevel;
public:
- SfxSlotServer( const SfxSlot &rSlot, sal_uInt16 nShell );
SfxSlotServer();
- sal_uInt16 GetShellLevel() const;
+ sal_uInt16 GetShellLevel() const;
void SetShellLevel(sal_uInt16 nLevel) { _nShellLevel = nLevel; }
- void SetSlot(const SfxSlot* pSlot) {
- _pSlot = pSlot;
- }
+ void SetSlot(const SfxSlot* pSlot) { _pSlot = pSlot; }
const SfxSlot* GetSlot() const;
};
-inline SfxSlotServer::SfxSlotServer( const SfxSlot &rSlot, sal_uInt16 nShell ):
- _pSlot( &rSlot),
- _nShellLevel( nShell )
-{
-}
-
inline SfxSlotServer::SfxSlotServer():
_pSlot(nullptr),
_nShellLevel(0)