summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source')
-rw-r--r--sd/source/ui/func/fuinsert.cxx7
-rw-r--r--sd/source/ui/unoidl/UnoDocumentSettings.cxx14
-rw-r--r--sd/source/ui/view/sdview4.cxx2
3 files changed, 16 insertions, 7 deletions
diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx
index f19f2c824d96..500ca888ba60 100644
--- a/sd/source/ui/func/fuinsert.cxx
+++ b/sd/source/ui/func/fuinsert.cxx
@@ -32,6 +32,7 @@
#include <tools/urlobj.hxx>
#include <svl/urihelper.hxx>
+#include <sfx2/docfile.hxx>
#include <sfx2/msgpool.hxx>
#include <svtools/sores.hxx>
#include <svtools/insdlg.hxx>
@@ -144,7 +145,11 @@ void FuInsertGraphic::DoExecute( SfxRequest& )
// store as link
OUString aFltName(aDlg.GetCurrentFilter());
OUString aPath(aDlg.GetPath());
- pGrafObj->SetGraphicLink(aPath, aFltName);
+ OUString aReferer;
+ if (mpDocSh->HasName()) {
+ aReferer = mpDocSh->GetMedium()->GetName();
+ }
+ pGrafObj->SetGraphicLink(aPath, aReferer, aFltName);
}
}
}
diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
index 8a0b689cc708..b01d8fbf326b 100644
--- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx
+++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
@@ -104,7 +104,8 @@ namespace sd
// DocumentSettingsSerializer cf. xmloff
virtual uno::Sequence<beans::PropertyValue>
- filterStreamsFromStorage(const uno::Reference< embed::XStorage > &xStorage,
+ filterStreamsFromStorage(OUString const & referer,
+ const uno::Reference< embed::XStorage > &xStorage,
const uno::Sequence<beans::PropertyValue>& aConfigProps );
virtual uno::Sequence<beans::PropertyValue>
filterStreamsToStorage(const uno::Reference< embed::XStorage > &xStorage,
@@ -116,6 +117,7 @@ namespace sd
private:
bool LoadList( XPropertyListType t, const OUString &rPath,
+ const OUString &rReferer,
const uno::Reference< embed::XStorage > &xStorage );
void AssignURL( XPropertyListType t, const Any* pValue, bool *pOk, bool *pChanged );
void ExtractURL( XPropertyListType t, Any* pValue );
@@ -225,6 +227,7 @@ DocumentSettings::~DocumentSettings() throw()
}
bool DocumentSettings::LoadList( XPropertyListType t, const OUString &rInPath,
+ const OUString &rReferer,
const uno::Reference< embed::XStorage > &xStorage )
{
SdDrawDocument* pDoc = mxModel->GetDoc();
@@ -239,10 +242,10 @@ bool DocumentSettings::LoadList( XPropertyListType t, const OUString &rInPath,
}
XPropertyListRef pList = XPropertyList::CreatePropertyList(
- t, aPath );
+ t, aPath, rReferer );
pList->SetName( aName );
- if( pList->LoadFrom( xStorage, rInPath ) )
+ if( pList->LoadFrom( xStorage, rInPath, rReferer ) )
{
pDoc->SetPropertyList( pList );
return true;
@@ -258,7 +261,7 @@ void DocumentSettings::AssignURL( XPropertyListType t, const Any* pValue,
if( !(bool)( *pValue >>= aURL ) )
return;
- if( LoadList( t, aURL, uno::Reference< embed::XStorage >() ) )
+ if( LoadList( t, aURL, ""/*TODO?*/, uno::Reference< embed::XStorage >() ) )
*pOk = *pChanged = true;
}
@@ -296,6 +299,7 @@ static OUString getNameOfType( XPropertyListType t )
uno::Sequence<beans::PropertyValue>
DocumentSettings::filterStreamsFromStorage(
+ OUString const & referer,
const uno::Reference< embed::XStorage > &xStorage,
const uno::Sequence<beans::PropertyValue>& aConfigProps )
{
@@ -310,7 +314,7 @@ uno::Sequence<beans::PropertyValue>
{
OUString aURL;
aConfigProps[i].Value >>= aURL;
- LoadList( t, aURL, xStorage );
+ LoadList( t, aURL, referer, xStorage );
}
}
aRet.realloc( nRet );
diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx
index 666f19984cd9..16e5f5507114 100644
--- a/sd/source/ui/view/sdview4.cxx
+++ b/sd/source/ui/view/sdview4.cxx
@@ -388,7 +388,7 @@ IMPL_LINK_NOARG(View, DropInsertFileHdl)
SdrGrafObj* pGrafObj = InsertGraphic( aGraphic, nTempAction, maDropPos, NULL, NULL );
if(pGrafObj && bLink)
{
- pGrafObj->SetGraphicLink( aCurrentDropFile, OUString() );
+ pGrafObj->SetGraphicLink( aCurrentDropFile, ""/*TODO?*/, OUString() );
}
// return action from first inserted graphic