diff options
Diffstat (limited to 'sfx2/source/doc')
-rw-r--r-- | sfx2/source/doc/DocumentMetadataAccess.cxx | 25 | ||||
-rw-r--r-- | sfx2/source/doc/SfxDocumentMetaData.cxx | 7 | ||||
-rw-r--r-- | sfx2/source/doc/applet.cxx | 383 | ||||
-rw-r--r-- | sfx2/source/doc/doc.hrc | 1 | ||||
-rw-r--r-- | sfx2/source/doc/doc.src | 8 | ||||
-rw-r--r-- | sfx2/source/doc/docfac.cxx | 19 | ||||
-rw-r--r-- | sfx2/source/doc/docfile.cxx | 47 | ||||
-rw-r--r-- | sfx2/source/doc/doctdlg.src | 8 | ||||
-rw-r--r-- | sfx2/source/doc/doctemplates.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/docvor.src | 7 | ||||
-rw-r--r-- | sfx2/source/doc/iframe.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/makefile.mk | 2 | ||||
-rw-r--r-- | sfx2/source/doc/new.src | 18 | ||||
-rw-r--r-- | sfx2/source/doc/objcont.cxx | 11 | ||||
-rw-r--r--[-rwxr-xr-x] | sfx2/source/doc/objmisc.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/objserv.cxx | 18 | ||||
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 43 | ||||
-rw-r--r--[-rwxr-xr-x] | sfx2/source/doc/objxtor.cxx | 7 | ||||
-rw-r--r-- | sfx2/source/doc/querytemplate.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/doc/sfxbasemodel.cxx | 13 | ||||
-rw-r--r-- | sfx2/source/doc/syspathw32.cxx | 2 |
21 files changed, 151 insertions, 478 deletions
diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx index 9625ea958830..df0781be8877 100644 --- a/sfx2/source/doc/DocumentMetadataAccess.cxx +++ b/sfx2/source/doc/DocumentMetadataAccess.cxx @@ -45,6 +45,8 @@ #include <rtl/uuid.h> #include <rtl/ustrbuf.hxx> +#include <rtl/uri.hxx> +#include <rtl/bootstrap.hxx> #include <comphelper/interaction.hxx> #include <comphelper/makesequence.hxx> @@ -136,6 +138,24 @@ uno::Reference<rdf::XURI> createBaseURI( throw uno::RuntimeException(); } + // #i108078# workaround non-hierarchical vnd.sun.star.expand URIs + // this really should be done somewhere else, not here. + ::rtl::OUString pkgURI(i_rPkgURI); + if (pkgURI.matchIgnoreAsciiCaseAsciiL( + RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.expand:"))) + { + // expand it here (makeAbsolute requires hierarchical URI) + pkgURI = pkgURI.copy( RTL_CONSTASCII_LENGTH("vnd.sun.star.expand:") ); + if (pkgURI.getLength() != 0) { + pkgURI = ::rtl::Uri::decode( + pkgURI, rtl_UriDecodeStrict, RTL_TEXTENCODING_UTF8); + if (pkgURI.getLength() == 0) { + throw uno::RuntimeException(); + } + ::rtl::Bootstrap::expandMacros(pkgURI); + } + } + const uno::Reference<lang::XMultiComponentFactory> xServiceFactory( i_xContext->getServiceManager(), uno::UNO_SET_THROW); const uno::Reference<uri::XUriReferenceFactory> xUriFactory( @@ -146,11 +166,12 @@ uno::Reference<rdf::XURI> createBaseURI( uno::Reference< uri::XUriReference > xBaseURI; const uno::Reference< uri::XUriReference > xPkgURI( - xUriFactory->parse(i_rPkgURI), uno::UNO_SET_THROW ); + xUriFactory->parse(pkgURI), uno::UNO_SET_THROW ); xPkgURI->clearFragment(); + // need to know whether the storage is a FileSystemStorage // XServiceInfo would be better, but it is not implemented -// if ( i_rPkgURI.getLength() && ::utl::UCBContentHelper::IsFolder(i_rPkgURI) ) +// if ( pkgURI.getLength() && ::utl::UCBContentHelper::IsFolder(pkgURI) ) if (true) { xBaseURI.set( xPkgURI, uno::UNO_SET_THROW ); #if 0 diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx index 14474dd2904d..f18e903eb6e4 100644 --- a/sfx2/source/doc/SfxDocumentMetaData.cxx +++ b/sfx2/source/doc/SfxDocumentMetaData.cxx @@ -2380,12 +2380,5 @@ extern "C" void * SAL_CALL component_getFactory( return ::cppu::component_getFactoryHelper( implName, serviceManager, registryKey, entries); } - -extern "C" sal_Bool SAL_CALL component_writeInfo( - void * serviceManager, void * registryKey) -{ - return ::cppu::component_writeInfoHelper(serviceManager, registryKey, - entries); -} #endif diff --git a/sfx2/source/doc/applet.cxx b/sfx2/source/doc/applet.cxx deleted file mode 100644 index 844eb5726b1a..000000000000 --- a/sfx2/source/doc/applet.cxx +++ /dev/null @@ -1,383 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sfx2.hxx" - -#include "applet.hxx" -#include <sfx2/sfxdlg.hxx> -#include <sfx2/sfxsids.hrc> - -#include "com/sun/star/uno/XComponentContext.hpp" -#include "cppuhelper/factory.hxx" -#include <tools/urlobj.hxx> -#include <tools/debug.hxx> -#include <sj2/sjapplet.hxx> -#include <vcl/syschild.hxx> -#include <rtl/ustring.hxx> -#include <toolkit/helper/vclunohelper.hxx> -#include <unotools/javaoptions.hxx> -#include <svtools/miscopt.hxx> -#include <comphelper/TypeGeneration.hxx> - -using namespace ::com::sun::star; -using namespace ::comphelper; - -namespace sfx2 -{ -class AppletWindow_Impl : public SystemChildWindow -{ -public: - SjApplet2* pApplet; - AppletWindow_Impl( Window* pParent, SjApplet2* pApp ) - : SystemChildWindow( pParent, WB_CLIPCHILDREN ) - , pApplet(pApp) - {} - - virtual void Resize(); -}; - -void AppletWindow_Impl::Resize() -{ - Size aSize( GetOutputSizePixel() ); - if ( pApplet ) - pApplet->setSizePixel( aSize ); -} - -class AppletWrapper_Impl : public SjApplet2 -{ - virtual void appletResize( const Size & ); - virtual void showDocument( const INetURLObject &, const XubString & ); - virtual void showStatus( const XubString & ); -}; - -void AppletWrapper_Impl::appletResize( const Size & ) {} -void AppletWrapper_Impl::showDocument( const INetURLObject &, const XubString & ) {} -void AppletWrapper_Impl::showStatus( const XubString & ) {} - -#define PROPERTY_UNBOUND 0 -#define PROPERTY_MAYBEVOID ::com::sun::star::beans::PropertyAttribute::MAYBEVOID - -#define WID_APPLET_CODE 1 -#define WID_APPLET_CODEBASE 2 -#define WID_APPLET_COMMANDS 3 -#define WID_APPLET_DOCBASE 4 -#define WID_APPLET_ISSCRIPT 5 -#define WID_APPLET_NAME 6 -const SfxItemPropertyMapEntry* lcl_GetAppletPropertyMap_Impl() -{ - static SfxItemPropertyMapEntry aAppletPropertyMap_Impl[] = - { - { MAP_CHAR_LEN("AppletCode") , WID_APPLET_CODE , CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_UNBOUND, 0 }, - { MAP_CHAR_LEN("AppletCodeBase"), WID_APPLET_CODEBASE , CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_UNBOUND, 0 }, - { MAP_CHAR_LEN("AppletCommands"), WID_APPLET_COMMANDS , CPPU_E2T(CPPUTYPE_PROPERTYVALUE), PROPERTY_UNBOUND, 0 }, - { MAP_CHAR_LEN("AppletDocBase"), WID_APPLET_DOCBASE , CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_UNBOUND, 0 }, - { MAP_CHAR_LEN("AppletIsScript"), WID_APPLET_ISSCRIPT , CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_UNBOUND, 0 }, - { MAP_CHAR_LEN("AppletName") , WID_APPLET_NAME , CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_UNBOUND, 0 }, - {0,0,0,0,0,0} - }; -return aAppletPropertyMap_Impl; -} - -::rtl::OUString AppletObject::getImplementationName() - throw( ::com::sun::star::uno::RuntimeException ) -{ - return impl_getStaticImplementationName(); -} - -::sal_Bool AppletObject::supportsService( const ::rtl::OUString& sServiceName ) - throw( ::com::sun::star::uno::RuntimeException ) -{ - ::com::sun::star::uno::Sequence< ::rtl::OUString > seqServiceNames = - getSupportedServiceNames(); - const ::rtl::OUString* pArray = seqServiceNames.getConstArray(); - for ( ::sal_Int32 nCounter=0; nCounter<seqServiceNames.getLength(); - nCounter++ ) - { - if ( pArray[nCounter] == sServiceName ) - { - return sal_True ; - } - } - return sal_False ; -} - -::com::sun::star::uno::Sequence< ::rtl::OUString > -AppletObject::getSupportedServiceNames() - throw( ::com::sun::star::uno::RuntimeException ) -{ - return impl_getStaticSupportedServiceNames(); -} - -::com::sun::star::uno::Sequence< ::rtl::OUString > -AppletObject::impl_getStaticSupportedServiceNames() -{ - ::com::sun::star::uno::Sequence< ::rtl::OUString > seqServiceNames( 1 ); - seqServiceNames.getArray() [0] = ::rtl::OUString::createFromAscii( - "com.sun.star.embed.SpecialEmbeddedObject" ); - return seqServiceNames ; -} - -::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > -AppletObject::impl_createInstance( - const ::com::sun::star::uno::Reference< - ::com::sun::star::uno::XComponentContext >& xContext ) - throw( ::com::sun::star::uno::Exception ) -{ - return static_cast< ::cppu::OWeakObject * >( new AppletObject( xContext ) ); -} - -::rtl::OUString AppletObject::impl_getStaticImplementationName() -{ - return ::rtl::OUString::createFromAscii( - "com.sun.star.comp.sfx2.AppletObject" ); -} - -::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > -AppletObject::impl_createFactory() -{ - return uno::Reference< uno::XInterface >( - cppu::createSingleComponentFactory( - impl_createInstance, impl_getStaticImplementationName(), - impl_getStaticSupportedServiceNames() ), - uno::UNO_QUERY_THROW ); -} - -AppletObject::AppletObject( - const uno::Reference < uno::XComponentContext >& rContext ) - : mxContext( rContext ) - , maPropMap( lcl_GetAppletPropertyMap_Impl() ) - , mpApplet( NULL ) - , mbMayScript( FALSE ) -{ -} - -AppletObject::~AppletObject() -{ -} - -void SAL_CALL AppletObject::initialize( const uno::Sequence< uno::Any >& aArguments ) throw ( uno::Exception, uno::RuntimeException ) -{ - if ( aArguments.getLength() ) - aArguments[0] >>= mxObj; -} - -sal_Bool SAL_CALL AppletObject::load( - const uno::Sequence < com::sun::star::beans::PropertyValue >& /*lDescriptor*/, - const uno::Reference < frame::XFrame >& xFrame ) -throw( uno::RuntimeException ) -{ - if ( SvtJavaOptions().IsExecuteApplets() && SvtMiscOptions().IsPluginsEnabled() ) - { - mpApplet = new AppletWrapper_Impl; - - Window* pParent = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() ); - Window* pWin = new AppletWindow_Impl( pParent, mpApplet ); - pWin->SetBackground(); - pWin->Show(); - - // aCmdList.Append( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "width" ) ), String( aPosSize.GetWidth() ) ); - // aCmdList.Append( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "height" ) ), String( aPosSize.GetHeight() ) ); - - if( maName.getLength() ) - maCmdList.Append( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "name" ) ), maName ); - - if( maCodeBase.getLength() ) - { - for ( sal_uInt32 nParams=0; nParams<maCmdList.Count(); nParams++ ) - { - if ( maCmdList[nParams].GetCommand().EqualsAscii("codebase") ) - { - maCmdList.Remove(nParams); - break; - } - } - - maCmdList.Append( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "codebase" ) ), maCodeBase ); - } - - if( maClass.getLength() ) - maCmdList.Append( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "code" ) ), maClass ); - - if( mbMayScript ) - maCmdList.Append( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "mayscript" ) ), String() ); - - INetURLObject aDocBase( maDocBase ); - mpApplet->Init( mxContext, pWin, aDocBase, maCmdList ); - uno::Reference < awt::XWindow > xWindow( pWin->GetComponentInterface(), uno::UNO_QUERY ); - - // we must destroy the applet before the parent is destroyed - xWindow->addEventListener( this ); - - xFrame->setComponent( xWindow, uno::Reference < frame::XController >() ); - return TRUE; - } - - return FALSE; -} - -void SAL_CALL AppletObject::cancel() throw( com::sun::star::uno::RuntimeException ) -{ - if ( mpApplet ) - { - mpApplet->appletClose(); // reparenting window - DELETEZ( mpApplet ); - } -} - -void SAL_CALL AppletObject::close( sal_Bool /*bDeliverOwnership*/ ) throw( com::sun::star::util::CloseVetoException, com::sun::star::uno::RuntimeException ) -{ -} - -void SAL_CALL AppletObject::addCloseListener( const com::sun::star::uno::Reference < com::sun::star::util::XCloseListener >& ) throw( com::sun::star::uno::RuntimeException ) -{ -} - -void SAL_CALL AppletObject::removeCloseListener( const com::sun::star::uno::Reference < com::sun::star::util::XCloseListener >& ) throw( com::sun::star::uno::RuntimeException ) -{ -} - -void SAL_CALL AppletObject::disposing( const com::sun::star::lang::EventObject& ) throw (com::sun::star::uno::RuntimeException) -{ - cancel(); -} - -uno::Reference< beans::XPropertySetInfo > SAL_CALL AppletObject::getPropertySetInfo() throw( ::com::sun::star::uno::RuntimeException ) -{ - static uno::Reference< beans::XPropertySetInfo > xInfo = new SfxItemPropertySetInfo( &maPropMap ); - return xInfo; -} - -void SAL_CALL AppletObject::setPropertyValue(const ::rtl::OUString& aPropertyName, const uno::Any& aAny) - throw ( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException) -{ - - const SfxItemPropertySimpleEntry* pEntry = maPropMap.getByName( aPropertyName ); - if( !pEntry ) - throw beans::UnknownPropertyException(); - switch( pEntry->nWID ) - { - case WID_APPLET_CODE : - aAny >>= maClass; - break; - case WID_APPLET_CODEBASE : - //pImpl->aCodeBase = rURL.GetMainURL( INetURLObject::NO_DECODE ); - //if( rURL.GetProtocol() == INET_PROT_FILE - // && pImpl->aCodeBase.GetChar( 9 ) == INET_ENC_DELIM_TOKEN ) - // // Laufwerksbuchstabe auf ':' patchen - // pImpl->aCodeBase.SetChar( 9, INET_DELIM_TOKEN ); - - aAny >>= maCodeBase; - break; - case WID_APPLET_COMMANDS : - { - maCmdList.Clear(); - uno::Sequence < beans::PropertyValue > aCommandSequence; - if( aAny >>= aCommandSequence ) - maCmdList.FillFromSequence( aCommandSequence ); - } - break; - case WID_APPLET_DOCBASE : - aAny >>= maDocBase; - break; - case WID_APPLET_ISSCRIPT : - aAny >>= mbMayScript; - break; - case WID_APPLET_NAME : - aAny >>= maName; - break; - default:; - - } -} - -uno::Any SAL_CALL AppletObject::getPropertyValue(const ::rtl::OUString& aPropertyName) throw ( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) -{ - uno::Any aAny; - const SfxItemPropertySimpleEntry* pEntry = maPropMap.getByName( aPropertyName ); - if( !pEntry ) - throw beans::UnknownPropertyException(); - switch( pEntry->nWID ) - { - case WID_APPLET_CODE : - aAny <<= maClass; - break; - case WID_APPLET_CODEBASE : - aAny <<= maCodeBase; - break; - case WID_APPLET_COMMANDS : - { - uno::Sequence< beans::PropertyValue > aCommandSequence; - maCmdList.FillSequence( aCommandSequence ); - aAny <<= aCommandSequence; - } - break; - case WID_APPLET_DOCBASE : - break; - case WID_APPLET_ISSCRIPT : - aAny <<= mbMayScript; - break; - case WID_APPLET_NAME : - aAny <<= maName; - break; - default:; - - } - return aAny; -} - -void SAL_CALL AppletObject::addPropertyChangeListener(const ::rtl::OUString&, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener > & ) throw( ::com::sun::star::uno::RuntimeException ) -{ -} - -void SAL_CALL AppletObject::removePropertyChangeListener(const ::rtl::OUString&, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener > & ) throw( ::com::sun::star::uno::RuntimeException ) -{ -} - -void SAL_CALL AppletObject::addVetoableChangeListener(const ::rtl::OUString&, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener > & ) throw( ::com::sun::star::uno::RuntimeException ) -{ -} - -void SAL_CALL AppletObject::removeVetoableChangeListener(const ::rtl::OUString&, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener > & ) throw( ::com::sun::star::uno::RuntimeException ) -{ -} - -::sal_Int16 SAL_CALL AppletObject::execute() throw (::com::sun::star::uno::RuntimeException) -{ - SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); - uno::Reference < beans::XPropertySet > xSet( this ); - VclAbstractDialog* pDlg = pFact->CreateEditObjectDialog( NULL, SID_INSERT_APPLET, mxObj ); - if ( pDlg ) - pDlg->Execute(); - return 0; -} - -void SAL_CALL AppletObject::setTitle( const ::rtl::OUString& ) throw (::com::sun::star::uno::RuntimeException) -{ -} - -} diff --git a/sfx2/source/doc/doc.hrc b/sfx2/source/doc/doc.hrc index 838168e64526..7e8fd688af52 100644 --- a/sfx2/source/doc/doc.hrc +++ b/sfx2/source/doc/doc.hrc @@ -44,7 +44,6 @@ #define STR_NOSTARTPRINTER (RID_SFX_DOC_START+ 8) #define MSG_CONFIRM_FILTER (RID_SFX_DOC_START+11) #define MSG_CONFIRM_OVERWRITE_TEMPLATE (RID_SFX_DOC_START+12) -#define MSG_QUERY_LOAD_TEMPLATE (RID_SFX_DOC_START+13) #define STR_DELETE_REGION (RID_SFX_DOC_START+14) #define STR_DELETE_TEMPLATE (RID_SFX_DOC_START+15) diff --git a/sfx2/source/doc/doc.src b/sfx2/source/doc/doc.src index d17b62c9b52a..497d4ccd7c97 100644 --- a/sfx2/source/doc/doc.src +++ b/sfx2/source/doc/doc.src @@ -43,14 +43,6 @@ QueryBox MSG_CONFIRM_OVERWRITE_TEMPLATE DefButton = WB_DEF_NO ; Message [ en-US ] = "Name already in use.\nDo you want to overwrite document template?" ; }; -QueryBox MSG_QUERY_LOAD_TEMPLATE -{ - BUTTONS = WB_YES_NO ; - DEFBUTTON = WB_DEF_NO ; - HelpId = MSG_QUERY_LOAD_TEMPLATE; - - Message [ en-US ] = "The Styles in this document do not match your current Styles. Should your current Styles be applied to this document?"; -}; String STR_DELETE_REGION { Text [ en-US ] = "Are you sure you want to delete the region \"$1\"?" ; diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx index bfd67210ec44..4311559f94af 100644 --- a/sfx2/source/doc/docfac.cxx +++ b/sfx2/source/doc/docfac.cxx @@ -159,6 +159,21 @@ void SfxObjectFactory::RegisterViewFactory SfxViewFactory &rFactory ) { +#if OSL_DEBUG_LEVEL > 0 + { + const String sViewName( rFactory.GetAPIViewName() ); + for ( sal_uInt16 i = 0; i < pImpl->aViewFactoryArr.Count(); ++i ) + { + if ( !pImpl->aViewFactoryArr[i]->GetAPIViewName().Equals( sViewName ) ) + continue; + ByteString sMessage( "SfxObjectFactory::RegisterViewFactory: duplicate view name '" ); + sMessage += ByteString( sViewName, RTL_TEXTENCODING_ASCII_US ); + sMessage += "'!"; + OSL_ENSURE( false, sMessage.GetBuffer() ); + break; + } + } +#endif sal_uInt16 nPos; for ( nPos = 0; nPos < pImpl->aViewFactoryArr.Count() && @@ -467,7 +482,9 @@ SfxViewFactory* SfxObjectFactory::GetViewFactoryByViewName( const String& i_rVie ) { SfxViewFactory& rViewFac( GetViewFactory( nViewNo ) ); - if ( rViewFac.GetViewName() == i_rViewName ) + if ( ( rViewFac.GetAPIViewName() == i_rViewName ) + || ( rViewFac.GetLegacyViewName() == i_rViewName ) + ) return &rViewFac; } return NULL; diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 1dea202e0d0e..29081e8e8418 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -3717,53 +3717,6 @@ void SfxMedium::SetCachedSignatureState_Impl( sal_uInt16 nState ) pImp->m_nSignatureState = nState; } -//---------------------------------------------------------------- -sal_Bool SfxMedium::EqualURLs( const ::rtl::OUString& aFirstURL, const ::rtl::OUString& aSecondURL ) -{ - sal_Bool bResult = sal_False; - - if ( aFirstURL.getLength() && aSecondURL.getLength() ) - { - INetURLObject aFirst( aFirstURL ); - INetURLObject aSecond( aSecondURL ); - - if ( aFirst.GetProtocol() != INET_PROT_NOT_VALID && aSecond.GetProtocol() != INET_PROT_NOT_VALID ) - { - try - { - ::ucbhelper::ContentBroker* pBroker = ::ucbhelper::ContentBroker::get(); - if ( !pBroker ) - throw uno::RuntimeException(); - - uno::Reference< ::com::sun::star::ucb::XContentIdentifierFactory > xIdFac - = pBroker->getContentIdentifierFactoryInterface(); - if ( !xIdFac.is() ) - throw uno::RuntimeException(); - - uno::Reference< ::com::sun::star::ucb::XContentIdentifier > xIdFirst - = xIdFac->createContentIdentifier( aFirst.GetMainURL( INetURLObject::NO_DECODE ) ); - uno::Reference< ::com::sun::star::ucb::XContentIdentifier > xIdSecond - = xIdFac->createContentIdentifier( aSecond.GetMainURL( INetURLObject::NO_DECODE ) ); - - if ( xIdFirst.is() && xIdSecond.is() ) - { - uno::Reference< ::com::sun::star::ucb::XContentProvider > xProvider = - pBroker->getContentProviderInterface(); - if ( !xProvider.is() ) - throw uno::RuntimeException(); - bResult = !xProvider->compareContentIds( xIdFirst, xIdSecond ); - } - } - catch( uno::Exception& ) - { - OSL_ENSURE( sal_False, "Can't compare URL's, treat as different!\n" ); - } - } - } - - return bResult; -} - BOOL SfxMedium::HasStorage_Impl() const { return pImp->xStorage.is(); diff --git a/sfx2/source/doc/doctdlg.src b/sfx2/source/doc/doctdlg.src index 91d966fbd2d5..1b50fd56c55e 100644 --- a/sfx2/source/doc/doctdlg.src +++ b/sfx2/source/doc/doctdlg.src @@ -28,10 +28,11 @@ #include <sfx2/sfx.hrc> #include "doc.hrc" #include "doctdlg.hrc" +#include <sfx2/sfxcommands.h> ModalDialog DLG_DOC_TEMPLATE { - HelpId = SID_DOCTEMPLATE ; + HelpId = CMD_SID_DOCTEMPLATE ; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 280 , 128 ) ; @@ -45,6 +46,7 @@ ModalDialog DLG_DOC_TEMPLATE }; Edit ED_NAME { + HelpID = "sfx2:Edit:DLG_DOC_TEMPLATE:ED_NAME"; Border = TRUE ; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 200 , 12 ) ; @@ -63,6 +65,7 @@ ModalDialog DLG_DOC_TEMPLATE }; ListBox LB_SECTION { + HelpID = "sfx2:ListBox:DLG_DOC_TEMPLATE:LB_SECTION"; Border = TRUE ; Pos = MAP_APPFONT ( 12 , 56 ) ; Size = MAP_APPFONT ( 97 , 66 ) ; @@ -75,6 +78,7 @@ ModalDialog DLG_DOC_TEMPLATE }; ListBox LB_STYLESHEETS { + HelpID = "sfx2:ListBox:DLG_DOC_TEMPLATE:LB_STYLESHEETS"; Border = TRUE ; Pos = MAP_APPFONT ( 115 , 56 ) ; Size = MAP_APPFONT ( 97 , 66 ) ; @@ -98,12 +102,14 @@ ModalDialog DLG_DOC_TEMPLATE }; PushButton BT_EDIT { + HelpID = "sfx2:PushButton:DLG_DOC_TEMPLATE:BT_EDIT"; Pos = MAP_APPFONT ( 224 , 62 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Edit" ; }; PushButton BT_ORGANIZE { + HelpID = "sfx2:PushButton:DLG_DOC_TEMPLATE:BT_ORGANIZE"; Pos = MAP_APPFONT ( 224 , 79 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Organizer..." ; diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index b921f2d97f1f..71f3683c0006 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -1919,7 +1919,7 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName, aStoreArgs[1].Value <<= rTemplateName; ::rtl::OUString aCurrentDocumentURL = rStorable->getLocation(); - if( !SfxMedium::EqualURLs( aNewTemplateTargetURL, rStorable->getLocation() )) + if( !::utl::UCBContentHelper::EqualURLs( aNewTemplateTargetURL, rStorable->getLocation() )) rStorable->storeToURL( aNewTemplateTargetURL, aStoreArgs ); else rStorable->store(); diff --git a/sfx2/source/doc/docvor.src b/sfx2/source/doc/docvor.src index 2c9975de9bb8..80ebed8b1708 100644 --- a/sfx2/source/doc/docvor.src +++ b/sfx2/source/doc/docvor.src @@ -37,7 +37,7 @@ ModalDialog DLG_ORGANIZE { - HelpId = SID_ORGANIZER ; + HelpId = CMD_SID_ORGANIZER ; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 271 , 162 ) ; @@ -61,6 +61,7 @@ ModalDialog DLG_ORGANIZE }; PushButton BTN_FILES { + HelpID = "sfx2:PushButton:DLG_ORGANIZE:BTN_FILES"; Pos = MAP_APPFONT ( 205 , 143 ) ; Size = MAP_APPFONT ( 60 , 14 ) ; Text [ en-US ] = "~File..." ; @@ -68,12 +69,14 @@ ModalDialog DLG_ORGANIZE }; PushButton BTN_ADDRESSTEMPLATE { + HelpID = "sfx2:PushButton:DLG_ORGANIZE:BTN_ADDRESSTEMPLATE"; Pos = MAP_APPFONT ( 205 , 124 ) ; Size = MAP_APPFONT ( 60 , 14 ) ; Text [ en-US ] = "~Address Book..." ; }; ListBox LB_LEFT_TYP { + HelpID = "sfx2:ListBox:DLG_ORGANIZE:LB_LEFT_TYP"; Border = TRUE ; Pos = MAP_APPFONT ( 3 , 144 ) ; Size = MAP_APPFONT ( 94 , 55 ) ; @@ -88,6 +91,7 @@ ModalDialog DLG_ORGANIZE }; ListBox LB_RIGHT_TYP { + HelpID = "sfx2:ListBox:DLG_ORGANIZE:LB_RIGHT_TYP"; Border = TRUE ; Pos = MAP_APPFONT ( 103 , 144 ) ; Size = MAP_APPFONT ( 94 , 55 ) ; @@ -142,6 +146,7 @@ ModalDialog DLG_ORGANIZE }; MenuButton BTN_EDIT { + HelpID = "sfx2:MenuButton:DLG_ORGANIZE:BTN_EDIT"; Pos = MAP_APPFONT ( 205 , 23 ) ; Size = MAP_APPFONT ( 60 , 14 ) ; Text [ en-US ] = "Commands" ; diff --git a/sfx2/source/doc/iframe.cxx b/sfx2/source/doc/iframe.cxx index 3ad0cc51a923..f7df58ffd397 100644 --- a/sfx2/source/doc/iframe.cxx +++ b/sfx2/source/doc/iframe.cxx @@ -384,7 +384,7 @@ void SAL_CALL IFrameObject::removeVetoableChangeListener(const ::rtl::OUString&, ::sal_Int16 SAL_CALL IFrameObject::execute() throw (::com::sun::star::uno::RuntimeException) { SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); - VclAbstractDialog* pDlg = pFact->CreateEditObjectDialog( NULL, SID_INSERT_FLOATINGFRAME, mxObj ); + VclAbstractDialog* pDlg = pFact->CreateEditObjectDialog( NULL, rtl::OUString::createFromAscii(".uno:InsertObjectFloatingFrame"), mxObj ); if ( pDlg ) pDlg->Execute(); return 0; diff --git a/sfx2/source/doc/makefile.mk b/sfx2/source/doc/makefile.mk index b1bddf82e428..d663d34cf5ba 100644 --- a/sfx2/source/doc/makefile.mk +++ b/sfx2/source/doc/makefile.mk @@ -87,8 +87,6 @@ SLOFILES = \ $(SLO)$/syspath.obj \ $(SLO)$/syspathw32.obj -# $(SLO)$/applet.obj \ - .IF "$(GUI)" == "WNT" #HACK TO DISABLE PCH diff --git a/sfx2/source/doc/new.src b/sfx2/source/doc/new.src index 146f9f630570..6737128cce43 100644 --- a/sfx2/source/doc/new.src +++ b/sfx2/source/doc/new.src @@ -28,12 +28,14 @@ #include <sfx2/sfx.hrc> #include "doc.hrc" #include "new.hrc" +#include <sfx2/sfxcommands.h> + // pragma ---------------------------------------------------------------- // DLG_NEW_FILE ---------------------------------------------------------- ModalDialog DLG_NEW_FILE { - HelpId = SID_NEWDOC ; + HelpId = CMD_SID_NEWDOC ; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 336 , 96 ) ; @@ -57,6 +59,7 @@ ModalDialog DLG_NEW_FILE }; ListBox LB_REGION { + HelpID = "sfx2:ListBox:DLG_NEW_FILE:LB_REGION"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 18 ) ; Size = MAP_APPFONT ( 127 , 72 ) ; @@ -78,6 +81,7 @@ ModalDialog DLG_NEW_FILE }; ListBox LB_TEMPLATE { + HelpID = "sfx2:ListBox:DLG_NEW_FILE:LB_TEMPLATE"; Border = TRUE ; Pos = MAP_APPFONT ( 139 , 18 ) ; Size = MAP_APPFONT ( 127 , 72 ) ; @@ -85,6 +89,7 @@ ModalDialog DLG_NEW_FILE }; MoreButton BT_MORE { + HelpID = "sfx2:MoreButton:DLG_NEW_FILE:BT_MORE"; Pos = MAP_APPFONT ( 274 , 70 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~More" ; @@ -101,6 +106,7 @@ ModalDialog DLG_NEW_FILE }; CheckBox BTN_PREVIEW { + HelpID = "sfx2:CheckBox:DLG_NEW_FILE:BTN_PREVIEW"; Pos = MAP_APPFONT ( 6 , 96 ) ; Size = MAP_APPFONT ( 97 , 10 ) ; Text [ en-US ] = "Pre~view" ; @@ -115,6 +121,7 @@ ModalDialog DLG_NEW_FILE }; CheckBox CB_TEXT_STYLE { + HelpID = "sfx2:CheckBox:DLG_NEW_FILE:CB_TEXT_STYLE"; Pos = MAP_APPFONT ( 6 , 94 ) ; Size = MAP_APPFONT ( 50 , 10 ) ; Hide = TRUE; @@ -122,6 +129,7 @@ ModalDialog DLG_NEW_FILE }; CheckBox CB_FRAME_STYLE { + HelpID = "sfx2:CheckBox:DLG_NEW_FILE:CB_FRAME_STYLE"; Pos = MAP_APPFONT ( 60 , 94 ) ; Size = MAP_APPFONT ( 50 , 10 ) ; Hide = TRUE; @@ -129,6 +137,7 @@ ModalDialog DLG_NEW_FILE }; CheckBox CB_PAGE_STYLE { + HelpID = "sfx2:CheckBox:DLG_NEW_FILE:CB_PAGE_STYLE"; Pos = MAP_APPFONT ( 114 , 94 ) ; Size = MAP_APPFONT ( 50 , 10 ) ; Hide = TRUE; @@ -136,6 +145,7 @@ ModalDialog DLG_NEW_FILE }; CheckBox CB_NUM_STYLE { + HelpID = "sfx2:CheckBox:DLG_NEW_FILE:CB_NUM_STYLE"; Pos = MAP_APPFONT ( 168 , 94 ) ; Size = MAP_APPFONT ( 50 , 10 ) ; Hide = TRUE; @@ -143,6 +153,7 @@ ModalDialog DLG_NEW_FILE }; CheckBox CB_MERGE_STYLE { + HelpID = "sfx2:CheckBox:DLG_NEW_FILE:CB_MERGE_STYLE"; Pos = MAP_APPFONT ( 222 , 94 ) ; Size = MAP_APPFONT ( 50 , 10 ) ; Hide = TRUE; @@ -150,6 +161,7 @@ ModalDialog DLG_NEW_FILE }; PushButton PB_LOAD_FILE { + HelpID = "sfx2:PushButton:DLG_NEW_FILE:PB_LOAD_FILE"; Pos = MAP_APPFONT ( 274 , 92 ) ; Size = MAP_APPFONT ( 56 , 14 ) ; Hide = TRUE; @@ -168,6 +180,7 @@ ModalDialog DLG_NEW_FILE }; Edit ED_TITLE { + HelpID = "sfx2:Edit:DLG_NEW_FILE:ED_TITLE"; Border = TRUE ; Pos = MAP_APPFONT ( 145 , 121 ) ; Size = MAP_APPFONT ( 175 , 12 ) ; @@ -183,6 +196,7 @@ ModalDialog DLG_NEW_FILE }; Edit ED_THEMA { + HelpID = "sfx2:Edit:DLG_NEW_FILE:ED_THEMA"; Border = TRUE ; Pos = MAP_APPFONT ( 145 , 148 ) ; Size = MAP_APPFONT ( 175 , 12 ) ; @@ -198,6 +212,7 @@ ModalDialog DLG_NEW_FILE }; Edit ED_KEYWORDS { + HelpID = "sfx2:Edit:DLG_NEW_FILE:ED_KEYWORDS"; Border = TRUE ; Pos = MAP_APPFONT ( 145 , 175 ) ; Size = MAP_APPFONT ( 175 , 12 ) ; @@ -213,6 +228,7 @@ ModalDialog DLG_NEW_FILE }; MultiLineEdit ED_DESC { + HelpID = "sfx2:MultiLineEdit:DLG_NEW_FILE:ED_DESC"; Border = TRUE ; Pos = MAP_APPFONT ( 144 , 202 ) ; Size = MAP_APPFONT ( 175 , 32 ) ; diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index 451e33084c07..e0e63da04bb8 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -365,17 +365,6 @@ void SfxObjectShell::TriggerHelpPI(USHORT nIdx1, USHORT nIdx2, USHORT) { SfxStyleSheetBasePool *pStylePool = GetStyleSheetPool(); SetOrganizerSearchMask(pStylePool); -#ifdef WIR_KOENNEN_WIEDER_HILFE_FUER_STYLESHEETS - SfxStyleSheetBase *pStyle = (*pStylePool)[nIdx2]; - if(pStyle) - { - String aHelpFile; - ULONG nHelpId=pStyle->GetHelpId(aHelpFile); - SfxHelpPI* pHelpPI = SFX_APP()->GetHelpPI(); - if ( pHelpPI && nHelpId ) - pHelpPI->LoadTopic( nHelpId ); - } -#endif } } diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index addb648ef2e9..e386b2382acf 100755..100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -732,7 +732,7 @@ void SfxObjectShell::FreeSharedFile( const ::rtl::OUString& aTempFileURL ) SetSharedXMLFlag( sal_False ); if ( IsDocShared() && aTempFileURL.getLength() - && !SfxMedium::EqualURLs( aTempFileURL, GetSharedFileURL() ) ) + && !::utl::UCBContentHelper::EqualURLs( aTempFileURL, GetSharedFileURL() ) ) { if ( pImp->m_bAllowShareControlFileClean ) { diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index c063546da1c7..bb0e6939ead8 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -489,6 +489,13 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) case SID_SAVEASDOC: case SID_SAVEDOC: { + // derived class may decide to abort this + if( !QuerySlotExecutable( nId ) ) + { + rReq.SetReturnValue( SfxBoolItem( 0, FALSE ) ); + return; + } + //!! detaillierte Auswertung eines Fehlercodes SfxObjectShellRef xLock( this ); @@ -895,7 +902,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) rReq.Done(); } -//-------------------------------------------------------------------- +//------------------------------------------------------------------------- void SfxObjectShell::GetState_Impl(SfxItemSet &rSet) { @@ -1337,8 +1344,13 @@ sal_uInt16 SfxObjectShell::ImplGetSignatureState( sal_Bool bScriptingContent ) void SfxObjectShell::ImplSign( sal_Bool bScriptingContent ) { // Check if it is stored in OASIS format... - if ( GetMedium() && GetMedium()->GetFilter() - && ( !GetMedium()->GetFilter()->IsOwnFormat() || !GetMedium()->HasStorage_Impl() ) ) + if ( GetMedium() + && GetMedium()->GetFilter() + && GetMedium()->GetName().Len() + && ( !GetMedium()->GetFilter()->IsOwnFormat() + || !GetMedium()->HasStorage_Impl() + ) + ) { // Only OASIS and OOo6.x formats will be handled further InfoBox( NULL, SfxResId( RID_XMLSEC_INFO_WRONGDOCFORMAT ) ).Execute(); diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 49188defc4f1..037493c61252 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -195,6 +195,13 @@ sal_Bool SfxObjectShell::SaveAs( SfxMedium& rMedium ) //------------------------------------------------------------------------- +sal_Bool SfxObjectShell::QuerySlotExecutable( USHORT /*nSlotId*/ ) +{ + return sal_True; +} + +//------------------------------------------------------------------------- + sal_Bool GetPasswd_Impl( const SfxItemSet* pSet, ::rtl::OUString& rPasswd ) { const SfxPoolItem* pItem = NULL; @@ -1182,7 +1189,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl if ( pMedium && pMedium->GetName().CompareIgnoreCaseToAscii( "private:stream", 14 ) != COMPARE_EQUAL && rMedium.GetName().CompareIgnoreCaseToAscii( "private:stream", 14 ) != COMPARE_EQUAL - && SfxMedium::EqualURLs( pMedium->GetName(), rMedium.GetName() ) ) + && ::utl::UCBContentHelper::EqualURLs( pMedium->GetName(), rMedium.GetName() ) ) { bStoreToSameLocation = sal_True; AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Save" ) ) ); @@ -1910,7 +1917,25 @@ sal_Bool SfxObjectShell::ConnectTmpStorage_Impl( bResult = SaveCompleted( xTmpStorage ); if ( bResult ) + { pImp->pBasicManager->setStorage( xTmpStorage ); + + // Get rid of this workaround after issue i113914 is fixed + try + { + uno::Reference< script::XStorageBasedLibraryContainer > xBasicLibraries( pImp->xBasicLibraries, uno::UNO_QUERY_THROW ); + xBasicLibraries->setRootStorage( xTmpStorage ); + } + catch( uno::Exception& ) + {} + try + { + uno::Reference< script::XStorageBasedLibraryContainer > xDialogLibraries( pImp->xDialogLibraries, uno::UNO_QUERY_THROW ); + xDialogLibraries->setRootStorage( xTmpStorage ); + } + catch( uno::Exception& ) + {} + } } catch( uno::Exception& ) {} @@ -2056,6 +2081,22 @@ sal_Bool SfxObjectShell::DoSaveCompleted( SfxMedium* pNewMed ) // TODO/LATER: may be this code will be replaced, but not sure // Set storage in document library containers pImp->pBasicManager->setStorage( xStorage ); + + // Get rid of this workaround after issue i113914 is fixed + try + { + uno::Reference< script::XStorageBasedLibraryContainer > xBasicLibraries( pImp->xBasicLibraries, uno::UNO_QUERY_THROW ); + xBasicLibraries->setRootStorage( xStorage ); + } + catch( uno::Exception& ) + {} + try + { + uno::Reference< script::XStorageBasedLibraryContainer > xDialogLibraries( pImp->xDialogLibraries, uno::UNO_QUERY_THROW ); + xDialogLibraries->setRootStorage( xStorage ); + } + catch( uno::Exception& ) + {} } else { diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index f202266dd74e..b7567b89f02f 100755..100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -526,6 +526,13 @@ SfxObjectShell* SfxObjectShell::Current() return pFrame ? pFrame->GetObjectShell() : 0; } +//------------------------------------------------------------------------- + +sal_Bool SfxObjectShell::IsInPrepareClose() const +{ + return pImp->bInPrepareClose; +} + //------------------------------------------------------------------------ struct BoolEnv_Impl diff --git a/sfx2/source/doc/querytemplate.cxx b/sfx2/source/doc/querytemplate.cxx index 8e006721351a..3e6a529bc67e 100644 --- a/sfx2/source/doc/querytemplate.cxx +++ b/sfx2/source/doc/querytemplate.cxx @@ -31,7 +31,7 @@ #include "querytemplate.hxx" #include "sfxresid.hxx" #include "doc.hrc" - +#include "helpid.hrc" #include <vcl/svapp.hxx> namespace sfx2 @@ -41,7 +41,7 @@ QueryTemplateBox::QueryTemplateBox( Window* pParent, const String& rMessage ) : MessBox ( pParent, 0, Application::GetDisplayName(), rMessage ) { SetImage( QueryBox::GetStandardImage() ); - SetHelpId( MSG_QUERY_LOAD_TEMPLATE ); + SetHelpId( HID_QUERY_LOAD_TEMPLATE ); AddButton( String( SfxResId( STR_QRYTEMPL_UPDATE_BTN ) ), RET_YES, BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON ); diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index b5a9536b12c5..846cc669b9a7 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -95,6 +95,7 @@ #include <framework/titlehelper.hxx> #include <comphelper/numberedcollection.hxx> #include <unotools/ucbstreamhelper.hxx> +#include <unotools/ucbhelper.hxx> //________________________________________________________________________________________________________ // includes of my own project @@ -977,6 +978,8 @@ sal_Bool SAL_CALL SfxBaseModel::attachResource( const ::rtl::OUString& aArgs.remove( "BreakMacroSignature" ); aArgs.remove( "Stream" ); aArgs.remove( "InputStream" ); + aArgs.remove( "URL" ); + aArgs.remove( "Frame" ); // TODO/LATER: all the parameters that are accepted by ItemSet of the DocShell must be removed here @@ -988,6 +991,10 @@ sal_Bool SAL_CALL SfxBaseModel::attachResource( const ::rtl::OUString& SfxAllItemSet aSet( pObjectShell->GetPool() ); TransformParameters( SID_OPENDOC, rArgs, aSet ); + // the arguments are not allowed to reach the medium + aSet.ClearItem( SID_FILE_NAME ); + aSet.ClearItem( SID_FILLFRAME ); + pMedium->GetItemSet()->Put( aSet ); SFX_ITEMSET_ARG( &aSet, pItem, SfxStringItem, SID_FILTER_NAME, sal_False ); if ( pItem ) @@ -2642,7 +2649,7 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL sal_Bool bSaved = sal_False; if ( !bSaveTo && m_pData->m_pObjectShell && sURL.getLength() && sURL.compareToAscii( "private:stream", 14 ) != COMPARE_EQUAL - && SfxMedium::EqualURLs( getLocation(), sURL ) ) + && ::utl::UCBContentHelper::EqualURLs( getLocation(), sURL ) ) { // this is the same file URL as the current document location, try to use storeOwn if possible @@ -3805,7 +3812,7 @@ css::uno::Sequence< ::rtl::OUString > SAL_CALL SfxBaseModel::getAvailableViewCon Sequence< ::rtl::OUString > aViewNames( nViewFactoryCount ); for ( sal_Int32 nViewNo = 0; nViewNo < nViewFactoryCount; ++nViewNo ) - aViewNames[nViewNo] = rDocumentFactory.GetViewFactory( nViewNo ).GetViewName(); + aViewNames[nViewNo] = rDocumentFactory.GetViewFactory( nViewNo ).GetAPIViewName(); return aViewNames; } @@ -3819,7 +3826,7 @@ css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createDef SfxModelGuard aGuard( *this ); const SfxObjectFactory& rDocumentFactory = GetObjectShell()->GetFactory(); - const ::rtl::OUString sDefaultViewName = rDocumentFactory.GetViewFactory( 0 ).GetViewName(); + const ::rtl::OUString sDefaultViewName = rDocumentFactory.GetViewFactory( 0 ).GetAPIViewName(); aGuard.clear(); diff --git a/sfx2/source/doc/syspathw32.cxx b/sfx2/source/doc/syspathw32.cxx index 73bd84f5249a..c0a163bed39c 100644 --- a/sfx2/source/doc/syspathw32.cxx +++ b/sfx2/source/doc/syspathw32.cxx @@ -74,7 +74,7 @@ typedef unsigned short sal_uInt16; extern "C" bool GetUserTemplateLocation(sal_Unicode* pFolder, int nSize) { #ifdef WNT - return _SHGetSpecialFolderW32( CSIDL_TEMPLATES, pFolder, nSize ); + return _SHGetSpecialFolderW32( CSIDL_TEMPLATES, reinterpret_cast<LPWSTR>(pFolder), nSize ); #else (void)pFolder; (void)nSize; |