INTEGRATION: CWS sb15 (1.24.38); FILE MERGED
2004/03/01 16:44:58 sb 1.24.38.2: #i24360# The parameter of SdTPAction::SetEditText must be a const reference, so that temporaries can be used as actual arguments. 2004/02/26 17:42:57 tbe 1.24.38.1: #i24360# Remove INET_PROT_VND_SUN_STAR_SCRIPT
This commit is contained in:
parent
7bf2fb485b
commit
f6e10388d1
1 changed files with 30 additions and 45 deletions
|
@ -2,9 +2,9 @@
|
|||
*
|
||||
* $RCSfile: tpaction.cxx,v $
|
||||
*
|
||||
* $Revision: 1.25 $
|
||||
* $Revision: 1.26 $
|
||||
*
|
||||
* last change: $Author: obo $ $Date: 2004-03-17 11:27:27 $
|
||||
* last change: $Author: obo $ $Date: 2004-03-19 13:15:59 $
|
||||
*
|
||||
* The Contents of this file are made available subject to the terms of
|
||||
* either of the following licenses
|
||||
|
@ -69,6 +69,15 @@
|
|||
#ifndef _COM_SUN_STAR_PRESENTATION_ANIMATIONSPEED_HPP_
|
||||
#include <com/sun/star/presentation/AnimationSpeed.hpp>
|
||||
#endif
|
||||
#ifndef _COM_SUN_STAR_URI_XURIREFERENCEFACTORY_HPP_
|
||||
#include <com/sun/star/uri/XUriReferenceFactory.hpp>
|
||||
#endif
|
||||
#ifndef _COM_SUN_STAR_URI_XVNDSUNSTARSCRIPTURL_HPP_
|
||||
#include <com/sun/star/uri/XVndSunStarScriptUrl.hpp>
|
||||
#endif
|
||||
#ifndef _COMPHELPER_PROCESSFACTORY_HXX_
|
||||
#include <comphelper/processfactory.hxx>
|
||||
#endif
|
||||
|
||||
#include "sdattr.hxx"
|
||||
|
||||
|
@ -83,16 +92,12 @@
|
|||
#include <osl/file.hxx>
|
||||
#endif
|
||||
#include <sfx2/app.hxx>
|
||||
#include <tools/urlobj.hxx>
|
||||
#ifndef INCLUDED_SVTOOLS_PATHOPTIONS_HXX
|
||||
#include <svtools/pathoptions.hxx>
|
||||
#endif
|
||||
#ifndef _SVDPAGV_HXX //autogen
|
||||
#include <svx/svdpagv.hxx>
|
||||
#endif
|
||||
#ifndef _URLOBJ_HXX
|
||||
#include <tools/urlobj.hxx>
|
||||
#endif
|
||||
#ifndef _UNOTOOLS_LOCALFILEHELPER_HXX
|
||||
#include <unotools/localfilehelper.hxx>
|
||||
#endif
|
||||
|
@ -163,6 +168,8 @@
|
|||
#include <algorithm>
|
||||
|
||||
using namespace ::com::sun::star;
|
||||
using namespace com::sun::star::uno;
|
||||
using namespace com::sun::star::lang;
|
||||
|
||||
static USHORT pActionRanges[] =
|
||||
{
|
||||
|
@ -788,52 +795,30 @@ void SdTPAction::OpenFileDialog()
|
|||
Application::SetDefDialogParent( this );
|
||||
|
||||
// choose macro dialog
|
||||
String aScriptURL = SfxApplication::ChooseMacro(FALSE, TRUE);
|
||||
::rtl::OUString aScriptURL = SfxApplication::ChooseMacro(FALSE, TRUE);
|
||||
|
||||
// aScriptURL has the following format:
|
||||
// vnd.sun.star.script:language=[language],macro=[macro],location=[location]
|
||||
// [language] = StarBasic
|
||||
// [macro] = libname.modulename.macroname
|
||||
// [location] = application|document
|
||||
// e.g. 'vnd.sun.star.script:language=StarBasic,macro=Standard.Module1.Main,location=document'
|
||||
// a scriptURL has the following format:
|
||||
// vnd.sun.star.script:[name]?language=[language]&location=[location]
|
||||
// [name] = [libname].[modulename].[macroname]
|
||||
// [language] = Basic
|
||||
// [location] = application | document
|
||||
// e.g. "vnd.sun.star.script:Standard.Module1.Main?language=Basic&location=document"
|
||||
//
|
||||
// but for the UI we need this format:
|
||||
// 'libname.modulename.macroname'
|
||||
|
||||
if ( aScriptURL.Len() != 0 )
|
||||
if ( aScriptURL.getLength() != 0 )
|
||||
{
|
||||
// parse script URL
|
||||
BOOL bFound;
|
||||
String aValue;
|
||||
INetURLObject aINetScriptURL( aScriptURL );
|
||||
|
||||
// get language
|
||||
String aLanguage;
|
||||
bFound = aINetScriptURL.getParameter( String( RTL_CONSTASCII_USTRINGPARAM("language") ), &aValue );
|
||||
if ( bFound )
|
||||
aLanguage = aValue;
|
||||
|
||||
// get macro
|
||||
String aMacro;
|
||||
String aLibName;
|
||||
String aModuleName;
|
||||
String aMacroName;
|
||||
bFound = aINetScriptURL.getParameter( String( RTL_CONSTASCII_USTRINGPARAM("macro") ), &aValue );
|
||||
if ( bFound )
|
||||
// parse scriptURL
|
||||
Reference< XMultiServiceFactory > xSMgr = ::comphelper::getProcessServiceFactory();
|
||||
Reference< com::sun::star::uri::XUriReferenceFactory > xFactory( xSMgr->createInstance(
|
||||
::rtl::OUString::createFromAscii( "com.sun.star.uri.UriReferenceFactory" ) ), UNO_QUERY );
|
||||
if ( xFactory.is() )
|
||||
{
|
||||
aMacro = aValue;
|
||||
aLibName = aMacro.GetToken(0, sal_Unicode('.'));
|
||||
aModuleName = aMacro.GetToken(1, sal_Unicode('.'));
|
||||
aMacroName = aMacro.GetToken(2, sal_Unicode('.'));
|
||||
Reference< com::sun::star::uri::XVndSunStarScriptUrl > xUrl( xFactory->parse( aScriptURL ), UNO_QUERY );
|
||||
if ( xUrl.is() )
|
||||
SetEditText( xUrl->getName() );
|
||||
}
|
||||
|
||||
// get location
|
||||
String aLocation;
|
||||
bFound = aINetScriptURL.getParameter( String( RTL_CONSTASCII_USTRINGPARAM("location") ), &aValue );
|
||||
if ( bFound )
|
||||
aLocation = aValue;
|
||||
|
||||
SetEditText( aMacro );
|
||||
}
|
||||
|
||||
Application::SetDefDialogParent( pOldWin );
|
||||
|
@ -1290,7 +1275,7 @@ void SdTPAction::SetActualAnimationEffect( presentation::AnimationEffect eAE )
|
|||
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
void SdTPAction::SetEditText( String& rStr )
|
||||
void SdTPAction::SetEditText( String const & rStr )
|
||||
{
|
||||
presentation::ClickAction eCA = GetActualClickAction();
|
||||
String aText(rStr);
|
||||
|
|
Loading…
Reference in a new issue