Lines Matching refs:hr
78 HRESULT hr = pStream->Seek( aZero, STREAM_SEEK_SET, &nNewPos ); in createTempXInStreamFromIStream() local
79 if ( FAILED( hr ) ) return xResult; in createTempXInStreamFromIStream()
82 hr = pStream->Stat( &aStat, STATFLAG_NONAME ); in createTempXInStreamFromIStream()
83 if ( FAILED( hr ) ) return xResult; in createTempXInStreamFromIStream()
138 HRESULT hr = pStream->Seek( aZero, STREAM_SEEK_SET, &nNewPos ); in copyXTempOutToIStream() local
139 if ( FAILED( hr ) ) return E_FAIL; in copyXTempOutToIStream()
141 hr = pStream->SetSize( aUZero ); in copyXTempOutToIStream()
142 if ( FAILED( hr ) ) return E_FAIL; in copyXTempOutToIStream()
158 HRESULT hr = pStream->Write( (void*)aBuffer.getArray(), nReadBytes, &nWritten ); in copyXTempOutToIStream() local
159 if ( !SUCCEEDED( hr ) || nWritten != nReadBytes ) in copyXTempOutToIStream()
276 HRESULT hr = Save( pStg, sal_False ); in SaveTo_Impl() local
281 return hr; in SaveTo_Impl()
398 HRESULT hr = CO_E_ALREADYINITIALIZED; in InitNew() local
404 hr = pStg->Stat( &aStat, STATFLAG_NONAME ); in InitNew()
405 if ( FAILED( hr ) ) return E_FAIL; in InitNew()
409 hr = E_FAIL; in InitNew()
426 hr = S_OK; in InitNew()
433 if ( hr == S_OK ) in InitNew()
437 hr = WriteFmtUserTypeStg( pStg, in InitNew()
441 if ( hr == S_OK ) in InitNew()
443 hr = pStg->CreateStream( reinterpret_cast<LPCWSTR>(aOfficeEmbedStreamName.getStr()), in InitNew()
449 if ( hr == S_OK && m_pOwnStream ) in InitNew()
451 hr = pStg->CreateStream( reinterpret_cast<LPCWSTR>(aExtentStreamName.getStr()), in InitNew()
457 if ( hr == S_OK && m_pExtStream ) in InitNew()
464 hr = E_FAIL; in InitNew()
467 hr = E_FAIL; in InitNew()
470 hr = E_FAIL; in InitNew()
473 if ( hr != S_OK ) in InitNew()
479 return hr; in InitNew()
490 HRESULT hr = E_FAIL; in Load() local
493 hr = pStg->Stat( &aStat, STATFLAG_NONAME ); in Load()
494 if ( FAILED( hr ) ) return E_FAIL; in Load()
497 hr = pStg->OpenStream( reinterpret_cast<LPCWSTR>(aOfficeEmbedStreamName.getStr()), in Load()
502 if ( !m_pOwnStream ) hr = E_FAIL; in Load()
504 if ( SUCCEEDED( hr ) ) in Load()
506 hr = pStg->OpenStream( reinterpret_cast<LPCWSTR>(aExtentStreamName.getStr()), in Load()
511 if ( !m_pExtStream ) hr = E_FAIL; in Load()
516 if ( SUCCEEDED( hr ) ) in Load()
520 hr = m_pExtStream->Seek( aZero, STREAM_SEEK_SET, &nNewPos ); in Load()
521 if ( SUCCEEDED( hr ) ) in Load()
525 hr = m_pExtStream->Read( (void*)aInf, EXT_STREAM_LENGTH, &nRead ); in Load()
526 if ( nRead != EXT_STREAM_LENGTH ) hr = E_FAIL; in Load()
528 if ( SUCCEEDED( hr ) ) in Load()
540 if ( SUCCEEDED( hr ) ) in Load()
542 hr = E_FAIL; in Load()
561 hr = m_pDocHolder->SetExtent( &aSizeToSet ); in Load()
569 if ( FAILED( hr ) ) in Load()
575 if ( FAILED( hr ) ) in Load()
579 hr = pStg->DestroyElement( reinterpret_cast<LPCWSTR>(aOfficeEmbedStreamName.getStr()) ); in Load()
580 hr = pStg->DestroyElement( reinterpret_cast<LPCWSTR>(aExtentStreamName.getStr()) ); in Load()
582 OSL_ENSURE( SUCCEEDED( hr ), "Can not destroy created stream!\n" ); in Load()
583 if ( FAILED( hr ) ) in Load()
584 hr = E_FAIL; in Load()
587 return hr; in Load()
601 HRESULT hr = m_pMasterStorage->CopyTo( NULL, NULL, NULL, pStgSave ); in Save() local
602 if ( FAILED( hr ) ) return E_FAIL; in Save()
605 hr = pStgSave->Stat( &aStat, STATFLAG_NONAME ); in Save()
606 if ( FAILED( hr ) ) return E_FAIL; in Save()
609 hr = pStgSave->CreateStream( reinterpret_cast<LPCWSTR>(aOfficeEmbedStreamName.getStr()), in Save()
614 if ( FAILED( hr ) || !pTargetStream ) return E_FAIL; in Save()
616 hr = pStgSave->CreateStream( reinterpret_cast<LPCWSTR>(aExtentStreamName.getStr()), in Save()
621 if ( FAILED( hr ) || !pNewExtStream ) return E_FAIL; in Save()
629 HRESULT hr = E_FAIL; in Save() local
645 hr = copyXTempOutToIStream( xTempOut, pTargetStream ); in Save()
646 if ( SUCCEEDED( hr ) ) in Save()
651 hr = pNewExtStream->Seek( aZero, STREAM_SEEK_SET, &nNewPos ); in Save()
652 if ( SUCCEEDED( hr ) ) in Save()
655 hr = m_pDocHolder->GetExtent( &aSize ); in Save()
657 if ( SUCCEEDED( hr ) ) in Save()
666 hr = pNewExtStream->Write( (void*)aInf, EXT_STREAM_LENGTH, &nWritten ); in Save()
667 if ( nWritten != EXT_STREAM_LENGTH ) hr = E_FAIL; in Save()
669 if ( SUCCEEDED( hr ) ) in Save()
691 return hr; in Save()
709 HRESULT hr = m_pMasterStorage->Stat( &aStat, STATFLAG_NONAME ); in SaveCompleted() local
710 if ( FAILED( hr ) ) return E_OUTOFMEMORY; in SaveCompleted()
713 hr = m_pMasterStorage->OpenStream( reinterpret_cast<LPCWSTR>(aOfficeEmbedStreamName.getStr()), in SaveCompleted()
718 if ( FAILED( hr ) || !m_pOwnStream ) return E_OUTOFMEMORY; in SaveCompleted()
720 hr = m_pMasterStorage->OpenStream( reinterpret_cast<LPCWSTR>(aExtentStreamName.getStr()), in SaveCompleted()
725 if ( FAILED( hr ) || !m_pExtStream ) return E_OUTOFMEMORY; in SaveCompleted()
765 HRESULT hr = StgCreateDocfile( NULL, in Load() local
770 if ( FAILED( hr ) || !m_pMasterStorage ) return E_FAIL; in Load()
774 hr = WriteFmtUserTypeStg( m_pMasterStorage, in Load()
777 if ( FAILED( hr ) ) return E_FAIL; in Load()
779 hr = m_pMasterStorage->SetClass( m_guid ); in Load()
780 if ( FAILED( hr ) ) return E_FAIL; in Load()
782 hr = m_pMasterStorage->CreateStream( reinterpret_cast<LPCWSTR>(aOfficeEmbedStreamName.getStr()), in Load()
787 if ( FAILED( hr ) || !m_pOwnStream ) return E_FAIL; in Load()
789 hr = m_pMasterStorage->CreateStream( reinterpret_cast<LPCWSTR>(aExtentStreamName.getStr()), in Load()
794 if ( FAILED( hr ) || !m_pExtStream ) return E_FAIL; in Load()
812 hr = S_OK; in Load()
821 if ( hr == S_OK ) in Load()
825 hr = WriteFmtUserTypeStg( m_pMasterStorage, in Load()
829 if ( SUCCEEDED( hr ) ) in Load()
834 hr = m_pExtStream->Seek( aZero, STREAM_SEEK_SET, &nNewPos ); in Load()
835 if ( SUCCEEDED( hr ) ) in Load()
838 hr = m_pDocHolder->GetExtent( &aSize ); in Load()
840 if ( SUCCEEDED( hr ) ) in Load()
849 hr = m_pExtStream->Write( (void*)aInf, EXT_STREAM_LENGTH, &nWritten ); in Load()
850 if ( nWritten != EXT_STREAM_LENGTH ) hr = E_FAIL; in Load()
855 if ( SUCCEEDED( hr ) ) in Load()
858 hr = E_FAIL; in Load()
861 if ( FAILED( hr ) ) in Load()
870 return hr; in Load()
878 HRESULT hr = E_FAIL; in Save() local
908 hr = S_OK; in Save()
914 return hr; in Save()
928 HRESULT hr = CoGetMalloc( 1, &pMalloc ); in GetCurFile() local
929 if ( FAILED( hr ) || !pMalloc ) return E_FAIL; in GetCurFile()