summaryrefslogtreecommitdiff
path: root/svx/source/msfilter/msdffimp.cxx
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2005-01-21 14:32:38 +0000
committerKurt Zenker <kz@openoffice.org>2005-01-21 14:32:38 +0000
commit0101b5b8b8943c0bb5f1968eabe3fa3f8385db5b (patch)
treeb9195692e62a10b0bafce2f31987a8e0c7a7f495 /svx/source/msfilter/msdffimp.cxx
parent855b2ffe3e8b9dcbf79395d45a8191911b5bc44a (diff)
INTEGRATION: CWS svg03 (1.105.12); FILE MERGED
2005/01/14 23:09:11 ka 1.105.12.3: RESYNC: (1.108-1.112); FILE MERGED 2004/12/10 16:08:25 ka 1.105.12.2: RESYNC: (1.105-1.108); FILE MERGED 2004/11/04 17:12:05 ka 1.105.12.1: #i17319# use correct method to set graphic link
Diffstat (limited to 'svx/source/msfilter/msdffimp.cxx')
-rw-r--r--svx/source/msfilter/msdffimp.cxx39
1 files changed, 34 insertions, 5 deletions
diff --git a/svx/source/msfilter/msdffimp.cxx b/svx/source/msfilter/msdffimp.cxx
index 7365bc6ef6..2681891a55 100644
--- a/svx/source/msfilter/msdffimp.cxx
+++ b/svx/source/msfilter/msdffimp.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: msdffimp.cxx,v $
*
- * $Revision: 1.113 $
+ * $Revision: 1.114 $
*
- * last change: $Author: kz $ $Date: 2005-01-18 15:00:39 $
+ * last change: $Author: kz $ $Date: 2005-01-21 15:32:38 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -4223,8 +4223,9 @@ static Size lcl_GetPrefSize(const Graphic& rGraf, MapMode aWanted)
SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, Rectangle& aBoundRect, const DffObjData& rObjData ) const
{
- SdrObject* pRet = NULL;
- String aFilename;
+ SdrObject* pRet = NULL;
+ String aFilename;
+ String aLinkFileName, aLinkFilterName;
MSO_BlipFlags eFlags = (MSO_BlipFlags)GetPropertyValue( DFF_Prop_pibFlags, mso_blipflagDefault );
sal_uInt32 nBlipId = GetPropertyValue( DFF_Prop_pib, 0 );
@@ -4494,7 +4495,28 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, Rect
}
}
if ( bSetFileName )
- ((SdrGrafObj*)pRet)->SetFileName( aName );
+ {
+ String aFilterName;
+ INetURLObject aURLObj( aName );
+
+ if( aURLObj.GetProtocol() == INET_PROT_NOT_VALID )
+ {
+ String aValidURL;
+
+ if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aName, aValidURL ) )
+ aURLObj = INetURLObject( aValidURL );
+ }
+
+ if( aURLObj.GetProtocol() != INET_PROT_NOT_VALID )
+ {
+ GraphicFilter* pGrfFilter = GetGrfFilter();
+ aFilterName = pGrfFilter->GetImportFormatName(
+ pGrfFilter->GetImportFormatNumberForShortName( aURLObj.getExtension() ) );
+ }
+
+ aLinkFileName = aName;
+ aLinkFilterName = aFilterName;
+ }
}
}
if ( !pRet->GetName().Len() ) // SJ 22.02.00 : PPT OLE IMPORT:
@@ -4512,8 +4534,15 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, Rect
}
pRet->SetModel( pSdrModel ); // fuer GraphicLink erforderlich
pRet->SetLogicRect( aBoundRect );
+
if ( pRet->ISA( SdrGrafObj ) )
+ {
+ if( aLinkFileName.Len() )
+ ((SdrGrafObj*)pRet)->SetGraphicLink( aLinkFileName, aLinkFilterName );
+
((SdrGrafObj*)pRet)->ForceSwapOut();
+ }
+
return pRet;
}