[Libreoffice-commits] core.git: filter/source include/svx sc/source sd/source svx/source sw/source
Stephan Bergmann (via logerrit)
logerrit at kemper.freedesktop.org
Wed Nov 18 09:23:04 UTC 2020
filter/source/msfilter/msdffimp.cxx | 7 ++-----
include/svx/svdograf.hxx | 3 +--
sc/source/filter/rtf/eeimpars.cxx | 2 +-
sc/source/ui/drawfunc/fuins1.cxx | 11 +++++------
sc/source/ui/inc/drawview.hxx | 3 +--
sc/source/ui/inc/viewfunc.hxx | 2 +-
sc/source/ui/view/drawview.cxx | 5 ++---
sc/source/ui/view/tabvwsh9.cxx | 2 +-
sc/source/ui/view/viewfun3.cxx | 6 +++---
sc/source/ui/view/viewfun4.cxx | 8 +++-----
sc/source/ui/view/viewfun5.cxx | 2 +-
sc/source/ui/view/viewfun7.cxx | 11 +++++------
sd/source/ui/func/fuinsert.cxx | 9 ++-------
sd/source/ui/view/sdview4.cxx | 2 +-
svx/source/svdraw/svdograf.cxx | 7 ++-----
sw/source/core/frmedt/fecopy.cxx | 8 +-------
sw/source/uibase/shells/drawsh.cxx | 10 +---------
17 files changed, 33 insertions(+), 65 deletions(-)
New commits:
commit 7938cae5178a4ce4093fd6494a058ab879ba303b
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Wed Nov 18 08:24:24 2020 +0100
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Wed Nov 18 10:22:16 2020 +0100
Remove unused SdrGrafObj::SetGraphicLink rReferer, rFilterName parameters
unused since 9fb7aaf570c03c8a26d763f1205fb8c890e8211a "Make linked graphic
register into LinkedManager again", and remove further function parameters and
class members that turn out to be unused now, too
Change-Id: I3dd2b138fd8787d12b89547526da751ea5954845
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106041
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index aee695bf3990..30d08a3e6d34 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -3759,7 +3759,7 @@ static void lcl_ApplyCropping( const DffPropSet& rPropSet, SfxItemSet* pSet, Gra
SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, const DffObjData& rObjData )
{
SdrObject* pRet = nullptr;
- OUString aLinkFileName, aLinkFilterName;
+ OUString aLinkFileName;
tools::Rectangle aVisArea;
auto eFlags = GetPropertyValue(DFF_Prop_pibFlags, mso_blipflagDefault);
@@ -3968,9 +3968,6 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, cons
}
if( aAbsURL.GetProtocol() != INetProtocol::NotValid )
{
- GraphicFilter &rGrfFilter = GraphicFilter::GetGraphicFilter();
- aLinkFilterName = rGrfFilter.GetImportFormatName(
- rGrfFilter.GetImportFormatNumberForShortName( aAbsURL.getExtension() ) );
aLinkFileName = aAbsURL.GetMainURL( INetURLObject::DecodeMechanism::ToIUri );
}
else
@@ -4001,7 +3998,7 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, cons
{
if( aLinkFileName.getLength() )
{
- static_cast<SdrGrafObj*>(pRet)->SetGraphicLink( aLinkFileName, u""/*TODO?*/, aLinkFilterName );
+ static_cast<SdrGrafObj*>(pRet)->SetGraphicLink( aLinkFileName );
Graphic aGraphic(static_cast<SdrGrafObj*>(pRet)->GetGraphic());
aGraphic.setOriginURL(aLinkFileName);
}
diff --git a/include/svx/svdograf.hxx b/include/svx/svdograf.hxx
index 5fd2b3ff1946..27f38203edbe 100644
--- a/include/svx/svdograf.hxx
+++ b/include/svx/svdograf.hxx
@@ -92,7 +92,6 @@ private:
GraphicAttr aGrafInfo;
OUString aFileName; // If it's a Link, the filename can be found in here
- OUString aReferer;
OUString aFilterName;
std::unique_ptr<GraphicObject> mpGraphicObject; // In order to speed up output of bitmaps, especially rotated ones
std::unique_ptr<GraphicObject> mpReplacementGraphicObject;
@@ -163,7 +162,7 @@ private:
void ForceSwapIn() const;
public:
- void SetGraphicLink(const OUString& rFileName, std::u16string_view rReferer, std::u16string_view rFilterName);
+ void SetGraphicLink(const OUString& rFileName);
void ReleaseGraphicLink();
bool IsLinkedGraphic() const;
diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx
index ce164d24103f..220c733a4da7 100644
--- a/sc/source/filter/rtf/eeimpars.cxx
+++ b/sc/source/filter/rtf/eeimpars.cxx
@@ -604,7 +604,7 @@ void ScEEImport::InsertGraphic( SCCOL nCol, SCROW nRow, SCTAB nTab,
// SetGraphicLink has to be used after inserting the object,
// otherwise an empty graphic is swapped in and the contact stuff crashes.
// See #i37444#.
- pObj->SetGraphicLink( pI->aURL, u""/*TODO?*/, pI->aFilterName );
+ pObj->SetGraphicLink( pI->aURL );
pObj->SetLogicRect( aRect ); // Only after InsertObject!
}
diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx
index 5ef7f1065853..f314169f216e 100644
--- a/sc/source/ui/drawfunc/fuins1.cxx
+++ b/sc/source/ui/drawfunc/fuins1.cxx
@@ -100,7 +100,7 @@ void ScLimitSizeOnDrawPage( Size& rSize, Point& rPos, const Size& rPage )
}
static void lcl_InsertGraphic( const Graphic& rGraphic,
- const OUString& rFileName, const OUString& rFilterName, bool bAsLink, bool bApi,
+ const OUString& rFileName, bool bAsLink, bool bApi,
ScTabViewShell& rViewSh, const vcl::Window* pWindow, SdrView* pView,
ScAnchorType aAnchorType = SCA_CELL )
{
@@ -138,8 +138,7 @@ static void lcl_InsertGraphic( const Graphic& rGraphic,
*pPickObj,
rGraphic1,
aBeginUndo,
- bAsLink ? rFileName : OUString(),
- bAsLink ? rFilterName : OUString());
+ bAsLink ? rFileName : OUString());
if(pResult)
{
@@ -204,7 +203,7 @@ static void lcl_InsertGraphic( const Graphic& rGraphic,
// otherwise an empty graphic is swapped in and the contact stuff crashes.
// See #i37444#.
if (bSuccess && bAsLink)
- pObj->SetGraphicLink( rFileName, u""/*TODO?*/, rFilterName );
+ pObj->SetGraphicLink( rFileName );
}
static void lcl_InsertMedia( const OUString& rMediaURL, bool bApi,
@@ -283,7 +282,7 @@ FuInsertGraphic::FuInsertGraphic( ScTabViewShell& rViewSh,
ErrCode nError = GraphicFilter::LoadGraphic( aFileName, aFilterName, aGraphic, &GraphicFilter::GetGraphicFilter() );
if ( nError == ERRCODE_NONE )
{
- lcl_InsertGraphic( aGraphic, aFileName, aFilterName, bAsLink, true, rViewSh, pWindow, pView );
+ lcl_InsertGraphic( aGraphic, aFileName, bAsLink, true, rViewSh, pWindow, pView );
}
}
else
@@ -349,7 +348,7 @@ FuInsertGraphic::FuInsertGraphic( ScTabViewShell& rViewSh,
else
aAnchorType = SCA_DONTKNOW;
- lcl_InsertGraphic( aGraphic, aFileName, aFilterName, bAsLink, false, rViewSh, pWindow, pView, aAnchorType );
+ lcl_InsertGraphic( aGraphic, aFileName, bAsLink, false, rViewSh, pWindow, pView, aAnchorType );
// append items for recording
rReq.AppendItem( SfxStringItem( SID_INSERT_GRAPHIC, aFileName ) );
diff --git a/sc/source/ui/inc/drawview.hxx b/sc/source/ui/inc/drawview.hxx
index 3a2e844a8031..c484a76e5bef 100644
--- a/sc/source/ui/inc/drawview.hxx
+++ b/sc/source/ui/inc/drawview.hxx
@@ -151,8 +151,7 @@ public:
SdrObject& rHitObject,
const Graphic& rGraphic,
const OUString& rBeginUndoText,
- const OUString& rFile,
- std::u16string_view rFilter);
+ const OUString& rFile);
static void CheckOle( const SdrMarkList& rMarkList, bool& rAnyOle, bool& rOneOle );
diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx
index 78241137592e..df35741a4f3f 100644
--- a/sc/source/ui/inc/viewfunc.hxx
+++ b/sc/source/ui/inc/viewfunc.hxx
@@ -149,7 +149,7 @@ public:
bool PasteBitmapEx( const Point&, const BitmapEx& );
bool PasteMetaFile( const Point&, const GDIMetaFile& );
bool PasteGraphic( const Point& rPos, const Graphic& rGraphic,
- const OUString& rFile, std::u16string_view rFilter );
+ const OUString& rFile );
bool PasteBookmark( SotClipboardFormatId nFormatId,
const css::uno::Reference< css::datatransfer::XTransferable >& rxTransferable,
SCCOL nPosX, SCROW nPosY );
diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx
index ca90f26daaa8..c589e661e88c 100644
--- a/sc/source/ui/view/drawview.cxx
+++ b/sc/source/ui/view/drawview.cxx
@@ -1114,8 +1114,7 @@ SdrObject* ScDrawView::ApplyGraphicToObject(
SdrObject& rHitObject,
const Graphic& rGraphic,
const OUString& rBeginUndoText,
- const OUString& rFile,
- std::u16string_view rFilter)
+ const OUString& rFile)
{
if(dynamic_cast< SdrGrafObj* >(&rHitObject))
{
@@ -1126,7 +1125,7 @@ SdrObject* ScDrawView::ApplyGraphicToObject(
ReplaceObjectAtView(&rHitObject, *GetSdrPageView(), pNewGrafObj);
// set in all cases - the Clone() will have copied an existing link (!)
- pNewGrafObj->SetGraphicLink( rFile, u""/*TODO?*/, rFilter );
+ pNewGrafObj->SetGraphicLink( rFile );
EndUndo();
return pNewGrafObj;
diff --git a/sc/source/ui/view/tabvwsh9.cxx b/sc/source/ui/view/tabvwsh9.cxx
index 8a86b6bf97ed..740f6af4cfad 100644
--- a/sc/source/ui/view/tabvwsh9.cxx
+++ b/sc/source/ui/view/tabvwsh9.cxx
@@ -76,7 +76,7 @@ void ScTabViewShell::ExecGallery( const SfxRequest& rReq )
Graphic aGraphic( pGalleryItem->GetGraphic() );
Point aPos = GetInsertPos();
- PasteGraphic( aPos, aGraphic, OUString(), OUString() );
+ PasteGraphic( aPos, aGraphic, OUString() );
}
else if ( nType == css::gallery::GalleryItemType::MEDIA )
{
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index 5c31f4dbbb9d..af9e50ab2373 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -788,7 +788,7 @@ bool ScViewFunc::PasteOnDrawObjectLinked(
const OUString aBeginUndo(ScResId(STR_UNDO_DRAGDROP));
- if(pScDrawView->ApplyGraphicToObject( rHitObj, aGraphic, aBeginUndo, "", u"" ))
+ if(pScDrawView->ApplyGraphicToObject( rHitObj, aGraphic, aBeginUndo, "" ))
{
return true;
}
@@ -803,7 +803,7 @@ bool ScViewFunc::PasteOnDrawObjectLinked(
{
const OUString aBeginUndo(ScResId(STR_UNDO_DRAGDROP));
- if(pScDrawView->ApplyGraphicToObject( rHitObj, Graphic(aMtf), aBeginUndo, "", u"" ))
+ if(pScDrawView->ApplyGraphicToObject( rHitObj, Graphic(aMtf), aBeginUndo, "" ))
{
return true;
}
@@ -818,7 +818,7 @@ bool ScViewFunc::PasteOnDrawObjectLinked(
{
const OUString aBeginUndo(ScResId(STR_UNDO_DRAGDROP));
- if(pScDrawView->ApplyGraphicToObject( rHitObj, Graphic(aBmpEx), aBeginUndo, "", u"" ))
+ if(pScDrawView->ApplyGraphicToObject( rHitObj, Graphic(aBmpEx), aBeginUndo, "" ))
{
return true;
}
diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx
index 535c0427fb4f..3371dedb8cc0 100644
--- a/sc/source/ui/view/viewfun4.cxx
+++ b/sc/source/ui/view/viewfun4.cxx
@@ -626,22 +626,20 @@ bool ScViewFunc::PasteFile( const Point& rPos, const OUString& rFile, bool bLink
// 2. can the file be inserted using the graphics filter?
// (as a link, since the Gallery provides it in this way)
- sal_uInt16 nFilterFormat;
Graphic aGraphic;
GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter();
if (!rGraphicFilter.ImportGraphic(aGraphic, aURL,
- GRFILTER_FORMAT_DONTKNOW, &nFilterFormat ))
+ GRFILTER_FORMAT_DONTKNOW ))
{
if ( bLink )
{
- OUString aFltName = rGraphicFilter.GetImportFormatName(nFilterFormat);
- return PasteGraphic( rPos, aGraphic, aStrURL, aFltName );
+ return PasteGraphic( rPos, aGraphic, aStrURL );
}
else
{
// #i76709# if bLink isn't set, pass empty URL/filter, so a non-linked image is inserted
- return PasteGraphic( rPos, aGraphic, EMPTY_OUSTRING, EMPTY_OUSTRING );
+ return PasteGraphic( rPos, aGraphic, EMPTY_OUSTRING );
}
}
diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx
index 227f53b04a9b..90429fbde4e4 100644
--- a/sc/source/ui/view/viewfun5.cxx
+++ b/sc/source/ui/view/viewfun5.cxx
@@ -503,7 +503,7 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId,
{
Graphic aGraphic;
ReadGraphic( *xStm, aGraphic );
- bRet = PasteGraphic( aPos, aGraphic, EMPTY_OUSTRING, EMPTY_OUSTRING );
+ bRet = PasteGraphic( aPos, aGraphic, EMPTY_OUSTRING );
}
}
else if ( nFormatId == SotClipboardFormatId::DRAWING )
diff --git a/sc/source/ui/view/viewfun7.cxx b/sc/source/ui/view/viewfun7.cxx
index 7d85cecbd4e4..c1b93d0799b0 100644
--- a/sc/source/ui/view/viewfun7.cxx
+++ b/sc/source/ui/view/viewfun7.cxx
@@ -365,17 +365,17 @@ bool ScViewFunc::PasteObject( const Point& rPos, const uno::Reference < embed::X
bool ScViewFunc::PasteBitmapEx( const Point& rPos, const BitmapEx& rBmpEx )
{
Graphic aGraphic(rBmpEx);
- return PasteGraphic( rPos, aGraphic, "", u"" );
+ return PasteGraphic( rPos, aGraphic, "" );
}
bool ScViewFunc::PasteMetaFile( const Point& rPos, const GDIMetaFile& rMtf )
{
Graphic aGraphic(rMtf);
- return PasteGraphic( rPos, aGraphic, "", u"" );
+ return PasteGraphic( rPos, aGraphic, "" );
}
bool ScViewFunc::PasteGraphic( const Point& rPos, const Graphic& rGraphic,
- const OUString& rFile, std::u16string_view rFilter )
+ const OUString& rFile )
{
MakeDrawLayer();
ScDrawView* pScDrawView = GetScDrawView();
@@ -397,8 +397,7 @@ bool ScViewFunc::PasteGraphic( const Point& rPos, const Graphic& rGraphic,
*pPickObj,
rGraphic,
aBeginUndo,
- rFile,
- rFilter);
+ rFile);
if (pResult)
{
@@ -448,7 +447,7 @@ bool ScViewFunc::PasteGraphic( const Point& rPos, const Graphic& rGraphic,
// otherwise an empty graphic is swapped in and the contact stuff crashes.
// See #i37444#.
if (bSuccess && !rFile.isEmpty())
- pGrafObj->SetGraphicLink( rFile, u""/*TODO?*/, rFilter );
+ pGrafObj->SetGraphicLink( rFile );
return bSuccess;
}
diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx
index cc93f6f38c37..f5bec6a0867a 100644
--- a/sd/source/ui/func/fuinsert.cxx
+++ b/sd/source/ui/func/fuinsert.cxx
@@ -105,7 +105,6 @@ rtl::Reference<FuPoor> FuInsertGraphic::Create( ViewShell* pViewSh, ::sd::Window
void FuInsertGraphic::DoExecute( SfxRequest& rReq )
{
OUString aFileName;
- OUString aFilterName;
Graphic aGraphic;
bool bAsLink = false;
@@ -119,6 +118,7 @@ void FuInsertGraphic::DoExecute( SfxRequest& rReq )
{
aFileName = static_cast<const SfxStringItem*>(pItem)->GetValue();
+ OUString aFilterName;
if ( pArgs->GetItemState( FN_PARAM_FILTER, true, &pItem ) == SfxItemState::SET )
aFilterName = static_cast<const SfxStringItem*>(pItem)->GetValue();
@@ -137,7 +137,6 @@ void FuInsertGraphic::DoExecute( SfxRequest& rReq )
nError = aDlg.GetGraphic(aGraphic);
bAsLink = aDlg.IsAsLink();
aFileName = aDlg.GetPath();
- aFilterName = aDlg.GetDetectedFilter();
}
if( nError == ERRCODE_NONE )
@@ -185,11 +184,7 @@ void FuInsertGraphic::DoExecute( SfxRequest& rReq )
}
// store as link
- OUString aReferer;
- if (mpDocSh->HasName()) {
- aReferer = mpDocSh->GetMedium()->GetName();
- }
- pGrafObj->SetGraphicLink(aFileName, aReferer, aFilterName);
+ pGrafObj->SetGraphicLink(aFileName);
}
}
}
diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx
index c1305607db13..882258bd9231 100644
--- a/sd/source/ui/view/sdview4.cxx
+++ b/sd/source/ui/view/sdview4.cxx
@@ -427,7 +427,7 @@ IMPL_LINK_NOARG(View, DropInsertFileHdl, Timer *, void)
SdrGrafObj* pGrafObj = InsertGraphic( aGraphic, nTempAction, maDropPos, nullptr, nullptr );
if(pGrafObj && bLink)
{
- pGrafObj->SetGraphicLink( aCurrentDropFile, u""/*TODO?*/, OUString() );
+ pGrafObj->SetGraphicLink( aCurrentDropFile );
}
// return action from first inserted graphic
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index ae43c6bb3e41..217d953d532d 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -313,7 +313,6 @@ void SdrGrafObj::SetGraphic( const Graphic& rGraphic )
{
ImpDeregisterLink();
aFileName = rGraphic.getOriginURL();
- aReferer = "";
aFilterName = "";
}
NbcSetGraphic(rGraphic);
@@ -487,7 +486,7 @@ void SdrGrafObj::ImpDeregisterLink()
}
}
-void SdrGrafObj::SetGraphicLink(const OUString& rFileName, std::u16string_view /*rReferer*/, std::u16string_view /*rFilterName*/)
+void SdrGrafObj::SetGraphicLink(const OUString& rFileName)
{
Graphic aGraphic;
aGraphic.setOriginURL(rFileName);
@@ -498,7 +497,6 @@ void SdrGrafObj::ReleaseGraphicLink()
{
ImpDeregisterLink();
aFileName.clear();
- aReferer.clear();
aFilterName.clear();
}
@@ -726,7 +724,6 @@ SdrGrafObj& SdrGrafObj::operator=( const SdrGrafObj& rObj )
SdrRectObj::operator=( rObj );
aFileName = rObj.aFileName;
- aFilterName = rObj.aFilterName;
bMirrored = rObj.bMirrored;
mbIsSignatureLine = rObj.mbIsSignatureLine;
@@ -756,7 +753,7 @@ SdrGrafObj& SdrGrafObj::operator=( const SdrGrafObj& rObj )
if( rObj.IsLinkedGraphic() )
{
- SetGraphicLink( aFileName, rObj.aReferer, aFilterName );
+ SetGraphicLink( aFileName );
}
ImpSetAttrToGrafInfo();
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index 9257514a2236..bad9f4a671cb 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -1586,14 +1586,8 @@ bool SwFEShell::Paste(const Graphic &rGrf, const OUString& rURL)
// triggers the same assertion (I tried it), so stay at the view method
pView->ReplaceObjectAtView(pObj, *pView->GetSdrPageView(), pNewGrafObj);
- OUString aReferer;
- SwDocShell *pDocShell = GetDoc()->GetDocShell();
- if (pDocShell->HasName()) {
- aReferer = pDocShell->GetMedium()->GetName();
- }
-
// set in all cases - the Clone() will have copied an existing link (!)
- pNewGrafObj->SetGraphicLink(rURL, aReferer, OUString());
+ pNewGrafObj->SetGraphicLink(rURL);
pResult = pNewGrafObj;
}
diff --git a/sw/source/uibase/shells/drawsh.cxx b/sw/source/uibase/shells/drawsh.cxx
index fe8e6b470479..0f2c454da5d8 100644
--- a/sw/source/uibase/shells/drawsh.cxx
+++ b/sw/source/uibase/shells/drawsh.cxx
@@ -144,17 +144,9 @@ void SwDrawShell::InsertPictureFromFile(SdrObject& rObject)
// triggers the same assertion (I tried it), so stay at the view method
pSdrView->ReplaceObjectAtView(&rObject, *pSdrView->GetSdrPageView(), pNewGrafObj);
- OUString aReferer;
- SwDocShell *pDocShell = rSh.GetDoc()->GetDocShell();
- if (pDocShell->HasName()) {
- aReferer = pDocShell->GetMedium()->GetName();
- }
-
// set in all cases - the Clone() will have copied an existing link (!)
pNewGrafObj->SetGraphicLink(
- bAsLink ? aDlg.GetPath() : OUString(),
- aReferer,
- bAsLink ? aDlg.GetDetectedFilter() : OUString());
+ bAsLink ? aDlg.GetPath() : OUString());
pResult = pNewGrafObj;
}
More information about the Libreoffice-commits
mailing list