Commits

Anonymous committed e0d9929

#i16937# updated call to insert media dialog in sc&sw

Comments (0)

Files changed (4)

avmedia/inc/avmedia/mediawindow.hxx

         static void         getMediaFilters( FilterNameVector& rFilterNameVector );
 		static bool			getMediaFilterForURL( const ::rtl::OUString& rURL, FilterInfo& rFilterInfo );
 
-        static bool         executeMediaURLDialog( Window* pParent, ::rtl::OUString& rURL, bool bInsertDialog = true );
-
-
         static bool         executeInsertMediaURLDialog( Window* pParent, ::rtl::OUString& rURL, sal_Bool& rLink );
         static bool         executeOpenMediaURLDialog( Window* pParent, ::rtl::OUString& rURL );
 

sc/source/ui/drawfunc/fuins1.cxx

 
 void lcl_InsertMedia( const ::rtl::OUString& rMediaURL, bool bApi,
 					  ScTabViewShell* pViewSh, Window* pWindow, SdrView* pView,
-					  const Size& rPrefSize )
+					  const Size& rPrefSize, bool bLinked )
 {
 	SdrPageView* 	pPV  = pView->GetSdrPageView();
 	SdrPage* 		pPage = pPV->GetPage();
 	
 	pObj->setURL( rMediaURL ); 
 	pView->InsertObjectAtView( pObj, *pPV, bApi ? SDRINSERT_DONTMARK : 0 );
+	
+	if( !bLinked )
+	    pObj->breakLink();
 }
 
 /*************************************************************************
     FuPoor(pViewSh, pWin, pViewP, pDoc, rReq)
 {
 	::rtl::OUString 	aURL;
+	sal_Bool            bLinked = sal_True;
 	const SfxItemSet*	pReqArgs = rReq.GetArgs();
 	bool				bAPI = false;
 
 			aURL = pStringItem->GetValue();
 			bAPI = aURL.getLength();
 		}
+		
+		const SfxBoolItem* pBoolItem = dynamic_cast< const SfxBoolItem* >( &pReqArgs->Get( FN_PARAM_1 ) );
+		if( pBoolItem )
+		{
+		    bLinked = pBoolItem->GetValue() ? sal_True : sal_False;
+		}		
 	}
 
-	if( bAPI || ::avmedia::MediaWindow::executeMediaURLDialog( pWindow, aURL ) )
+	if( bAPI || ::avmedia::MediaWindow::executeInsertMediaURLDialog( pWindow, aURL, bLinked ) )
 	{
 		Size aPrefSize;
 
 		}
 		else
 		{
-			lcl_InsertMedia( aURL, bAPI, pViewSh, pWindow, pView, aPrefSize );
+			lcl_InsertMedia( aURL, bAPI, pViewSh, pWindow, pView, aPrefSize, bLinked );
 		
 			if( pWin )
 				pWin->LeaveWait();

sd/source/ui/func/fuinsert.cxx

 void FuInsertAVMedia::DoExecute( SfxRequest& rReq )
 {
 	::rtl::OUString 	aURL;
-	sal_Bool            bLinked = sal_False;
+	sal_Bool            bLinked = sal_True;
 	const SfxItemSet*	pReqArgs = rReq.GetArgs();
 	bool				bAPI = false;
 

sw/source/ui/shells/grfshex.cxx

 bool SwTextShell::InsertMediaDlg( SfxRequest& rReq )
 {
 	::rtl::OUString 	aURL;
+	sal_Bool            bLinked = sal_True;
 	const SfxItemSet*	pReqArgs = rReq.GetArgs();
 	Window*				pWindow = &GetView().GetViewFrame()->GetWindow();
 	bool				bAPI = false, bRet = false;
 			aURL = pStringItem->GetValue();
 			bAPI = aURL.getLength();
 		}
+		
+		const SfxBoolItem* pBoolItem = dynamic_cast< const SfxBoolItem* >( &pReqArgs->Get( FN_PARAM_1 ) );
+		if( pBoolItem )
+		{
+		    bLinked = pBoolItem->GetValue() ? sal_True : sal_False;
+		}		
 	}
 
-	if( bAPI || ::avmedia::MediaWindow::executeMediaURLDialog( pWindow, aURL ) )
+	if( bAPI || ::avmedia::MediaWindow::executeInsertMediaURLDialog( pWindow, aURL, bLinked ) )
 	{
 		Size aPrefSize;
 
 			pObj->setURL( aURL );
 			rSh.EnterStdMode();
 			rSh.SwFEShell::Insert( *pObj, 0, 0, &aPos );
+			
+			if( !bLinked )
+			    pObj->breakLink();
 			bRet = true;
 
 			if( pWindow )