summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-04-20 13:39:38 +0200
committerTomaž Vajngerl <quikee@gmail.com>2018-04-21 04:12:04 +0200
commit94acabe8d0cb555e76635c4bceeb48a14bd16a2b (patch)
tree5342dac802e5ae009c12734bb2d23e482a6166f1 /sw
parent9374352f242d2dcfd39a3a6f0504efbaf1abb2dc (diff)
loplugin:unusedmethods
Change-Id: I9dc6e81149eae3ba2284fa7fe608dd9252503dce Reviewed-on: https://gerrit.libreoffice.org/53197 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/ndgrf.hxx43
-rw-r--r--sw/source/core/graphic/ndgrf.cxx112
2 files changed, 0 insertions, 155 deletions
diff --git a/sw/inc/ndgrf.hxx b/sw/inc/ndgrf.hxx
index 98480259db0d..cadf0ef7d1f4 100644
--- a/sw/inc/ndgrf.hxx
+++ b/sw/inc/ndgrf.hxx
@@ -68,50 +68,10 @@ class SW_DLLPUBLIC SwGrfNode: public SwNoTextNode
SwAttrSet const * pAutoAttr );
void InsertLink( const OUString& rGrfName, const OUString& rFltName );
- bool ImportGraphic( SvStream& rStrm );
DECL_LINK( SwapGraphic, const GraphicObject*, SvStream* );
DECL_STATIC_LINK( SwGrfNode, SwapReplacement, const GraphicObject*, SvStream* );
- /** helper method to determine stream for the embedded graphic.
-
- Important note: caller of this method has to handle the thrown exceptions
- Storage, which should contain the stream of the embedded graphic, is
- provided via parameter. Otherwise the returned stream will be closed
- after the method returns, because its parent stream is closed and deleted.
- Proposed name of embedded graphic stream is also provided by parameter.
-
- @author OD
-
- @param _refPics
- input parameter - reference to storage, which should contain the
- embedded graphic stream.
-
- @param rStrmName
- input parameter - proposed name of the embedded graphic stream.
-
- @return SvStream*
- new created stream of the embedded graphic, which has to be destroyed
- after its usage. Could be NULL, if the stream isn't found.
- */
- SvStream* GetStreamForEmbedGrf(
- const css::uno::Reference< css::embed::XStorage >& _refPics,
- const OUString& rStreamName ) const;
-
- /** helper method to get a substorage of the document storage for readonly access.
-
- A substorage with the specified name will be opened readonly. If the provided
- name is empty the root storage will be returned.
-
- @param _aStgName
- input parameter - name of substorage. Can be empty.
-
- @return XStorage
- reference to substorage or the root storage
- */
- css::uno::Reference< css::embed::XStorage > GetDocSubstorageOrRoot(
- const OUString& aStgName ) const;
-
/// allow reaction on change of content of GraphicObject, so always call
/// when GraphicObject content changes
void onGraphicChanged();
@@ -171,9 +131,6 @@ private:
public:
bool HasEmbeddedStreamName() const { return maGrfObj.HasUserData(); }
- /// Is this node selected by any shell?
- bool IsSelected() const;
-
/// Communicate to graphic that node is in Undo-range.
virtual bool SavePersistentData() override;
virtual bool RestorePersistentData() override;
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index a046085bb3d9..030893d63693 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -458,24 +458,6 @@ Size SwGrfNode::GetTwipSize() const
return nGrfSize;
}
-bool SwGrfNode::ImportGraphic( SvStream& rStrm )
-{
- Graphic aGraphic;
- const OUString aURL(maGrfObj.GetUserData());
-
- if(!GraphicFilter::GetGraphicFilter().ImportGraphic(aGraphic, aURL, rStrm))
- {
- delete mpReplacementGraphic;
- mpReplacementGraphic = nullptr;
-
- maGrfObj.SetGraphic( aGraphic );
- onGraphicChanged();
- return true;
- }
-
- return false;
-}
-
/**
* @return true if ReRead or reading successful,
* false if not loaded
@@ -745,80 +727,6 @@ void SwGrfNode::ScaleImageMap()
}
}
-/** helper method to get a substorage of the document storage for readonly access.
-
- OD, MAV 2005-08-17 #i53025#
- A substorage with the specified name will be opened readonly. If the provided
- name is empty the root storage will be returned.
-*/
-uno::Reference< embed::XStorage > SwGrfNode::GetDocSubstorageOrRoot( const OUString& aStgName ) const
-{
- uno::Reference < embed::XStorage > refStor =
- const_cast<SwGrfNode*>(this)->GetDoc()->GetDocStorage();
- OSL_ENSURE( refStor.is(), "No storage in Doc" );
-
- if ( !aStgName.isEmpty() )
- {
- if( refStor.is() )
- return refStor->openStorageElement( aStgName, embed::ElementModes::READ );
- }
-
- return refStor;
-}
-
-/** helper method to determine stream for the embedded graphic.
-
- OD 2005-05-04 #i48434#
- Important note: caller of this method has to handle the thrown exceptions
- OD, MAV 2005-08-17 #i53025#
- Storage, which should contain the stream of the embedded graphic, is
- provided via parameter. Otherwise the returned stream will be closed
- after the method returns, because its parent stream is closed and deleted.
- Proposed name of embedded graphic stream is also provided by parameter.
-*/
-SvStream* SwGrfNode::GetStreamForEmbedGrf(
- const uno::Reference< embed::XStorage >& _refPics,
- const OUString& rStreamName ) const
-{
- SvStream* pStrm( nullptr );
-
- if( _refPics.is() && !rStreamName.isEmpty() )
- {
- OUString sStreamName(rStreamName);
- // If stream doesn't exist in the storage, try access the graphic file by
- // re-generating its name.
- // A save action can have changed the filename of the embedded graphic,
- // because a changed unique ID of the graphic is calculated.
- // --> recursive calls of <GetUniqueID()> have to be avoided.
- // Thus, use local static boolean to assure this.
- if ( !_refPics->hasByName( sStreamName ) ||
- !_refPics->isStreamElement( sStreamName ) )
- {
- if ( GetGrfObj().GetType() != GraphicType::NONE )
- {
- const sal_Int32 nExtPos = sStreamName.indexOf('.');
- const OUString aExtStr = (nExtPos>=0) ? sStreamName.copy( nExtPos ) : OUString();
- sStreamName = OStringToOUString(GetGrfObj().GetUniqueID(),
- RTL_TEXTENCODING_ASCII_US) + aExtStr;
- }
- }
-
- // assure that graphic file exist in the storage.
- if ( _refPics->hasByName( sStreamName ) &&
- _refPics->isStreamElement( sStreamName ) )
- {
- uno::Reference < io::XStream > refStrm = _refPics->openStreamElement( sStreamName, embed::ElementModes::READ );
- pStrm = utl::UcbStreamHelper::CreateStream( refStrm );
- }
- else
- {
- OSL_FAIL( "<SwGrfNode::GetStreamForEmbedGrf(..)> - embedded graphic file not found!" );
- }
- }
-
- return pStrm;
-}
-
SwContentNode* SwGrfNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
{
// copy formats into the other document
@@ -921,26 +829,6 @@ bool SwGrfNode::IsTransparent() const
GetSwAttrSet().GetTransparencyGrf().GetValue() != 0;
}
-bool SwGrfNode::IsSelected() const
-{
- bool bRet = false;
- const SwEditShell* pESh = GetDoc()->GetEditShell();
- if( pESh )
- {
- const SwNode* pN = this;
- for(const SwViewShell& rCurrentShell : pESh->GetRingContainer())
- {
- if( dynamic_cast<const SwEditShell*>( &rCurrentShell) != nullptr && pN == &static_cast<const SwCursorShell*>(&rCurrentShell)
- ->GetCursor()->GetPoint()->nNode.GetNode() )
- {
- bRet = true;
- break;
- }
- }
- }
- return bRet;
-}
-
void SwGrfNode::TriggerAsyncRetrieveInputStream()
{
if ( !IsLinkedFile() )