No, you can't copy the document content that way.
If loadFromStorage() doesn't work you have to update and use the SubFilter.

Perhaps you tell us what loadFromStorage() does. Or you can debug the
code to see what goes on there. Maybe it's a bug in the code. But even
then you had to update as nobody will fix bugs on this ancient code line.

The source code of loadFromStorage in OOB680 :

void SAL_CALL SfxBaseModel::loadFromStorage( const REFERENCE< XSTORAGE>& xStorage,
        const SEQUENCE< PROPERTYVALUE >& aMediaDescriptor )
        throw ( ILLEGALARGUMENTEXCEPTION,
                        DOUBLEINITIALIZATIONEXCEPTION,
                        IOEXCEPTION,
                        EXCEPTION,
                        RUNTIMEEXCEPTION )
{
    ::vos::OGuard aGuard( Application::GetSolarMutex() );
        if ( impl_isDisposed() )
                throw DISPOSEDEXCEPTION();

    if ( !m_pData->m_pObjectShell.Is() )
                throw IOEXCEPTION(); // TODO:

        if ( m_pData->m_pObjectShell.Is() )
        {
                if( m_pData->m_pObjectShell->GetMedium() )
// if a Medium is present, the document is already initialized
                        throw DOUBLEINITIALIZATIONEXCEPTION();

// after i36090 is fixed the pool from object shell can be used
// SfxAllItemSet aSet( m_pData->m_pObjectShell->GetPool() );
        SfxAllItemSet aSet( SFX_APP()->GetPool() );

        // the BaseURL is part of the ItemSet
        SfxMedium* pMedium = new SfxMedium( xStorage, String() );
        TransformParameters( SID_OPENDOC, aMediaDescriptor, aSet );
        pMedium->GetItemSet()->Put( aSet );

        // allow to use an interactionhandler (if there is one)
        pMedium->UseInteractionHandler( TRUE );

// TODO/LATER: in case of template storage, the temporary copy must be created SFX_ITEMSET_ARG( &aSet, pTemplateItem, SfxBoolItem, SID_TEMPLATE, sal_False);
        BOOL bTemplate = pTemplateItem && pTemplateItem->GetValue();
m_pData->m_pObjectShell->SetActivateEvent_Impl( bTemplate ? SFX_EVENT_CREATEDOC : SFX_EVENT_OPENDOC );
        m_pData->m_pObjectShell->Get_Impl()->bOwnsStorage = FALSE;

        // load document
        if ( !m_pData->m_pObjectShell->DoLoad(pMedium) )
        {
        sal_uInt32 nError = m_pData->m_pObjectShell->GetErrorCode();
        throw task::ErrorCodeIOException( ::rtl::OUString(),
                                                                                      
          uno::Reference< uno::XInterface >(),
                                                                                
                nError ? nError : ERRCODE_IO_CANTREAD );
                }
        }
}

When I call it in the filter,
it goes into "if( m_pData->m_pObjectShell->GetMedium() )" statment and "throw DOUBLEINITIALIZATIONEXCEPTION()".

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to