Kaydet (Commit) e179ae41 authored tarafından Joachim Lingner's avatar Joachim Lingner

jl154 merging with OOO330m2

...@@ -1989,10 +1989,14 @@ void Document::handleParagraphNotifications() ...@@ -1989,10 +1989,14 @@ void Document::handleParagraphNotifications()
determineVisibleRange(); determineVisibleRange();
notifyVisibleRangeChanges(aOldVisibleBegin, aOldVisibleEnd, notifyVisibleRangeChanges(aOldVisibleBegin, aOldVisibleEnd,
m_xParagraphs->end()); m_xParagraphs->end());
Paragraphs::iterator aIt(m_xParagraphs->begin() + n);
::rtl::Reference< ParagraphImpl > xParagraph(getParagraph(aIt)); if (n < m_xParagraphs->size())
if (xParagraph.is()) {
xParagraph->textChanged(); Paragraphs::iterator aIt(m_xParagraphs->begin() + n);
::rtl::Reference< ParagraphImpl > xParagraph(getParagraph(aIt));
if (xParagraph.is())
xParagraph->textChanged();
}
break; break;
} }
default: default:
......
...@@ -172,12 +172,21 @@ void ReplaceEdit_Impl::SetText( const XubString& rStr, const Selection& rNewSele ...@@ -172,12 +172,21 @@ void ReplaceEdit_Impl::SetText( const XubString& rStr, const Selection& rNewSele
// class ThesaurusAlternativesCtrl_Impl ---------------------------------- // class ThesaurusAlternativesCtrl_Impl ----------------------------------
AlternativesString_Impl::AlternativesString_Impl(
ThesaurusAlternativesCtrl_Impl &rControl,
SvLBoxEntry* pEntry, USHORT nFlags, const String& rStr ) :
//
SvLBoxString( pEntry, nFlags, rStr ),
m_rControlImpl( rControl )
{
}
void AlternativesString_Impl::Paint( void AlternativesString_Impl::Paint(
const Point& rPos, const Point& rPos,
SvLBox& rDev, USHORT, SvLBox& rDev, USHORT,
SvLBoxEntry* pEntry ) SvLBoxEntry* pEntry )
{ {
AlternativesUserData_Impl* pData = (AlternativesUserData_Impl*)pEntry->GetUserData(); AlternativesExtraData* pData = m_rControlImpl.GetExtraData( pEntry );
Point aPos( rPos ); Point aPos( rPos );
Font aOldFont( rDev.GetFont()); Font aOldFont( rDev.GetFont());
if (pData && pData->IsHeader()) if (pData && pData->IsHeader())
...@@ -207,14 +216,40 @@ ThesaurusAlternativesCtrl_Impl::ThesaurusAlternativesCtrl_Impl( ...@@ -207,14 +216,40 @@ ThesaurusAlternativesCtrl_Impl::ThesaurusAlternativesCtrl_Impl(
ThesaurusAlternativesCtrl_Impl::~ThesaurusAlternativesCtrl_Impl() ThesaurusAlternativesCtrl_Impl::~ThesaurusAlternativesCtrl_Impl()
{ {
ClearUserData(); ClearExtraData();
}
void ThesaurusAlternativesCtrl_Impl::ClearExtraData()
{
UserDataMap_t aEmpty;
m_aUserData.swap( aEmpty );
}
void ThesaurusAlternativesCtrl_Impl::SetExtraData(
const SvLBoxEntry *pEntry,
const AlternativesExtraData &rData )
{
if (!pEntry)
return;
UserDataMap_t::iterator aIt( m_aUserData.find( pEntry ) );
if (aIt != m_aUserData.end())
aIt->second = rData;
else
m_aUserData[ pEntry ] = rData;
} }
void ThesaurusAlternativesCtrl_Impl::ClearUserData() AlternativesExtraData * ThesaurusAlternativesCtrl_Impl::GetExtraData(
const SvLBoxEntry *pEntry )
{ {
for (USHORT i = 0; i < GetEntryCount(); ++i) AlternativesExtraData *pRes = NULL;
delete (AlternativesUserData_Impl*)GetEntry(i)->GetUserData(); UserDataMap_t::iterator aIt( m_aUserData.find( pEntry ) );
if (aIt != m_aUserData.end())
pRes = &aIt->second;
return pRes;
} }
...@@ -230,10 +265,9 @@ SvLBoxEntry * ThesaurusAlternativesCtrl_Impl::AddEntry( sal_Int32 nVal, const St ...@@ -230,10 +265,9 @@ SvLBoxEntry * ThesaurusAlternativesCtrl_Impl::AddEntry( sal_Int32 nVal, const St
pEntry->AddItem( new SvLBoxString( pEntry, 0, String() ) ); // add empty column pEntry->AddItem( new SvLBoxString( pEntry, 0, String() ) ); // add empty column
aText += rText; aText += rText;
pEntry->AddItem( new SvLBoxContextBmp( pEntry, 0, Image(), Image(), 0 ) ); // otherwise crash pEntry->AddItem( new SvLBoxContextBmp( pEntry, 0, Image(), Image(), 0 ) ); // otherwise crash
pEntry->AddItem( new AlternativesString_Impl( pEntry, 0, aText ) ); pEntry->AddItem( new AlternativesString_Impl( *this, pEntry, 0, aText ) );
AlternativesUserData_Impl* pUserData = new AlternativesUserData_Impl( rText, bIsHeader ); SetExtraData( pEntry, AlternativesExtraData( rText, bIsHeader ) );
pEntry->SetUserData( pUserData );
GetModel()->Insert( pEntry ); GetModel()->Insert( pEntry );
if (bIsHeader) if (bIsHeader)
...@@ -365,7 +399,7 @@ bool SvxThesaurusDialog_Impl::UpdateAlternativesBox_Impl() ...@@ -365,7 +399,7 @@ bool SvxThesaurusDialog_Impl::UpdateAlternativesBox_Impl()
m_pAlternativesCT->SetUpdateMode( FALSE ); m_pAlternativesCT->SetUpdateMode( FALSE );
// clear old user data of control before creating new ones via AddEntry below // clear old user data of control before creating new ones via AddEntry below
m_pAlternativesCT->ClearUserData(); m_pAlternativesCT->ClearExtraData();
m_pAlternativesCT->Clear(); m_pAlternativesCT->Clear();
for (sal_Int32 i = 0; i < nMeanings; ++i) for (sal_Int32 i = 0; i < nMeanings; ++i)
...@@ -468,9 +502,9 @@ IMPL_LINK( SvxThesaurusDialog_Impl, AlternativesSelectHdl_Impl, SvxCheckListBox ...@@ -468,9 +502,9 @@ IMPL_LINK( SvxThesaurusDialog_Impl, AlternativesSelectHdl_Impl, SvxCheckListBox
SvLBoxEntry *pEntry = pBox ? pBox->GetCurEntry() : NULL; SvLBoxEntry *pEntry = pBox ? pBox->GetCurEntry() : NULL;
if (pEntry) if (pEntry)
{ {
AlternativesUserData_Impl * pData = (AlternativesUserData_Impl *) pEntry->GetUserData(); AlternativesExtraData * pData = m_pAlternativesCT->GetExtraData( pEntry );
String aStr; String aStr;
if (!pData->IsHeader()) if (pData && !pData->IsHeader())
{ {
aStr = pData->GetText(); aStr = pData->GetText();
GetReplaceEditString( aStr ); GetReplaceEditString( aStr );
...@@ -486,9 +520,9 @@ IMPL_LINK( SvxThesaurusDialog_Impl, AlternativesDoubleClickHdl_Impl, SvxCheckLis ...@@ -486,9 +520,9 @@ IMPL_LINK( SvxThesaurusDialog_Impl, AlternativesDoubleClickHdl_Impl, SvxCheckLis
SvLBoxEntry *pEntry = pBox ? pBox->GetCurEntry() : NULL; SvLBoxEntry *pEntry = pBox ? pBox->GetCurEntry() : NULL;
if (pEntry) if (pEntry)
{ {
AlternativesUserData_Impl * pData = (AlternativesUserData_Impl *) pEntry->GetUserData(); AlternativesExtraData * pData = m_pAlternativesCT->GetExtraData( pEntry );
String aStr; String aStr;
if (!pData->IsHeader()) if (pData && !pData->IsHeader())
{ {
aStr = pData->GetText(); aStr = pData->GetText();
GetReplaceEditString( aStr ); GetReplaceEditString( aStr );
...@@ -509,8 +543,8 @@ IMPL_LINK( SvxThesaurusDialog_Impl, AlternativesDoubleClickHdl_Impl, SvxCheckLis ...@@ -509,8 +543,8 @@ IMPL_LINK( SvxThesaurusDialog_Impl, AlternativesDoubleClickHdl_Impl, SvxCheckLis
IMPL_STATIC_LINK( SvxThesaurusDialog_Impl, SelectFirstHdl_Impl, SvxCheckListBox *, pBox ) IMPL_STATIC_LINK( SvxThesaurusDialog_Impl, SelectFirstHdl_Impl, SvxCheckListBox *, pBox )
{ {
(void) pThis; (void) pThis;
if (pBox && pBox->GetEntryCount() > 0) if (pBox && pBox->GetEntryCount() >= 2)
pBox->SelectEntryPos( 0 ); pBox->SelectEntryPos( 1 ); // pos 0 is a 'header' that is not selectable
return 0; return 0;
} }
......
...@@ -59,7 +59,7 @@ ModalDialog RID_SVXDLG_THESAURUS ...@@ -59,7 +59,7 @@ ModalDialog RID_SVXDLG_THESAURUS
{ {
Pos = MAP_APPFONT ( 24 , 5 ) ; Pos = MAP_APPFONT ( 24 , 5 ) ;
Size = MAP_APPFONT ( 143 , 8 ) ; Size = MAP_APPFONT ( 143 , 8 ) ;
Text [ en-US ] = "Current ~word" ; Text [ en-US ] = "~Current word" ;
LEFT = TRUE ; LEFT = TRUE ;
}; };
ComboBox CB_WORD ComboBox CB_WORD
...@@ -95,7 +95,7 @@ ModalDialog RID_SVXDLG_THESAURUS ...@@ -95,7 +95,7 @@ ModalDialog RID_SVXDLG_THESAURUS
{ {
Pos = MAP_APPFONT ( 5 , 173 ) ; Pos = MAP_APPFONT ( 5 , 173 ) ;
Size = MAP_APPFONT ( 255 , 8 ) ; Size = MAP_APPFONT ( 255 , 8 ) ;
Text [ en-US ] = "Replace ~with" ; Text [ en-US ] = "~Replace with" ;
LEFT = TRUE ; LEFT = TRUE ;
}; };
Edit ED_REPL Edit ED_REPL
...@@ -120,7 +120,7 @@ ModalDialog RID_SVXDLG_THESAURUS ...@@ -120,7 +120,7 @@ ModalDialog RID_SVXDLG_THESAURUS
{ {
Pos = MAP_APPFONT ( 105 , 210 ) ; Pos = MAP_APPFONT ( 105 , 210 ) ;
Size = MAP_APPFONT ( 60 , 14 ) ; Size = MAP_APPFONT ( 60 , 14 ) ;
Text [ en-US ] = "~Replace" ; Text [ en-US ] = "Replace" ;
DefButton = TRUE ; DefButton = TRUE ;
}; };
CancelButton BTN_THES_CANCEL CancelButton BTN_THES_CANCEL
......
...@@ -51,11 +51,16 @@ ...@@ -51,11 +51,16 @@
#include <com/sun/star/linguistic2/XMeaning.hpp> #include <com/sun/star/linguistic2/XMeaning.hpp>
#include <stack> #include <stack>
#include <map>
#include <algorithm> #include <algorithm>
using namespace ::com::sun::star; using namespace ::com::sun::star;
using ::rtl::OUString; using ::rtl::OUString;
class SvLBoxEntry;
class ThesaurusAlternativesCtrl_Impl;
// class LookUpComboBox_Impl -------------------------------------------------- // class LookUpComboBox_Impl --------------------------------------------------
class LookUpComboBox_Impl : public ComboBox class LookUpComboBox_Impl : public ComboBox
...@@ -105,17 +110,14 @@ public: ...@@ -105,17 +110,14 @@ public:
// class ThesaurusAlternativesCtrl_Impl ---------------------------------- // class ThesaurusAlternativesCtrl_Impl ----------------------------------
class AlternativesUserData_Impl class AlternativesExtraData
{ {
String sText; String sText;
bool bHeader; bool bHeader;
// disable copy c-tor and assignment operator
AlternativesUserData_Impl( const AlternativesUserData_Impl & );
AlternativesUserData_Impl & operator = ( const AlternativesUserData_Impl & );
public: public:
AlternativesUserData_Impl( const String &rText, bool bIsHeader ) : AlternativesExtraData() : bHeader( false ) {}
AlternativesExtraData( const String &rText, bool bIsHeader ) :
sText(rText), sText(rText),
bHeader(bIsHeader) bHeader(bIsHeader)
{ {
...@@ -128,10 +130,11 @@ public: ...@@ -128,10 +130,11 @@ public:
class AlternativesString_Impl : public SvLBoxString class AlternativesString_Impl : public SvLBoxString
{ {
ThesaurusAlternativesCtrl_Impl & m_rControlImpl;
public: public:
AlternativesString_Impl( SvLBoxEntry* pEntry, USHORT nFlags, const String& rStr ) AlternativesString_Impl( ThesaurusAlternativesCtrl_Impl &rControl,
: SvLBoxString( pEntry, nFlags, rStr ) {} SvLBoxEntry* pEntry, USHORT nFlags, const String& rStr );
virtual void Paint( const Point& rPos, SvLBox& rDev, USHORT nFlags, SvLBoxEntry* pEntry); virtual void Paint( const Point& rPos, SvLBox& rDev, USHORT nFlags, SvLBoxEntry* pEntry);
}; };
...@@ -142,6 +145,9 @@ class ThesaurusAlternativesCtrl_Impl : ...@@ -142,6 +145,9 @@ class ThesaurusAlternativesCtrl_Impl :
{ {
SvxThesaurusDialog_Impl & m_rDialogImpl; SvxThesaurusDialog_Impl & m_rDialogImpl;
typedef std::map< const SvLBoxEntry *, AlternativesExtraData > UserDataMap_t;
UserDataMap_t m_aUserData;
// disable copy c-tor and assignment operator // disable copy c-tor and assignment operator
ThesaurusAlternativesCtrl_Impl( const ThesaurusAlternativesCtrl_Impl & ); ThesaurusAlternativesCtrl_Impl( const ThesaurusAlternativesCtrl_Impl & );
ThesaurusAlternativesCtrl_Impl & operator = ( const ThesaurusAlternativesCtrl_Impl & ); ThesaurusAlternativesCtrl_Impl & operator = ( const ThesaurusAlternativesCtrl_Impl & );
...@@ -152,7 +158,10 @@ public: ...@@ -152,7 +158,10 @@ public:
SvLBoxEntry * AddEntry( sal_Int32 nVal, const String &rText, bool bIsHeader ); SvLBoxEntry * AddEntry( sal_Int32 nVal, const String &rText, bool bIsHeader );
void ClearUserData();
void ClearExtraData();
void SetExtraData( const SvLBoxEntry *pEntry, const AlternativesExtraData &rData );
AlternativesExtraData * GetExtraData( const SvLBoxEntry *pEntry );
virtual void KeyInput( const KeyEvent& rKEvt ); virtual void KeyInput( const KeyEvent& rKEvt );
virtual void Paint( const Rectangle& rRect ); virtual void Paint( const Rectangle& rRect );
......
...@@ -168,6 +168,7 @@ IMPL_LINK( SvxNewDictionaryDialog, OKHdl_Impl, Button *, EMPTYARG ) ...@@ -168,6 +168,7 @@ IMPL_LINK( SvxNewDictionaryDialog, OKHdl_Impl, Button *, EMPTYARG )
String aURL( linguistic::GetWritableDictionaryURL( sDict ) ); String aURL( linguistic::GetWritableDictionaryURL( sDict ) );
xNewDic = Reference< XDictionary > ( xNewDic = Reference< XDictionary > (
xDicList->createDictionary( sDict, aLocale, eType, aURL ) , UNO_QUERY ); xDicList->createDictionary( sDict, aLocale, eType, aURL ) , UNO_QUERY );
xNewDic->setActive( sal_True );
} }
DBG_ASSERT(xNewDic.is(), "NULL pointer"); DBG_ASSERT(xNewDic.is(), "NULL pointer");
} }
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include <com/sun/star/frame/XLoadable.hpp> #include <com/sun/star/frame/XLoadable.hpp>
#include <tools/rcid.h> #include <tools/rcid.h>
#include <tools/shl.hxx> #include <tools/shl.hxx>
#include <tools/urlobj.hxx>
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
#include <toolkit/helper/vclunohelper.hxx> #include <toolkit/helper/vclunohelper.hxx>
#include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/beans/PropertyValue.hpp>
......
...@@ -190,6 +190,7 @@ void OImageControlModel::implConstruct() ...@@ -190,6 +190,7 @@ void OImageControlModel::implConstruct()
{ {
m_pImageProducer = new ImageProducer; m_pImageProducer = new ImageProducer;
m_xImageProducer = m_pImageProducer; m_xImageProducer = m_pImageProducer;
m_pImageProducer->SetDoneHdl( LINK( this, OImageControlModel, OnImageImportDone ) );
} }
//------------------------------------------------------------------ //------------------------------------------------------------------
...@@ -630,6 +631,16 @@ void SAL_CALL OImageControlModel::startProduction( ) throw (RuntimeException) ...@@ -630,6 +631,16 @@ void SAL_CALL OImageControlModel::startProduction( ) throw (RuntimeException)
GetImageProducer()->startProduction(); GetImageProducer()->startProduction();
} }
//------------------------------------------------------------------------------
IMPL_LINK( OImageControlModel, OnImageImportDone, ::Graphic*, i_pGraphic )
{
ENSURE_OR_RETURN( i_pGraphic, "OImageControlModel::OnImageImportDone: illegal graphic!", 0L );
setPropertyValue(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Graphic" ) ),
makeAny( Image( i_pGraphic->GetBitmapEx() ).GetXGraphic() )
);
return 1L;
}
//================================================================== //==================================================================
// OImageControlControl // OImageControlControl
......
...@@ -140,6 +140,8 @@ protected: ...@@ -140,6 +140,8 @@ protected:
bound field, or the control itself if there is no bound field bound field, or the control itself if there is no bound field
*/ */
sal_Bool impl_updateStreamForURL_lck( const ::rtl::OUString& _rURL, ValueChangeInstigator _eInstigator ); sal_Bool impl_updateStreamForURL_lck( const ::rtl::OUString& _rURL, ValueChangeInstigator _eInstigator );
DECL_LINK( OnImageImportDone, ::Graphic* );
}; };
//================================================================== //==================================================================
......
...@@ -190,11 +190,7 @@ ErrCode ImgProdLockBytes::Stat( SvLockBytesStat* pStat, SvLockBytesStatFlag eFla ...@@ -190,11 +190,7 @@ ErrCode ImgProdLockBytes::Stat( SvLockBytesStat* pStat, SvLockBytesStatFlag eFla
ImageProducer::ImageProducer() : ImageProducer::ImageProducer() :
mpStm ( NULL ), mpStm ( NULL ),
mpFilter ( NULL ), mbConsInit ( sal_False )
mnStatus ( 0UL ),
mbConsInit ( sal_False ),
mnLastError ( 0UL ),
mbAsync ( sal_False )
{ {
mpGraphic = new Graphic; mpGraphic = new Graphic;
DBG_ASSERT( Application::GetFilterHdl().IsSet(), "ImageProducer::ImageProducer(): No filter handler set" ); DBG_ASSERT( Application::GetFilterHdl().IsSet(), "ImageProducer::ImageProducer(): No filter handler set" );
...@@ -207,9 +203,6 @@ ImageProducer::~ImageProducer() ...@@ -207,9 +203,6 @@ ImageProducer::~ImageProducer()
delete mpGraphic; delete mpGraphic;
mpGraphic = NULL; mpGraphic = NULL;
delete mpFilter;
mpFilter = NULL;
delete mpStm; delete mpStm;
mpStm = NULL; mpStm = NULL;
...@@ -261,7 +254,6 @@ void ImageProducer::SetImage( const ::rtl::OUString& rPath ) ...@@ -261,7 +254,6 @@ void ImageProducer::SetImage( const ::rtl::OUString& rPath )
maURL = rPath; maURL = rPath;
mpGraphic->Clear(); mpGraphic->Clear();
mbConsInit = sal_False; mbConsInit = sal_False;
mbAsync = sal_False;
delete mpStm; delete mpStm;
if ( ::svt::GraphicAccess::isSupportedURL( maURL ) ) if ( ::svt::GraphicAccess::isSupportedURL( maURL ) )
...@@ -284,7 +276,6 @@ void ImageProducer::SetImage( SvStream& rStm ) ...@@ -284,7 +276,6 @@ void ImageProducer::SetImage( SvStream& rStm )
maURL = ::rtl::OUString(); maURL = ::rtl::OUString();
mpGraphic->Clear(); mpGraphic->Clear();
mbConsInit = sal_False; mbConsInit = sal_False;
mbAsync = sal_False;
delete mpStm; delete mpStm;
mpStm = new SvStream( new ImgProdLockBytes( &rStm, sal_False ) ); mpStm = new SvStream( new ImgProdLockBytes( &rStm, sal_False ) );
...@@ -297,7 +288,6 @@ void ImageProducer::setImage( ::com::sun::star::uno::Reference< ::com::sun::star ...@@ -297,7 +288,6 @@ void ImageProducer::setImage( ::com::sun::star::uno::Reference< ::com::sun::star
maURL = ::rtl::OUString(); maURL = ::rtl::OUString();
mpGraphic->Clear(); mpGraphic->Clear();
mbConsInit = sal_False; mbConsInit = sal_False;
mbAsync = sal_False;
delete mpStm; delete mpStm;
if( rInputStmRef.is() ) if( rInputStmRef.is() )
...@@ -318,9 +308,7 @@ void ImageProducer::NewDataAvailable() ...@@ -318,9 +308,7 @@ void ImageProducer::NewDataAvailable()
void ImageProducer::startProduction() throw(::com::sun::star::uno::RuntimeException) void ImageProducer::startProduction() throw(::com::sun::star::uno::RuntimeException)
{ {
ResetLastError(); if( maConsList.Count() || maDoneHdl.IsSet() )
if( maConsList.Count() )
{ {
bool bNotifyEmptyGraphics = false; bool bNotifyEmptyGraphics = false;
...@@ -331,8 +319,8 @@ void ImageProducer::startProduction() throw(::com::sun::star::uno::RuntimeExcept ...@@ -331,8 +319,8 @@ void ImageProducer::startProduction() throw(::com::sun::star::uno::RuntimeExcept
// graphic is cleared if a new Stream is set // graphic is cleared if a new Stream is set
if( ( mpGraphic->GetType() == GRAPHIC_NONE ) || mpGraphic->GetContext() ) if( ( mpGraphic->GetType() == GRAPHIC_NONE ) || mpGraphic->GetContext() )
{ {
if( !ImplImportGraphic( *mpGraphic ) && maErrorHdl.IsSet() ) if ( ImplImportGraphic( *mpGraphic ) && maDoneHdl.IsSet() )
maErrorHdl.Call( this ); maDoneHdl.Call( mpGraphic );
} }
if( mpGraphic->GetType() != GRAPHIC_NONE ) if( mpGraphic->GetType() != GRAPHIC_NONE )
...@@ -371,33 +359,16 @@ void ImageProducer::startProduction() throw(::com::sun::star::uno::RuntimeExcept ...@@ -371,33 +359,16 @@ void ImageProducer::startProduction() throw(::com::sun::star::uno::RuntimeExcept
sal_Bool ImageProducer::ImplImportGraphic( Graphic& rGraphic ) sal_Bool ImageProducer::ImplImportGraphic( Graphic& rGraphic )
{ {
USHORT nFilter = GRFILTER_FORMAT_DONTKNOW;
short nRet;
sal_Bool bRet = sal_False;
if( ERRCODE_IO_PENDING == mpStm->GetError() ) if( ERRCODE_IO_PENDING == mpStm->GetError() )
mpStm->ResetError(); mpStm->ResetError();
mpStm->Seek( 0UL ); mpStm->Seek( 0UL );
if( mpFilter ) sal_Bool bRet = GraphicConverter::Import( *mpStm, rGraphic ) == ERRCODE_NONE;
nRet = mpFilter->ImportGraphic( rGraphic, String(), *mpStm, nFilter );
else
{
if( GraphicConverter::Import( *mpStm, rGraphic ) == ERRCODE_NONE )
nRet = GRFILTER_OK;
else
nRet = GRFILTER_FILTERERROR;
}
if( ERRCODE_IO_PENDING == mpStm->GetError() ) if( ERRCODE_IO_PENDING == mpStm->GetError() )
mpStm->ResetError(); mpStm->ResetError();
if( nRet == GRFILTER_OK )
bRet = sal_True;
else
mnLastError = nRet;
return bRet; return bRet;
} }
...@@ -405,10 +376,6 @@ sal_Bool ImageProducer::ImplImportGraphic( Graphic& rGraphic ) ...@@ -405,10 +376,6 @@ sal_Bool ImageProducer::ImplImportGraphic( Graphic& rGraphic )
void ImageProducer::ImplUpdateData( const Graphic& rGraphic ) void ImageProducer::ImplUpdateData( const Graphic& rGraphic )
{ {
// asynchronous?
if( mpGraphic->GetContext() )
mbAsync = sal_True;
ImplInitConsumer( rGraphic ); ImplInitConsumer( rGraphic );
if( mbConsInit && maConsList.Count() ) if( mbConsInit && maConsList.Count() )
...@@ -425,7 +392,7 @@ void ImageProducer::ImplUpdateData( const Graphic& rGraphic ) ...@@ -425,7 +392,7 @@ void ImageProducer::ImplUpdateData( const Graphic& rGraphic )
// iterate through interfaces // iterate through interfaces
for( pCons = aTmp.First(); pCons; pCons = aTmp.Next() ) for( pCons = aTmp.First(); pCons; pCons = aTmp.Next() )
( *(::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageConsumer > *) pCons )->complete( mnStatus = ::com::sun::star::awt::ImageStatus::IMAGESTATUS_STATICIMAGEDONE, this ); ( *(::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageConsumer > *) pCons )->complete( ::com::sun::star::awt::ImageStatus::IMAGESTATUS_STATICIMAGEDONE, this );
// delete interfaces in temporary list // delete interfaces in temporary list
for( pCons = aTmp.First(); pCons; pCons = aTmp.Next() ) for( pCons = aTmp.First(); pCons; pCons = aTmp.Next() )
......
...@@ -64,20 +64,9 @@ private: ...@@ -64,20 +64,9 @@ private:
List maConsList; List maConsList;
Graphic* mpGraphic; Graphic* mpGraphic;
SvStream* mpStm; SvStream* mpStm;
GraphicFilter* mpFilter;
sal_uInt32 mnTransIndex; sal_uInt32 mnTransIndex;
sal_uInt32 mnStatus;
sal_Bool mbConsInit; sal_Bool mbConsInit;
sal_Bool mbStmDel; Link maDoneHdl;
Link maErrorHdl;
sal_uInt32 mnLastError;
sal_uInt32 mnExtra2;
sal_Bool mbAsync;
sal_Bool mbExtra1;
sal_Bool mbExtra2;
sal_Bool mbExtra3;
sal_Bool ImplImportGraphic( Graphic& rGraphic ); sal_Bool ImplImportGraphic( Graphic& rGraphic );
void ImplUpdateData( const Graphic& rGraphic ); void ImplUpdateData( const Graphic& rGraphic );
...@@ -92,14 +81,11 @@ public: ...@@ -92,14 +81,11 @@ public:
void SetImage( const ::rtl::OUString& rPath ); void SetImage( const ::rtl::OUString& rPath );
void SetImage( SvStream& rStm ); void SetImage( SvStream& rStm );
void SetErrorHandler( const Link& rErrorHdl ) { maErrorHdl = rErrorHdl; }
const Link& GetErrorHandler() const { return maErrorHdl; }
sal_uInt32 GetLastError() const { return mnLastError; }
void ResetLastError() { mnLastError = 0; }
void NewDataAvailable(); void NewDataAvailable();
void SetDoneHdl( const Link& i_rHdl ) { maDoneHdl = i_rHdl; }
const Link& GetDoneHdl() const { return maDoneHdl; }
// ::com::sun::star::uno::XInterface // ::com::sun::star::uno::XInterface
::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
void SAL_CALL acquire() throw() { OWeakObject::acquire(); } void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment