diff options
Diffstat (limited to 'sfx2/source/doc/objstor.cxx')
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 79 |
1 files changed, 47 insertions, 32 deletions
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 7624e7ef32..38f8fc5570 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,7 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" -#ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> #endif #include <svl/eitem.hxx> @@ -164,7 +164,7 @@ void impl_addToModelCollection(const css::uno::Reference< css::frame::XModel >& css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory(); css::uno::Reference< css::container::XSet > xModelCollection( - xSMGR->createInstance(::rtl::OUString::createFromAscii("com.sun.star.frame.GlobalEventBroadcaster")), + xSMGR->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.GlobalEventBroadcaster"))), css::uno::UNO_QUERY); if (xModelCollection.is()) { @@ -238,7 +238,7 @@ sal_Bool SfxObjectShell::PutURLContentsToVersionStream_Impl( try { uno::Reference< embed::XStorage > xVersion = xDocStorage->openStorageElement( - ::rtl::OUString::createFromAscii( "Versions" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Versions")), embed::ElementModes::READWRITE ); DBG_ASSERT( xVersion.is(), @@ -350,7 +350,7 @@ void SfxObjectShell::SetupStorage( const uno::Reference< embed::XStorage >& xSto { try { - xProps->setPropertyValue( ::rtl::OUString::createFromAscii( "MediaType" ), uno::makeAny( aDataFlavor.MimeType ) ); + xProps->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), uno::makeAny( aDataFlavor.MimeType ) ); } catch( uno::Exception& ) { @@ -369,7 +369,7 @@ void SfxObjectShell::SetupStorage( const uno::Reference< embed::XStorage >& xSto { try { - xProps->setPropertyValue( ::rtl::OUString::createFromAscii( "Version" ), uno::makeAny( aVersion ) ); + xProps->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Version")), uno::makeAny( aVersion ) ); } catch( uno::Exception& ) { @@ -613,6 +613,9 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed ) sal_uInt32 nError = HandleFilter( pMedium, this ); if ( nError != ERRCODE_NONE ) SetError( nError, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + + if (pMedium->GetFilter()->GetFilterFlags() & SFX_FILTER_STARTPRESENTATION) + pSet->Put( SfxBoolItem( SID_DOC_STARTPRESENTATION, TRUE) ); } EnableSetModified( sal_False ); @@ -698,7 +701,7 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed ) if ( pMedium->GetFilter() && ( pMedium->GetFilter()->GetFilterFlags() & SFX_FILTER_STARONEFILTER ) ) { uno::Reference < beans::XPropertySet > xSet( GetModel(), uno::UNO_QUERY ); - ::rtl::OUString sLockUpdates(::rtl::OUString::createFromAscii("LockUpdates")); + ::rtl::OUString sLockUpdates(RTL_CONSTASCII_USTRINGPARAM("LockUpdates")); bool bSetProperty = true; try { @@ -845,24 +848,12 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed ) pRequest->addContinuation( new ::comphelper::OInteractionApprove ); pRequest->addContinuation( new ::comphelper::OInteractionAbort ); - typedef ::comphelper::OInteraction< XInteractionAskLater > OInteractionAskLater; - OInteractionAskLater* pLater = new OInteractionAskLater; - pRequest->addContinuation( pLater ); + bool bReconnectDde = true; // by default, we try to auto-connect DDE connections. + if (pDdeReconnectItem) + bReconnectDde = pDdeReconnectItem->GetValue(); - try - { - xHandler->handle( pRequest.get() ); - } - catch( const Exception& ) - { - DBG_UNHANDLED_EXCEPTION(); - } - if ( pLater->wasSelected() ) - SFX_APP()->Get_Impl()->bODFVersionWarningLater = true; - } - } - } - } + if (bReconnectDde) + ReconnectDdeLinks(*this); } else GetpApp()->HideStatusText(); @@ -883,7 +874,7 @@ sal_uInt32 SfxObjectShell::HandleFilter( SfxMedium* pMedium, SfxObjectShell* pDo if( xServiceManager.is() ) { xFilterCFG = com::sun::star::uno::Reference< XNameAccess >( - xServiceManager->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.document.FilterFactory" ) ), + xServiceManager->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.FilterFactory")) ), UNO_QUERY ); } @@ -898,7 +889,7 @@ sal_uInt32 SfxObjectShell::HandleFilter( SfxMedium* pMedium, SfxObjectShell* pDo { sal_Int32 nPropertyCount = aProps.getLength(); for( sal_Int32 nProperty=0; nProperty < nPropertyCount; ++nProperty ) - if( aProps[nProperty].Name.equals( ::rtl::OUString::createFromAscii("UIComponent")) ) + if( aProps[nProperty].Name.equals( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UIComponent"))) ) { ::rtl::OUString aServiceName; aProps[nProperty].Value >>= aServiceName; @@ -1363,7 +1354,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl if ( !xProps.is() ) throw uno::RuntimeException(); - xProps->setPropertyValue( ::rtl::OUString::createFromAscii( "MediaType" ), + xProps->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), uno::makeAny( aDataFlavor.MimeType ) ); } catch( uno::Exception& ) @@ -2643,6 +2634,7 @@ sal_Bool SfxObjectShell::DoSave_Impl( const SfxItemSet* pArgs ) sal_Bool bOpen( sal_False ); bOpen = DoSaveCompleted( pMediumTmp ); DBG_ASSERT(bOpen,"Fehlerbehandlung fuer DoSaveCompleted nicht implementiert"); + (void)bOpen; } else { @@ -2774,7 +2766,7 @@ sal_Bool SfxObjectShell::CommonSaveAs_Impl BOOL bWasReadonly = IsReadOnly(); - if ( aURL == aActName && aURL != INetURLObject( OUString::createFromAscii( "private:stream" ) ) + if ( aURL == aActName && aURL != INetURLObject( OUString(RTL_CONSTASCII_USTRINGPARAM("private:stream")) ) && IsReadOnly() ) { SetError(ERRCODE_SFX_DOCUMENTREADONLY, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) )); @@ -2971,6 +2963,7 @@ sal_Bool SfxObjectShell::PreDoSaveAs_Impl BOOL bRet( FALSE ); bRet = DoSaveCompleted( pMedium ); DBG_ASSERT( bRet, "Error in DoSaveCompleted, can't be handled!"); + (void)bRet; } // TODO/LATER: disconnect the new file from the storage for the case when pure saving is done @@ -3013,9 +3006,9 @@ sal_Bool SfxObjectShell::IsInformationLost() ::rtl::OUString aPreusedFilterName; for ( sal_Int32 nInd = 0; nInd < aProps.getLength(); nInd++ ) { - if ( aProps[nInd].Name.equalsAscii( "FilterName" ) ) + if ( aProps[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "FilterName" ) ) ) aProps[nInd].Value >>= aFilterName; - else if ( aProps[nInd].Name.equalsAscii( "PreusedFilterName" ) ) + else if ( aProps[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PreusedFilterName" ) ) ) aProps[nInd].Value >>= aPreusedFilterName; } @@ -3615,7 +3608,7 @@ sal_Bool SfxObjectShell::CopyStoragesOfUnknownMediaType( const uno::Reference< e default: { OSL_ENSURE( - aSubElements[nInd].equalsAscii( "Configurations2" ) || !xTarget->hasByName( aSubElements[nInd] ), + aSubElements[nInd].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Configurations2" ) ) || !xTarget->hasByName( aSubElements[nInd] ), "The target storage is an output storage, the element should not exist in the target!\n" ); if ( !xTarget->hasByName( aSubElements[nInd] ) ) @@ -3648,12 +3641,12 @@ sal_Bool SfxObjectShell::GenerateAndStoreThumbnail( sal_Bool bEncrypted, try { uno::Reference< embed::XStorage > xThumbnailStor = - xStor->openStorageElement( ::rtl::OUString::createFromAscii( "Thumbnails" ), + xStor->openStorageElement( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Thumbnails")), embed::ElementModes::READWRITE ); if ( xThumbnailStor.is() ) { uno::Reference< io::XStream > xStream = xThumbnailStor->openStreamElement( - ::rtl::OUString::createFromAscii( "thumbnail.png" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("thumbnail.png")), embed::ElementModes::READWRITE ); if ( xStream.is() && WriteThumbnail( bEncrypted, bSigned, bIsTemplate, xStream ) ) @@ -3684,6 +3677,10 @@ sal_Bool SfxObjectShell::WriteThumbnail( sal_Bool bEncrypted, uno::Reference< io::XTruncate > xTruncate( xStream->getOutputStream(), uno::UNO_QUERY_THROW ); xTruncate->truncate(); + uno::Reference < beans::XPropertySet > xSet( xStream, uno::UNO_QUERY ); + if ( xSet.is() ) + xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), + uno::makeAny( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("image/png")) ) ); if ( bEncrypted ) { sal_uInt16 nResID = GraphicHelper::getThumbnailReplacementIDByFactoryName_Impl( @@ -3726,6 +3723,22 @@ void SfxObjectShell::UpdateLinks() { } +void SfxObjectShell::CheckConfigOptions() +{ + // not handled. Each app's shell needs to overwrite this method to add handler. + SetConfigOptionsChecked(true); +} + +sal_Bool SfxObjectShell::IsConfigOptionsChecked() const +{ + return pImp->m_bConfigOptionsChecked; +} + +void SfxObjectShell::SetConfigOptionsChecked( sal_Bool bChecked ) +{ + pImp->m_bConfigOptionsChecked = bChecked; +} + sal_Bool SfxObjectShell::QuerySaveSizeExceededModules_Impl( const uno::Reference< task::XInteractionHandler >& xHandler ) { if ( !HasBasic() ) @@ -3755,3 +3768,5 @@ uno::Reference< task::XInteractionHandler > SfxObjectShell::getInteractionHandle xRet = GetMedium()->GetInteractionHandler(); return xRet; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |