diff options
Diffstat (limited to 'embedserv/source/embed')
-rw-r--r-- | embedserv/source/embed/docholder.cxx | 54 | ||||
-rw-r--r-- | embedserv/source/embed/ed_idataobj.cxx | 26 | ||||
-rw-r--r-- | embedserv/source/embed/ed_iinplace.cxx | 8 | ||||
-rw-r--r-- | embedserv/source/embed/ed_ioleobject.cxx | 6 | ||||
-rw-r--r-- | embedserv/source/embed/ed_ipersiststr.cxx | 24 | ||||
-rw-r--r-- | embedserv/source/embed/esdll.cxx | 2 | ||||
-rw-r--r-- | embedserv/source/embed/guid.cxx | 4 | ||||
-rw-r--r-- | embedserv/source/embed/iipaobj.cxx | 12 | ||||
-rw-r--r-- | embedserv/source/embed/intercept.cxx | 130 | ||||
-rw-r--r-- | embedserv/source/embed/register.cxx | 2 | ||||
-rw-r--r-- | embedserv/source/embed/servprov.cxx | 30 | ||||
-rw-r--r-- | embedserv/source/embed/syswinwrapper.cxx | 26 | ||||
-rw-r--r-- | embedserv/source/embed/tracker.cxx | 124 | ||||
-rw-r--r-- | embedserv/source/embed/xwin.cxx | 106 |
14 files changed, 277 insertions, 277 deletions
diff --git a/embedserv/source/embed/docholder.cxx b/embedserv/source/embed/docholder.cxx index 02e8d01bf9b7..236eb1d8b85f 100644 --- a/embedserv/source/embed/docholder.cxx +++ b/embedserv/source/embed/docholder.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * 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 @@ -73,7 +73,7 @@ using namespace ::com::sun::star; -extern ::rtl::OUString getFilterNameFromGUID_Impl( GUID* ); +extern ::rtl::OUString getFilterNameFromGUID_Impl( GUID* ); // add mutex locking ??? @@ -139,7 +139,7 @@ void DocumentHolder::LoadDocInFrame( sal_Bool bPluginMode ) -1, aAny, beans::PropertyState_DIRECT_VALUE); - + aAny <<= sal_False; aSeq[1] = beans::PropertyValue( rtl::OUString( @@ -147,7 +147,7 @@ void DocumentHolder::LoadDocInFrame( sal_Bool bPluginMode ) -1, aAny, beans::PropertyState_DIRECT_VALUE); - + aAny <<= (sal_Bool) sal_True; aSeq[2] = beans::PropertyValue( rtl::OUString( @@ -295,7 +295,7 @@ HRESULT DocumentHolder::InPlaceActivate( { // determine XWindow and window handle of parent HWND hWndxWinParent(0); uno::Reference<awt::XWindow> xWin; - + static const ::rtl::OUString aToolkitServiceName( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.awt.Toolkit" ) ); uno::Reference<awt::XSystemChildFactory> xToolkit( @@ -306,7 +306,7 @@ HRESULT DocumentHolder::InPlaceActivate( if( !m_pCHatchWin ) m_pCHatchWin = new winwrap::CHatchWin( m_hInstance,this); - + if(m_pCHatchWin->Init(hWndSite,/*ID_HATCHWINDOW*/2000, NULL)) { m_pCHatchWin->RectsSet(&rcPos,&rcClip); //set visible area hWndxWinParent = m_pCHatchWin->Window(); @@ -317,7 +317,7 @@ HRESULT DocumentHolder::InPlaceActivate( delete m_pCHatchWin, m_pCHatchWin = 0; hWndxWinParent = hWndSite; } - + aAny <<= sal_Int32(hWndxWinParent); xWin = uno::Reference<awt::XWindow>( xToolkit->createSystemChild( @@ -326,7 +326,7 @@ HRESULT DocumentHolder::InPlaceActivate( lang::SystemDependent::SYSTEM_WIN32), uno::UNO_QUERY); } - + if(xWin.is()) { xWin->setPosSize( m_pCHatchWin ? HATCHWIN_BORDERWIDTHDEFAULT : 0, @@ -335,7 +335,7 @@ HRESULT DocumentHolder::InPlaceActivate( rcPos.bottom - rcPos.top, awt::PosSize::POSSIZE); xWin->setVisible(sal_True); - + m_xEditWindow = xWin; m_hWndxWinParent = hWndxWinParent; } @@ -347,7 +347,7 @@ HRESULT DocumentHolder::InPlaceActivate( SetParent(m_hWndxWinParent,hWndSite); ShowWindow(m_hWndxWinParent,SW_SHOW); //Make visible. } - + if ( !m_xFrame.is() ) // initially set size to "empty", this guarantees that the final resize // is always executed (will be done by "SetObjectRects" after getting internal border) @@ -359,7 +359,7 @@ HRESULT DocumentHolder::InPlaceActivate( awt::PosSize::POSSIZE); m_xEditWindow->setVisible(sal_True); } - + if(m_xContainerWindow.is()) { if(m_hWndxWinCont) { if(m_pIOleIPFrame) { @@ -371,7 +371,7 @@ HRESULT DocumentHolder::InPlaceActivate( } m_xContainerWindow->setVisible(true); } - + if(m_xFrame.is()) m_xFrame->activate(); else { @@ -381,10 +381,10 @@ HRESULT DocumentHolder::InPlaceActivate( m_xFrame = uno::Reference<frame::XFrame>( m_xFactory->createInstance(aFrameServiceName), uno::UNO_QUERY); - + if(!m_xFrame.is()) return ERROR; - + m_xFrame->initialize(m_xEditWindow); uno::Reference<frame::XDispatchProviderInterception> @@ -399,13 +399,13 @@ HRESULT DocumentHolder::InPlaceActivate( rtl::OUString::createFromAscii("LayoutManager")); aAny >>= m_xLayoutManager; } - + if(m_xLayoutManager.is()) m_xLayoutManager->setDockingAreaAcceptor(this); - + // load the model into the frame LoadDocInFrame( sal_True ); - + static const ::rtl::OUString aDesktopServiceName ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.frame.Desktop" ) ); uno::Reference< frame::XFramesSupplier > xDesktop( @@ -413,7 +413,7 @@ HRESULT DocumentHolder::InPlaceActivate( uno::UNO_QUERY ); if(xDesktop.is()) xDesktop->getFrames()->append(m_xFrame); - + // determine the menuhandle to get menutitems. if(m_xLayoutManager.is()) { uno::Reference< ::com::sun::star::ui::XUIElement > xUIEl( @@ -435,14 +435,14 @@ HRESULT DocumentHolder::InPlaceActivate( "private:resource/menubar/menubar" ))); } } - + // TODO/cd: Workaround for status indicator bug. It always makes the // document window visible, when someone tries to use the status // indicator. As we save our document when we get the deactivation // from OLE this conflict to hide floating windows. if(m_xLayoutManager.is()) m_xLayoutManager->setVisible(true); - + // get document border and resize rects according to border GetDocumentBorder( &m_aBorder ); SetObjectRects( &rcPos, &rcClip ); @@ -457,7 +457,7 @@ HRESULT DocumentHolder::InPlaceActivate( // setTitle(m_aDocumentNamePart); if (fIncludeUI) hr=UIActivate(); - + m_pIOleIPSite->DiscardUndoState(); } catch( uno::Exception& ) @@ -501,7 +501,7 @@ void DocumentHolder::InPlaceDeactivate(void) // CComPtr< IOleClientSite > pClientSite; // // m_pIOleIPSite->QueryInterface( -// IID_IOleClientSite, (void**)&pClientSite ); +// IID_IOleClientSite, (void**)&pClientSite ); // if ( pClientSite ) // pClientSite->SaveObject(); @@ -881,7 +881,7 @@ uno::Reference< frame::XFrame > DocumentHolder::DocumentFrame() uno::Reference< frame::XDispatchProviderInterceptor > DocumentHolder::CreateNewInterceptor() { ::osl::MutexGuard aGuard( m_aMutex ); - + ClearInterceptorInternally(); uno::Reference< frame::XDispatchProviderInterceptor > xInterceptor( m_pInterceptor = new Interceptor( m_xOleAccess, this, m_bLink ) ); @@ -1320,14 +1320,14 @@ HRESULT DocumentHolder::SetContRects(LPCRECT aRect) memset(&wi,0,sizeof(wi)); if(m_pIOleIPFrame) { m_pIOleIPFrame->GetBorder((LPRECT)&wi); - m_xContainerWindow->setPosSize( + m_xContainerWindow->setPosSize( 0,0, wi.right - wi.left, wi.bottom - wi.top, awt::PosSize::POSSIZE); } else - m_xContainerWindow->setPosSize( + m_xContainerWindow->setPosSize( 0,0, aRect->right - aRect->left, aRect->bottom - aRect->top, @@ -1515,7 +1515,7 @@ DocumentHolder::queryClosing( util::CloseVetoException ) { - if ( !m_bLink + if ( !m_bLink && ( m_xDocument.is() && m_xDocument == aSource.Source || m_xFrame.is() && m_xFrame == aSource.Source ) ) throw util::CloseVetoException(); } @@ -1635,7 +1635,7 @@ void SAL_CALL DocumentHolder::modified( const lang::EventObject& /*aEvent*/ ) // mgw.width[5]=1; // } -// Fix strange warnings about some +// Fix strange warnings about some // ATL::CAxHostWindow::QueryInterface|AddRef|Releae functions. // warning C4505: 'xxx' : unreferenced local function has been removed #if defined(_MSC_VER) diff --git a/embedserv/source/embed/ed_idataobj.cxx b/embedserv/source/embed/ed_idataobj.cxx index d4f75f4a6353..73e1ed629441 100644 --- a/embedserv/source/embed/ed_idataobj.cxx +++ b/embedserv/source/embed/ed_idataobj.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * 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 @@ -188,7 +188,7 @@ STDMETHODIMP EmbedDocument_Impl::GetDataHere( FORMATETC * pFormatetc, STGMEDIUM { if ( !( pFormatetc->tymed & TYMED_ISTORAGE ) ) return DV_E_TYMED; - + if ( !pMedium->pstg ) return STG_E_MEDIUMFULL; HRESULT hr = SaveTo_Impl( pMedium->pstg ); @@ -216,17 +216,17 @@ STDMETHODIMP EmbedDocument_Impl::QueryGetData( FORMATETC * pFormatetc ) { if ( !( pFormatetc->tymed & TYMED_ENHMF ) ) return DV_E_TYMED; - + return S_OK; } else if ( pFormatetc->cfFormat == CF_METAFILEPICT ) { - if ( !( pFormatetc->tymed & TYMED_MFPICT ) ) + if ( !( pFormatetc->tymed & TYMED_MFPICT ) ) return DV_E_TYMED; - + return S_OK; } - else + else { CLIPFORMAT cf_embSource = (CLIPFORMAT)RegisterClipboardFormatA( "Embed Source" ); CLIPFORMAT cf_embObj = (CLIPFORMAT)RegisterClipboardFormatA( "Embedded Object" ); @@ -234,7 +234,7 @@ STDMETHODIMP EmbedDocument_Impl::QueryGetData( FORMATETC * pFormatetc ) { if ( !( pFormatetc->tymed & TYMED_ISTORAGE ) ) return DV_E_TYMED; - + return S_OK; } } @@ -252,7 +252,7 @@ STDMETHODIMP EmbedDocument_Impl::GetCanonicalFormatEtc( FORMATETC * pFormatetcIn pFormatetcOut->ptd = NULL; pFormatetcOut->cfFormat = pFormatetcIn->cfFormat; pFormatetcOut->dwAspect = DVASPECT_CONTENT; - + if ( pFormatetcIn->cfFormat == CF_ENHMETAFILE ) { pFormatetcOut->tymed = TYMED_ENHMF; @@ -263,7 +263,7 @@ STDMETHODIMP EmbedDocument_Impl::GetCanonicalFormatEtc( FORMATETC * pFormatetcIn pFormatetcOut->tymed = TYMED_MFPICT; return S_OK; } - else + else { CLIPFORMAT cf_embSource = (CLIPFORMAT)RegisterClipboardFormatA( "Embed Source" ); CLIPFORMAT cf_embObj = (CLIPFORMAT)RegisterClipboardFormatA( "Embedded Object" ); @@ -295,7 +295,7 @@ STDMETHODIMP EmbedDocument_Impl::DAdvise( FORMATETC * pFormatetc, DWORD advf, IA if ( !m_pDAdviseHolder ) if ( !SUCCEEDED( CreateDataAdviseHolder( &m_pDAdviseHolder ) ) || !m_pDAdviseHolder ) return E_OUTOFMEMORY; - + return m_pDAdviseHolder->Advise( (IDataObject*)this, pFormatetc, advf, pAdvSink, pdwConnection ); } @@ -304,7 +304,7 @@ STDMETHODIMP EmbedDocument_Impl::DUnadvise( DWORD dwConnection ) if ( !m_pDAdviseHolder ) if ( !SUCCEEDED( CreateDataAdviseHolder( &m_pDAdviseHolder ) ) || !m_pDAdviseHolder ) return E_OUTOFMEMORY; - + return m_pDAdviseHolder->Unadvise( dwConnection ); } @@ -313,11 +313,11 @@ STDMETHODIMP EmbedDocument_Impl::EnumDAdvise( IEnumSTATDATA ** ppenumAdvise ) if ( !m_pDAdviseHolder ) if ( !SUCCEEDED( CreateDataAdviseHolder( &m_pDAdviseHolder ) ) || !m_pDAdviseHolder ) return E_OUTOFMEMORY; - + return m_pDAdviseHolder->EnumAdvise( ppenumAdvise ); } -// Fix strange warnings about some +// Fix strange warnings about some // ATL::CAxHostWindow::QueryInterface|AddRef|Releae functions. // warning C4505: 'xxx' : unreferenced local function has been removed #if defined(_MSC_VER) diff --git a/embedserv/source/embed/ed_iinplace.cxx b/embedserv/source/embed/ed_iinplace.cxx index 5604cbb7739e..7e696463f01c 100644 --- a/embedserv/source/embed/ed_iinplace.cxx +++ b/embedserv/source/embed/ed_iinplace.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * 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 @@ -33,7 +33,7 @@ STDMETHODIMP EmbedDocument_Impl::GetWindow(HWND *hWnd) { OSL_ENSURE(m_pDocHolder,"no document for inplace activation"); - + *hWnd = m_pDocHolder->GetTopMostWinHandle(); if(*hWnd != NULL) return NOERROR; @@ -84,7 +84,7 @@ STDMETHODIMP EmbedDocument_Impl::UIDeactivate(void) STDMETHODIMP EmbedDocument_Impl::SetObjectRects(LPCRECT aRect, LPCRECT aClip) { OSL_ENSURE(m_pDocHolder,"no document for inplace activation"); - + return m_pDocHolder->SetObjectRects(aRect,aClip); } @@ -93,7 +93,7 @@ STDMETHODIMP EmbedDocument_Impl::ReactivateAndUndo(void) return E_NOTIMPL; } -// Fix strange warnings about some +// Fix strange warnings about some // ATL::CAxHostWindow::QueryInterface|AddRef|Releae functions. // warning C4505: 'xxx' : unreferenced local function has been removed #if defined(_MSC_VER) diff --git a/embedserv/source/embed/ed_ioleobject.cxx b/embedserv/source/embed/ed_ioleobject.cxx index db6adfaa729c..4910dca3d675 100644 --- a/embedserv/source/embed/ed_ioleobject.cxx +++ b/embedserv/source/embed/ed_ioleobject.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * 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 @@ -35,7 +35,7 @@ using namespace ::com::sun::star; -extern ::rtl::OUString getFilterNameFromGUID_Impl( GUID* ); +extern ::rtl::OUString getFilterNameFromGUID_Impl( GUID* ); //------------------------------------------------------------------------------- // IOleObject @@ -187,7 +187,7 @@ STDMETHODIMP EmbedDocument_Impl::DoVerb( return m_pDocHolder->InPlaceActivate(pActiveSite,FALSE); break; case OLEIVERB_UIACTIVATE: - OSL_ENSURE(m_pDocHolder,"no document for inplace activation"); + OSL_ENSURE(m_pDocHolder,"no document for inplace activation"); return m_pDocHolder->InPlaceActivate(pActiveSite,TRUE); break; diff --git a/embedserv/source/embed/ed_ipersiststr.cxx b/embedserv/source/embed/ed_ipersiststr.cxx index 6d6bc7712cec..7a762f0ed3a3 100644 --- a/embedserv/source/embed/ed_ipersiststr.cxx +++ b/embedserv/source/embed/ed_ipersiststr.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * 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 @@ -55,9 +55,9 @@ using namespace ::com::sun::star; extern ::rtl::OUString getStorageTypeFromGUID_Impl( GUID* guid ); -extern ::rtl::OUString getServiceNameFromGUID_Impl( GUID* ); -extern ::rtl::OUString getFilterNameFromGUID_Impl( GUID* ); -// extern CLIPFORMAT getClipFormatFromGUID_Impl( GUID* ); +extern ::rtl::OUString getServiceNameFromGUID_Impl( GUID* ); +extern ::rtl::OUString getFilterNameFromGUID_Impl( GUID* ); +// extern CLIPFORMAT getClipFormatFromGUID_Impl( GUID* ); ::rtl::OUString getTestFileURLFromGUID_Impl( GUID* guid ); const ::rtl::OUString aOfficeEmbedStreamName( RTL_CONSTASCII_USTRINGPARAM ( "package_stream" ) ); @@ -440,12 +440,12 @@ STDMETHODIMP EmbedDocument_Impl::InitNew( IStorage *pStg ) ::rtl::OUString aCurType = getStorageTypeFromGUID_Impl( &m_guid ); // ??? CLIPFORMAT cf = (CLIPFORMAT)RegisterClipboardFormatA( "Embedded Object" ); hr = WriteFmtUserTypeStg( pStg, - cf, // ??? + cf, // ??? reinterpret_cast<LPWSTR>(( sal_Unicode* )aCurType.getStr()) ); if ( hr == S_OK ) { - hr = pStg->CreateStream( reinterpret_cast<LPCWSTR>(aOfficeEmbedStreamName.getStr()), + hr = pStg->CreateStream( reinterpret_cast<LPCWSTR>(aOfficeEmbedStreamName.getStr()), STGM_CREATE | ( nStreamMode & 0x73 ), 0, 0, @@ -453,7 +453,7 @@ STDMETHODIMP EmbedDocument_Impl::InitNew( IStorage *pStg ) if ( hr == S_OK && m_pOwnStream ) { - hr = pStg->CreateStream( reinterpret_cast<LPCWSTR>(aExtentStreamName.getStr()), + hr = pStg->CreateStream( reinterpret_cast<LPCWSTR>(aExtentStreamName.getStr()), STGM_CREATE | ( nStreamMode & 0x73 ), 0, 0, @@ -611,14 +611,14 @@ STDMETHODIMP EmbedDocument_Impl::Save( IStorage *pStgSave, BOOL fSameAsLoad ) if ( FAILED( hr ) ) return E_FAIL; DWORD nStreamMode = aStat.grfMode; - hr = pStgSave->CreateStream( reinterpret_cast<LPCWSTR>(aOfficeEmbedStreamName.getStr()), + hr = pStgSave->CreateStream( reinterpret_cast<LPCWSTR>(aOfficeEmbedStreamName.getStr()), STGM_CREATE | ( nStreamMode & 0x73 ), 0, 0, &pTargetStream ); if ( FAILED( hr ) || !pTargetStream ) return E_FAIL; - hr = pStgSave->CreateStream( reinterpret_cast<LPCWSTR>(aExtentStreamName.getStr()), + hr = pStgSave->CreateStream( reinterpret_cast<LPCWSTR>(aExtentStreamName.getStr()), STGM_CREATE | ( nStreamMode & 0x73 ), 0, 0, @@ -777,7 +777,7 @@ STDMETHODIMP EmbedDocument_Impl::Load( LPCOLESTR pszFileName, DWORD /*dwMode*/ ) ::rtl::OUString aCurType = getServiceNameFromGUID_Impl( &m_guid ); // ??? CLIPFORMAT cf = (CLIPFORMAT)RegisterClipboardFormatA( "Embedded Object" ); hr = WriteFmtUserTypeStg( m_pMasterStorage, - cf, // ??? + cf, // ??? reinterpret_cast<LPWSTR>(( sal_Unicode* )aCurType.getStr()) ); if ( FAILED( hr ) ) return E_FAIL; @@ -828,7 +828,7 @@ STDMETHODIMP EmbedDocument_Impl::Load( LPCOLESTR pszFileName, DWORD /*dwMode*/ ) ::rtl::OUString aCurType = getServiceNameFromGUID_Impl( &m_guid ); // ??? CLIPFORMAT cf = (CLIPFORMAT)RegisterClipboardFormatA( "Embedded Object" ); hr = WriteFmtUserTypeStg( m_pMasterStorage, - cf, // ??? + cf, // ??? reinterpret_cast<LPWSTR>(( sal_Unicode* )aCurType.getStr()) ); if ( SUCCEEDED( hr ) ) @@ -1010,7 +1010,7 @@ void LockedEmbedDocument_Impl::ExecuteMethod( sal_Int16 nId ) } } -// Fix strange warnings about some +// Fix strange warnings about some // ATL::CAxHostWindow::QueryInterface|AddRef|Releae functions. // warning C4505: 'xxx' : unreferenced local function has been removed #if defined(_MSC_VER) diff --git a/embedserv/source/embed/esdll.cxx b/embedserv/source/embed/esdll.cxx index 56ee550c1e81..582a3dcba572 100644 --- a/embedserv/source/embed/esdll.cxx +++ b/embedserv/source/embed/esdll.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * 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 diff --git a/embedserv/source/embed/guid.cxx b/embedserv/source/embed/guid.cxx index 90122776df9c..6512b0d8a82e 100644 --- a/embedserv/source/embed/guid.cxx +++ b/embedserv/source/embed/guid.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * 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 @@ -206,7 +206,7 @@ } */ -// Fix strange warnings about some +// Fix strange warnings about some // ATL::CAxHostWindow::QueryInterface|AddRef|Releae functions. // warning C4505: 'xxx' : unreferenced local function has been removed #if defined(_MSC_VER) diff --git a/embedserv/source/embed/iipaobj.cxx b/embedserv/source/embed/iipaobj.cxx index 1c51ffa09f89..d3d5ea77fd81 100644 --- a/embedserv/source/embed/iipaobj.cxx +++ b/embedserv/source/embed/iipaobj.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * 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 @@ -48,12 +48,12 @@ CIIAObj::~CIIAObj() STDMETHODIMP CIIAObj::QueryInterface(REFIID riid, LPVOID FAR *ppv) { *ppv=NULL; - - if(IID_IUnknown==riid || + + if(IID_IUnknown==riid || IID_IOleWindow==riid || IID_IOleInPlaceActiveObject==riid) *ppv=this; - + //AddRef any interface we'll return. if (NULL!=*ppv) { @@ -110,7 +110,7 @@ STDMETHODIMP CIIAObj::ResizeBorder( LPCRECT pRect,LPOLEINPLACEUIWINDOW,BOOL bFrame) { if(!bFrame) return NOERROR; - + if ( !m_rDocHolder.is() ) return E_FAIL; @@ -123,7 +123,7 @@ STDMETHODIMP CIIAObj::EnableModeless(BOOL) return NOERROR; } -// Fix strange warnings about some +// Fix strange warnings about some // ATL::CAxHostWindow::QueryInterface|AddRef|Releae functions. // warning C4505: 'xxx' : unreferenced local function has been removed #if defined(_MSC_VER) diff --git a/embedserv/source/embed/intercept.cxx b/embedserv/source/embed/intercept.cxx index 08a01020510d..e94d5c900523 100644 --- a/embedserv/source/embed/intercept.cxx +++ b/embedserv/source/embed/intercept.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * 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 @@ -46,7 +46,7 @@ uno::Sequence< ::rtl::OUString > Interceptor::m_aInterceptedURL(IUL); struct equalOUString { - bool operator()( + bool operator()( const rtl::OUString& rKey1, const rtl::OUString& rKey2 ) const { @@ -79,27 +79,27 @@ public: void SAL_CALL -Interceptor::addEventListener( +Interceptor::addEventListener( const uno::Reference<lang::XEventListener >& Listener ) throw( uno::RuntimeException ) { osl::MutexGuard aGuard( m_aMutex ); - + if ( ! m_pDisposeEventListeners ) m_pDisposeEventListeners = new cppu::OInterfaceContainerHelper( m_aMutex ); - + m_pDisposeEventListeners->addInterface( Listener ); } void SAL_CALL -Interceptor::removeEventListener( +Interceptor::removeEventListener( const uno::Reference< lang::XEventListener >& Listener ) throw( uno::RuntimeException ) { osl::MutexGuard aGuard( m_aMutex ); - + if ( m_pDisposeEventListeners ) m_pDisposeEventListeners->removeInterface( Listener ); } @@ -110,15 +110,15 @@ void SAL_CALL Interceptor::dispose() { lang::EventObject aEvt; aEvt.Source = static_cast< frame::XDispatch* >( this ); - + osl::MutexGuard aGuard(m_aMutex); - + if ( m_pDisposeEventListeners && m_pDisposeEventListeners->getLength() ) m_pDisposeEventListeners->disposeAndClear( aEvt ); - + if(m_pStatCL) m_pStatCL->disposeAndClear( aEvt ); - + m_xSlaveDispatchProvider = 0; m_xMasterDispatchProvider = 0; } @@ -141,11 +141,11 @@ Interceptor::Interceptor( m_aInterceptedURL[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(".uno:SaveAll")); m_aInterceptedURL[2] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM(".uno:CloseDoc")); + RTL_CONSTASCII_USTRINGPARAM(".uno:CloseDoc")); m_aInterceptedURL[3] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM(".uno:CloseWin")); + RTL_CONSTASCII_USTRINGPARAM(".uno:CloseWin")); m_aInterceptedURL[4] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM(".uno:CloseFrame")); + RTL_CONSTASCII_USTRINGPARAM(".uno:CloseFrame")); m_aInterceptedURL[5] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(".uno:SaveAs")); } @@ -158,7 +158,7 @@ Interceptor::~Interceptor() if(m_pStatCL) delete m_pStatCL; - + DocumentHolder* pTmpDocH = NULL; uno::Reference< uno::XInterface > xLock; { @@ -181,8 +181,8 @@ void Interceptor::DisconnectDocHolder() } //XDispatch -void SAL_CALL -Interceptor::dispatch( +void SAL_CALL +Interceptor::dispatch( const util::URL& URL, const uno::Sequence< beans::PropertyValue >& Arguments ) @@ -193,7 +193,7 @@ Interceptor::dispatch( osl::MutexGuard aGuard(m_aMutex); xOleAccess = m_xOleAccess; } - + if ( xOleAccess.is() ) { LockedEmbedDocument_Impl aDocLock = xOleAccess->GetEmbedDocument(); @@ -210,7 +210,7 @@ Interceptor::dispatch( { uno::Sequence< beans::PropertyValue > aNewArgs = Arguments; sal_Int32 nInd = 0; - + while( nInd < aNewArgs.getLength() ) { if ( aNewArgs[nInd].Name.equalsAscii( "SaveTo" ) ) @@ -220,7 +220,7 @@ Interceptor::dispatch( } nInd++; } - + if ( nInd == aNewArgs.getLength() ) { aNewArgs.realloc( nInd + 1 ); @@ -259,28 +259,28 @@ void Interceptor::generateFeatureStateEvent() { if( i == 1 || m_bLink && i != 5 ) continue; - - cppu::OInterfaceContainerHelper* pICH = + + cppu::OInterfaceContainerHelper* pICH = m_pStatCL->getContainer(m_aInterceptedURL[i]); uno::Sequence<uno::Reference<uno::XInterface> > aSeq; if(pICH) aSeq = pICH->getElements(); if(!aSeq.getLength()) continue; - + frame::FeatureStateEvent aStateEvent; aStateEvent.IsEnabled = sal_True; - aStateEvent.Requery = sal_False; + aStateEvent.Requery = sal_False; if(i == 0) { - + aStateEvent.FeatureURL.Complete = m_aInterceptedURL[0]; aStateEvent.FeatureDescriptor = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Update")); aStateEvent.State <<= (rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("($1) ")) + + RTL_CONSTASCII_USTRINGPARAM("($1) ")) + aTitle); - + } else if ( i == 5 ) { @@ -298,16 +298,16 @@ void Interceptor::generateFeatureStateEvent() aStateEvent.State <<= (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("($2) ")) + aTitle); - + } - + for(sal_Int32 k = 0; k < aSeq.getLength(); ++k) { uno::Reference<frame::XStatusListener> Control(aSeq[k],uno::UNO_QUERY); if(Control.is()) Control->statusChanged(aStateEvent); - + } } } @@ -315,9 +315,9 @@ void Interceptor::generateFeatureStateEvent() void SAL_CALL -Interceptor::addStatusListener( - const uno::Reference< - frame::XStatusListener >& Control, +Interceptor::addStatusListener( + const uno::Reference< + frame::XStatusListener >& Control, const util::URL& URL ) throw ( uno::RuntimeException @@ -325,8 +325,8 @@ Interceptor::addStatusListener( { if(!Control.is()) return; - - if( !m_bLink && URL.Complete == m_aInterceptedURL[0] ) + + if( !m_bLink && URL.Complete == m_aInterceptedURL[0] ) { // Save DocumentHolder* pTmpDocH = NULL; uno::Reference< uno::XInterface > xLock; @@ -348,21 +348,21 @@ Interceptor::addStatusListener( aStateEvent.IsEnabled = sal_True; aStateEvent.Requery = sal_False; aStateEvent.State <<= (rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("($1) ")) + + RTL_CONSTASCII_USTRINGPARAM("($1) ")) + aTitle ); Control->statusChanged(aStateEvent); - + { osl::MutexGuard aGuard(m_aMutex); if(!m_pStatCL) - m_pStatCL = + m_pStatCL = new StatusChangeListenerContainer(m_aMutex); } - + m_pStatCL->addInterface(URL.Complete,Control); return; } - + sal_Int32 i = 2; if ( !m_bLink && ( URL.Complete == m_aInterceptedURL[i] || @@ -392,20 +392,20 @@ Interceptor::addStatusListener( RTL_CONSTASCII_USTRINGPARAM("($2) ")) + aTitle ); Control->statusChanged(aStateEvent); - - + + { osl::MutexGuard aGuard(m_aMutex); if(!m_pStatCL) - m_pStatCL = + m_pStatCL = new StatusChangeListenerContainer(m_aMutex); } - + m_pStatCL->addInterface(URL.Complete,Control); return; } - if(URL.Complete == m_aInterceptedURL[5]) + if(URL.Complete == m_aInterceptedURL[5]) { // SaveAs frame::FeatureStateEvent aStateEvent; aStateEvent.FeatureURL.Complete = m_aInterceptedURL[5]; @@ -415,14 +415,14 @@ Interceptor::addStatusListener( aStateEvent.Requery = sal_False; aStateEvent.State <<= (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("($3)"))); Control->statusChanged(aStateEvent); - + { osl::MutexGuard aGuard(m_aMutex); if(!m_pStatCL) - m_pStatCL = + m_pStatCL = new StatusChangeListenerContainer(m_aMutex); } - + m_pStatCL->addInterface(URL.Complete,Control); return; } @@ -432,9 +432,9 @@ Interceptor::addStatusListener( void SAL_CALL Interceptor::removeStatusListener( - const uno::Reference< - frame::XStatusListener >& Control, - const util::URL& URL ) + const uno::Reference< + frame::XStatusListener >& Control, + const util::URL& URL ) throw ( uno::RuntimeException ) @@ -449,8 +449,8 @@ Interceptor::removeStatusListener( //XInterceptorInfo -uno::Sequence< ::rtl::OUString > -SAL_CALL +uno::Sequence< ::rtl::OUString > +SAL_CALL Interceptor::getInterceptedURLs( ) throw ( uno::RuntimeException @@ -465,7 +465,7 @@ Interceptor::getInterceptedURLs( ) return aResult; } - + return m_aInterceptedURL; } @@ -473,9 +473,9 @@ Interceptor::getInterceptedURLs( ) // XDispatchProvider uno::Reference< frame::XDispatch > SAL_CALL -Interceptor::queryDispatch( +Interceptor::queryDispatch( const util::URL& URL, - const ::rtl::OUString& TargetFrameName, + const ::rtl::OUString& TargetFrameName, sal_Int32 SearchFlags ) throw ( uno::RuntimeException @@ -516,7 +516,7 @@ Interceptor::queryDispatches( aRet = m_xSlaveDispatchProvider->queryDispatches(Requests); else aRet.realloc(Requests.getLength()); - + for(sal_Int32 i = 0; i < Requests.getLength(); ++i) if ( !m_bLink && m_aInterceptedURL[0] == Requests[i].FeatureURL.Complete ) aRet[i] = (frame::XDispatch*) this; @@ -538,8 +538,8 @@ Interceptor::queryDispatches( //XDispatchProviderInterceptor -uno::Reference< frame::XDispatchProvider > SAL_CALL -Interceptor::getSlaveDispatchProvider( ) +uno::Reference< frame::XDispatchProvider > SAL_CALL +Interceptor::getSlaveDispatchProvider( ) throw ( uno::RuntimeException ) @@ -549,7 +549,7 @@ Interceptor::getSlaveDispatchProvider( ) } void SAL_CALL -Interceptor::setSlaveDispatchProvider( +Interceptor::setSlaveDispatchProvider( const uno::Reference< frame::XDispatchProvider >& NewDispatchProvider ) throw ( uno::RuntimeException @@ -561,18 +561,18 @@ Interceptor::setSlaveDispatchProvider( uno::Reference< frame::XDispatchProvider > SAL_CALL -Interceptor::getMasterDispatchProvider( ) +Interceptor::getMasterDispatchProvider( ) throw ( uno::RuntimeException ) { osl::MutexGuard aGuard(m_aMutex); - return m_xMasterDispatchProvider; + return m_xMasterDispatchProvider; } - + void SAL_CALL -Interceptor::setMasterDispatchProvider( +Interceptor::setMasterDispatchProvider( const uno::Reference< frame::XDispatchProvider >& NewSupplier ) throw ( uno::RuntimeException @@ -582,7 +582,7 @@ Interceptor::setMasterDispatchProvider( m_xMasterDispatchProvider = NewSupplier; } -// Fix strange warnings about some +// Fix strange warnings about some // ATL::CAxHostWindow::QueryInterface|AddRef|Releae functions. // warning C4505: 'xxx' : unreferenced local function has been removed #if defined(_MSC_VER) diff --git a/embedserv/source/embed/register.cxx b/embedserv/source/embed/register.cxx index 75b9e5ed4e29..d51df036fb3c 100644 --- a/embedserv/source/embed/register.cxx +++ b/embedserv/source/embed/register.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * 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 diff --git a/embedserv/source/embed/servprov.cxx b/embedserv/source/embed/servprov.cxx index 952774c2807a..e21780903ab6 100644 --- a/embedserv/source/embed/servprov.cxx +++ b/embedserv/source/embed/servprov.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * 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 @@ -100,7 +100,7 @@ void o2u_attachCurrentThread() if ( oleThreadData.getData() != 0 ) { - HINSTANCE inst= LoadLibrary( _T("ole32.dll")); + HINSTANCE inst= LoadLibrary( _T("ole32.dll")); if( inst ) { HRESULT hr; @@ -226,25 +226,25 @@ EmbedProviderFactory_Impl::~EmbedProviderFactory_Impl() sal_Bool EmbedProviderFactory_Impl::registerClass() { HRESULT hresult; - + o2u_attachCurrentThread(); - hresult = CoRegisterClassObject( + hresult = CoRegisterClassObject( m_guid, this, CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE, &m_factoryHandle); - - return (hresult == NOERROR); -} + + return (hresult == NOERROR); +} sal_Bool EmbedProviderFactory_Impl::deregisterClass() { HRESULT hresult = CoRevokeClassObject( m_factoryHandle ); - return (hresult == NOERROR); -} + return (hresult == NOERROR); +} STDMETHODIMP EmbedProviderFactory_Impl::QueryInterface(REFIID riid, void FAR* FAR* ppv) { @@ -253,7 +253,7 @@ STDMETHODIMP EmbedProviderFactory_Impl::QueryInterface(REFIID riid, void FAR* FA AddRef(); *ppv = (IUnknown*) (IClassFactory*) this; return NOERROR; - } + } else if (IsEqualIID(riid, IID_IClassFactory)) { AddRef(); @@ -276,9 +276,9 @@ STDMETHODIMP_(ULONG) EmbedProviderFactory_Impl::Release() sal_Int32 nCount = --m_refCount; if ( nCount == 0 ) { - delete this; + delete this; } - + return nCount; } @@ -287,9 +287,9 @@ STDMETHODIMP EmbedProviderFactory_Impl::CreateInstance(IUnknown FAR* punkOuter, void FAR* FAR* ppv) { punkOuter = NULL; - + IUnknown* pEmbedDocument = (IUnknown*)(IPersistStorage*)( new EmbedDocument_Impl( m_xFactory, &m_guid ) ); - + return pEmbedDocument->QueryInterface( riid, ppv ); } @@ -298,7 +298,7 @@ STDMETHODIMP EmbedProviderFactory_Impl::LockServer( int /*fLock*/ ) return NOERROR; } -// Fix strange warnings about some +// Fix strange warnings about some // ATL::CAxHostWindow::QueryInterface|AddRef|Releae functions. // warning C4505: 'xxx' : unreferenced local function has been removed #if defined(_MSC_VER) diff --git a/embedserv/source/embed/syswinwrapper.cxx b/embedserv/source/embed/syswinwrapper.cxx index 455e143261f7..c247617d9235 100644 --- a/embedserv/source/embed/syswinwrapper.cxx +++ b/embedserv/source/embed/syswinwrapper.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * 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 @@ -226,15 +226,15 @@ BOOL CHatchWin::Init(HWND hWndParent, UINT uID, HWND hWndAssoc) , SZCLASSHATCHWIN, WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, 0, 0, 100, 100, hWndParent, (HMENU)uID , m_hInst, this); - + m_uID=uID; m_hWndAssociate=hWndAssoc; - + return (NULL!=m_hWnd); } -void CHatchWin::SetTrans() +void CHatchWin::SetTrans() { HRGN hrgn = CreateRectRgn(0,0,0,0); SetWindowRgn(m_hWnd,hrgn,true); @@ -317,14 +317,14 @@ void CHatchWin::RectsSet(LPRECT prcPos, LPRECT prcClip) // , prcPos->bottom-prcPos->top, SWP_NOZORDER | SWP_NOACTIVATE); RECT newRC; - GetClientRect(m_hWnd,&newRC); + GetClientRect(m_hWnd,&newRC); m_aTracker = Tracker( &newRC, - Tracker::hatchInside | + Tracker::hatchInside | Tracker::hatchedBorder | Tracker::resizeInside ); - + return; } @@ -406,10 +406,10 @@ LRESULT APIENTRY winwrap::HatchWndProc( PCHatchWin phw; HDC hDC; PAINTSTRUCT ps; - + phw=(PCHatchWin)GetWindowLong(hWnd, HWWL_STRUCTURE); POINT ptMouse; - + switch (iMsg) { case WM_CREATE: @@ -425,7 +425,7 @@ LRESULT APIENTRY winwrap::HatchWndProc( case WM_LBUTTONDOWN: GetCursorPos(&ptMouse); ScreenToClient(hWnd,&ptMouse); - + // track in case we have to if(phw->m_aTracker.Track(hWnd,ptMouse,FALSE,GetParent(hWnd))) { @@ -444,7 +444,7 @@ LRESULT APIENTRY winwrap::HatchWndProc( //We need this since the container will SetFocus to us. if (NULL!=phw->m_hWndKid) SetFocus(phw->m_hWndKid); - + break; case WM_LBUTTONDBLCLK: /* @@ -466,11 +466,11 @@ LRESULT APIENTRY winwrap::HatchWndProc( default: return DefWindowProc(hWnd, iMsg, wParam, lParam); } - + return 0L; } -// Fix strange warnings about some +// Fix strange warnings about some // ATL::CAxHostWindow::QueryInterface|AddRef|Releae functions. // warning C4505: 'xxx' : unreferenced local function has been removed #if defined(_MSC_VER) diff --git a/embedserv/source/embed/tracker.cxx b/embedserv/source/embed/tracker.cxx index 9c97c8c973d6..4d7e7408ad6a 100644 --- a/embedserv/source/embed/tracker.cxx +++ b/embedserv/source/embed/tracker.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * 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 @@ -144,7 +144,7 @@ void DrawDragRect( SetRectRgn(rgnInside,rect.left,rect.top,rect.right,rect.bottom); CombineRgn(rgnLast,rgnOutside,rgnInside, RGN_XOR); -// // only diff them if brushes are the same +// // only diff them if brushes are the same if (hBrush == hBrushLast) { rgnUpdate = CreateRectRgn(0, 0, 0, 0); @@ -199,7 +199,7 @@ void NormalizeRect(LPRECT rp) rp->left = rp->right; rp->right = tmp; } - + if(rp->top > rp->bottom) { UINT tmp = rp->top; rp->top = rp->bottom; @@ -245,36 +245,36 @@ void Tracker::Construct() wPattern <<= 1; } HBITMAP hatchBitmap = CreateBitmap(8, 8, 1, 1,&hatchPattern); - + // create black hatched brush _afxHatchBrush = CreatePatternBrush(hatchBitmap); DeleteObject(hatchBitmap); } - + if (_afxBlackDottedPen == NULL) { // create black dotted pen _afxBlackDottedPen = CreatePen(PS_DOT, 0, RGB(0, 0, 0)); } - + // get default handle size from Windows profile setting static const TCHAR szWindows[] = TEXT("windows"); static const TCHAR szInplaceBorderWidth[] = TEXT("oleinplaceborderwidth"); _afxHandleSize = GetProfileInt(szWindows, szInplaceBorderWidth, 4); bInitialized = TRUE; - + _afxCursors[0] = _afxCursors[2] = LoadCursor(0,IDC_SIZENWSE); _afxCursors[4] = _afxCursors[6] = LoadCursor(0,IDC_SIZENS); _afxCursors[1] = _afxCursors[3] = LoadCursor(0,IDC_SIZENESW); _afxCursors[5] = _afxCursors[7] = LoadCursor(0,IDC_SIZEWE); _afxCursors[8] = LoadCursor(0,IDC_SIZEALL); } - + m_nStyle = 0; m_nHandleSize = _afxHandleSize; m_sizeMin.cy = m_sizeMin.cx = m_nHandleSize*2; - + SetRectEmpty(&m_rectLast); m_sizeLast.cx = m_sizeLast.cy = 0; m_bErase = FALSE; @@ -289,7 +289,7 @@ Tracker::~Tracker() int Tracker::HitTest(POINT point) const { TrackerHit hitResult = hitNothing; - + RECT rectTrue; GetTrueRect(&rectTrue); NormalizeRect(&rectTrue); @@ -309,20 +309,20 @@ BOOL Tracker::SetCursor(HWND pWnd, UINT nHitTest) const // trackers should only be in client area if (nHitTest != HTCLIENT) return FALSE; - + // convert cursor position to client co-ordinates POINT point; GetCursorPos(&point); ScreenToClient(pWnd,&point); - + // do hittest and normalize hit int nHandle = HitTestHandles(point); if (nHandle < 0) return FALSE; - + // need to normalize the hittest such that we get proper cursors nHandle = NormalizeHit(nHandle); - + // handle special case of hitting area between handles // (logically the same -- handled as a move -- but different cursor) if (nHandle == hitMiddle && !PtInRect(&m_rect,point)) @@ -331,8 +331,8 @@ BOOL Tracker::SetCursor(HWND pWnd, UINT nHitTest) const if (m_nStyle & hatchedBorder) nHandle = (TrackerHit)9; } - - ::SetCursor(_afxCursors[nHandle]); + + ::SetCursor(_afxCursors[nHandle]); return TRUE; } @@ -348,7 +348,7 @@ BOOL Tracker::Track(HWND hWnd,POINT point,BOOL bAllowInvert, // didn't hit a handle, so just return FALSE return FALSE; } - + // otherwise, call helper function to do the tracking m_bAllowInvert = bAllowInvert; SetCursor(hWnd,nHandle); @@ -361,25 +361,25 @@ BOOL Tracker::TrackHandle(int nHandle,HWND hWnd,POINT point,HWND hWndClipTo) // don't handle if capture already set if (GetCapture() != NULL) return FALSE; - + // save original width & height in pixels int nWidth = m_rect.right - m_rect.left; int nHeight = m_rect.bottom - m_rect.top; - + // set capture to the window which received this message SetCapture(hWnd); UpdateWindow(hWnd); if (hWndClipTo != NULL) UpdateWindow(hWndClipTo); RECT rectSave = m_rect; - + // find out what x/y coords we are supposed to modify int *px, *py; int xDiff, yDiff; GetModifyPointers(nHandle, &px, &py, &xDiff, &yDiff); xDiff = point.x - xDiff; yDiff = point.y - yDiff; - + // get DC for drawing HDC hDrawDC; if (hWndClipTo != NULL) @@ -392,19 +392,19 @@ BOOL Tracker::TrackHandle(int nHandle,HWND hWnd,POINT point,HWND hWndClipTo) // otherwise, just use normal DC hDrawDC = GetDC(hWnd); } - + RECT rectOld; BOOL bMoved = FALSE; - + // get messages until capture lost or cancelled/accepted for (;;) { MSG msg; GetMessage(&msg, NULL, 0, 0); - + if (GetCapture() != hWnd) break; - + switch (msg.message) { // handle movement/accept messages @@ -416,7 +416,7 @@ BOOL Tracker::TrackHandle(int nHandle,HWND hWnd,POINT point,HWND hWndClipTo) *px = (int)(short)LOWORD(msg.lParam) - xDiff; if (py != NULL) *py = (int)(short)HIWORD(msg.lParam) - yDiff; - + // handle move case if (nHandle == hitMiddle) { @@ -425,7 +425,7 @@ BOOL Tracker::TrackHandle(int nHandle,HWND hWnd,POINT point,HWND hWndClipTo) } // allow caller to adjust the rectangle if necessary AdjustRect(nHandle,&m_rect); - + // only redraw and callback if the rect actually changed! m_bFinalErase = (msg.message == WM_LBUTTONUP); if (!EqualRect(&rectOld,&m_rect) || m_bFinalErase) @@ -441,14 +441,14 @@ BOOL Tracker::TrackHandle(int nHandle,HWND hWnd,POINT point,HWND hWndClipTo) } if (m_bFinalErase) goto ExitLoop; - + if (!EqualRect(&rectOld,&m_rect)) { m_bErase = FALSE; DrawTrackerRect(&m_rect,hWndClipTo,hDrawDC,hWnd); } break; - + // handle cancel messages case WM_KEYDOWN: if (msg.wParam != VK_ESCAPE) @@ -461,34 +461,34 @@ BOOL Tracker::TrackHandle(int nHandle,HWND hWnd,POINT point,HWND hWndClipTo) } m_rect = rectSave; goto ExitLoop; - + // just dispatch rest of the messages default: DispatchMessage(&msg); break; } } - + ExitLoop: if (hWndClipTo != NULL) ReleaseDC(hWndClipTo,hDrawDC); else ReleaseDC(hWnd,hDrawDC); ReleaseCapture(); - + // restore rect in case bMoved is still FALSE if (!bMoved) m_rect = rectSave; m_bFinalErase = FALSE; m_bErase = FALSE; - + // return TRUE only if rect has changed return !EqualRect(&rectSave,&m_rect); } void Tracker::OnChangedRect(const RECT& /*rectOld*/) -{ +{ } @@ -496,11 +496,11 @@ void Tracker::AdjustRect(int nHandle, LPRECT) { if(nHandle == hitMiddle) return; - + // convert the handle into locations within m_rect int *px, *py; GetModifyPointers(nHandle, &px, &py, NULL, NULL); - + // enforce minimum width int nNewWidth = m_rect.right - m_rect.left; int nAbsWidth = m_bAllowInvert ? abs(nNewWidth) : nNewWidth; @@ -512,7 +512,7 @@ void Tracker::AdjustRect(int nHandle, LPRECT) *px = *(int*)((BYTE*)&m_rect + pRectInfo->nOffsetAcross) + nNewWidth * m_sizeMin.cx * -pRectInfo->nSignAcross; } - + // enforce minimum height int nNewHeight = m_rect.bottom - m_rect.top; int nAbsHeight = m_bAllowInvert ? abs(nNewHeight) : nNewHeight; @@ -533,11 +533,11 @@ void Tracker::DrawTrackerRect( // first, normalize the rectangle for drawing RECT rect = *lpRect; NormalizeRect(&rect); - + // convert to client coordinates if (pWndClipTo != NULL) TransformRect(&rect,pWnd,pWndClipTo); - + SIZE size; size.cx = 0; size.cy = 0; if (!m_bFinalErase) @@ -554,11 +554,11 @@ void Tracker::DrawTrackerRect( size.cy = 1; // CY_BORDER; } } - + // and draw it - if (m_bFinalErase || !m_bErase) + if (m_bFinalErase || !m_bErase) DrawDragRect(pDC,&rect,size,&m_rectLast,m_sizeLast); - + // remember last rectangles m_rectLast = rect; m_sizeLast = size; @@ -571,16 +571,16 @@ void Tracker::Draw(HDC hDC) const SetMapMode(hDC,MM_TEXT); SetViewportOrgEx(hDC,0, 0,NULL); SetWindowOrgEx(hDC,0, 0,NULL); - + // get normalized rectangle RECT rect = m_rect; NormalizeRect(&rect); - + HPEN pOldPen = NULL; HBRUSH pOldBrush = NULL; HGDIOBJ pTemp; int nOldROP; - + // draw lines if ((m_nStyle & (dottedLine|solidLine)) != 0) { @@ -594,11 +594,11 @@ void Tracker::Draw(HDC hDC) const Rectangle(hDC,rect.left, rect.top, rect.right, rect.bottom); SetROP2(hDC,nOldROP); } - + // if hatchBrush is going to be used, need to unrealize it if ((m_nStyle & (hatchInside|hatchedBorder)) != 0) UnrealizeObject((HGDIOBJ)_afxHatchBrush); - + // hatch inside if ((m_nStyle & hatchInside) != 0) { @@ -613,7 +613,7 @@ void Tracker::Draw(HDC hDC) const Rectangle(hDC,rect.left+1, rect.top+1, rect.right, rect.bottom); SetROP2(hDC,nOldROP); } - + // draw hatched border if ((m_nStyle & hatchedBorder) != 0) { @@ -633,7 +633,7 @@ void Tracker::Draw(HDC hDC) const PatBlt(hDC,rect.right, rect.top, rectTrue.right-rect.right, rect.bottom-rect.top, 0x000F0001 /* Pn */); } - + // draw resize handles if ((m_nStyle & (resizeInside|resizeOutside)) != 0) { @@ -650,7 +650,7 @@ void Tracker::Draw(HDC hDC) const } DeleteObject(hbrush); } - + // cleanup pDC state if (pOldPen != NULL) SelectObject(hDC,pOldPen); @@ -667,16 +667,16 @@ void Tracker::GetHandleRect(int nHandle,RECT* pHandleRect) const NormalizeRect(&rectT); if ((m_nStyle & (solidLine|dottedLine)) != 0) InflateRect(&rectT,+1, +1); - + // since the rectangle itself was normalized, we also have to invert the // resize handles. nHandle = NormalizeHit(nHandle); - + // handle case of resize handles outside the tracker int size = GetHandleSize(); if (m_nStyle & resizeOutside) InflateRect(&rectT,size-1, size-1); - + // calculate position of the resize handle int nWidth = rectT.right - rectT.left; int nHeight = rectT.bottom - rectT.top; @@ -690,7 +690,7 @@ void Tracker::GetHandleRect(int nHandle,RECT* pHandleRect) const rect.top += pHandleInfo->nCenterY * (nHeight - size) / 2; rect.right = rect.left + size; rect.bottom = rect.top + size; - + *pHandleRect = rect; } @@ -699,7 +699,7 @@ int Tracker::GetHandleSize(LPRECT lpRect) const { if (lpRect == NULL) lpRect = (LPRECT)&m_rect; - + int size = m_nHandleSize; if (!(m_nStyle & resizeOutside)) { @@ -759,12 +759,12 @@ int Tracker::HitTestHandles(POINT point) const { RECT rect; UINT mask = GetHandleMask(); - + // see if hit anywhere inside the tracker GetTrueRect(&rect); if (!PtInRect(&rect,point)) return hitNothing; // totally missed - + // see if we hit a handle for (int i = 0; i < 8; ++i) { @@ -775,7 +775,7 @@ int Tracker::HitTestHandles(POINT point) const return (TrackerHit)i; } } - + // last of all, check for non-hit outside of object, between resize handles if ((m_nStyle & hatchedBorder) == 0) { @@ -796,14 +796,14 @@ void Tracker::GetModifyPointers( { if (nHandle == hitMiddle) nHandle = hitTopLeft; // same as hitting top-left - + *ppx = NULL; *ppy = NULL; - + // fill in the part of the rect that this handle modifies // (Note: handles that map to themselves along a given axis when that // axis is inverted don't modify the value on that axis) - + const AFX_HANDLEINFO* pHandleInfo = &_afxHandleInfo[nHandle]; if (pHandleInfo->nInvertX != nHandle) { @@ -831,7 +831,7 @@ void Tracker::GetModifyPointers( } } -// Fix strange warnings about some +// Fix strange warnings about some // ATL::CAxHostWindow::QueryInterface|AddRef|Releae functions. // warning C4505: 'xxx' : unreferenced local function has been removed #if defined(_MSC_VER) diff --git a/embedserv/source/embed/xwin.cxx b/embedserv/source/embed/xwin.cxx index 473647419cb9..38840a7d71f1 100644 --- a/embedserv/source/embed/xwin.cxx +++ b/embedserv/source/embed/xwin.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * 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 @@ -38,7 +38,7 @@ ContainerWindowWrapper::ContainerWindowWrapper(HWND aHwnd) m_pDisposeEventListeners(0) { } - + ContainerWindowWrapper::~ContainerWindowWrapper() { delete m_pDisposeEventListeners; @@ -47,31 +47,31 @@ ContainerWindowWrapper::~ContainerWindowWrapper() void SAL_CALL ContainerWindowWrapper::dispose( -) +) throw ( ::com::sun::star::uno::RuntimeException ) { cppu::OInterfaceContainerHelper *pDisposeEventListeners(0); - + { osl::MutexGuard aGuard(m_aMutex); pDisposeEventListeners = m_pDisposeEventListeners; } - + if(pDisposeEventListeners) { lang::EventObject aEvt; aEvt.Source = static_cast< awt::XWindow* >(this); - + pDisposeEventListeners->disposeAndClear(aEvt); } } void SAL_CALL -ContainerWindowWrapper::addEventListener( +ContainerWindowWrapper::addEventListener( const ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XEventListener >& Listener + ::com::sun::star::lang::XEventListener >& Listener ) throw ( ::com::sun::star::uno::RuntimeException @@ -82,14 +82,14 @@ ContainerWindowWrapper::addEventListener( osl::MutexGuard aGuard(m_aMutex); pDisposeEventListeners = m_pDisposeEventListeners; } - + if(! pDisposeEventListeners) { osl::MutexGuard aGuard(m_aMutex); pDisposeEventListeners = m_pDisposeEventListeners = new cppu::OInterfaceContainerHelper(m_aMutex); } - + pDisposeEventListeners->addInterface( Listener ); } @@ -98,11 +98,11 @@ void SAL_CALL ContainerWindowWrapper::removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& Listener -) +) throw ( ::com::sun::star::uno::RuntimeException ) -{ +{ cppu::OInterfaceContainerHelper *pDisposeEventListeners(0); { osl::MutexGuard aGuard(m_aMutex); @@ -117,15 +117,15 @@ ContainerWindowWrapper::removeEventListener( // XSystemDependentWindowPeer ::com::sun::star::uno::Any SAL_CALL -ContainerWindowWrapper::getWindowHandle( +ContainerWindowWrapper::getWindowHandle( const ::com::sun::star::uno::Sequence< sal_Int8 >& ProcessId, sal_Int16 SystemType -) +) throw ( ::com::sun::star::uno::RuntimeException ) { - if(SystemType == lang::SystemDependent::SYSTEM_WIN32 || + if(SystemType == lang::SystemDependent::SYSTEM_WIN32 || SystemType == lang::SystemDependent::SYSTEM_WIN16) { uno::Any aAny; @@ -138,24 +138,24 @@ ContainerWindowWrapper::getWindowHandle( } - + void SAL_CALL -ContainerWindowWrapper::setPosSize( +ContainerWindowWrapper::setPosSize( sal_Int32 X, sal_Int32 Y, - sal_Int32 Width, - sal_Int32 Height, + sal_Int32 Width, + sal_Int32 Height, sal_Int16 Flags ) throw ( ::com::sun::star::uno::RuntimeException) { - + } ::com::sun::star::awt::Rectangle SAL_CALL -ContainerWindowWrapper::getPosSize( -) +ContainerWindowWrapper::getPosSize( +) throw ( ::com::sun::star::uno::RuntimeException ) @@ -167,7 +167,7 @@ ContainerWindowWrapper::getPosSize( void SAL_CALL ContainerWindowWrapper::setVisible( sal_Bool Visible -) +) throw ( ::com::sun::star::uno::RuntimeException ) @@ -177,9 +177,9 @@ ContainerWindowWrapper::setVisible( void SAL_CALL -ContainerWindowWrapper::setEnable( +ContainerWindowWrapper::setEnable( sal_Bool Enable -) +) throw ( ::com::sun::star::uno::RuntimeException ) @@ -189,7 +189,7 @@ ContainerWindowWrapper::setEnable( void SAL_CALL ContainerWindowWrapper::setFocus( -) +) throw ( ::com::sun::star::uno::RuntimeException ) @@ -198,22 +198,22 @@ ContainerWindowWrapper::setFocus( } void SAL_CALL -ContainerWindowWrapper::addWindowListener( - const ::com::sun::star::uno::Reference< +ContainerWindowWrapper::addWindowListener( + const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowListener >& xListener -) +) throw ( ::com::sun::star::uno::RuntimeException ) { } - + void SAL_CALL ContainerWindowWrapper::removeWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowListener >& xListener -) +) throw ( ::com::sun::star::uno::RuntimeException ) @@ -223,10 +223,10 @@ ContainerWindowWrapper::removeWindowListener( void SAL_CALL -ContainerWindowWrapper::addFocusListener( +ContainerWindowWrapper::addFocusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener -) +) throw ( ::com::sun::star::uno::RuntimeException ) @@ -234,24 +234,24 @@ ContainerWindowWrapper::addFocusListener( } - + void SAL_CALL ContainerWindowWrapper::removeFocusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener -) +) throw ( ::com::sun::star::uno::RuntimeException ) { } - + void SAL_CALL ContainerWindowWrapper::addKeyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyListener >& xListener -) +) throw ( ::com::sun::star::uno::RuntimeException ) @@ -260,10 +260,10 @@ ContainerWindowWrapper::addKeyListener( } void SAL_CALL -ContainerWindowWrapper::removeKeyListener( +ContainerWindowWrapper::removeKeyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyListener >& xListener -) +) throw ( ::com::sun::star::uno::RuntimeException ) @@ -271,21 +271,21 @@ ContainerWindowWrapper::removeKeyListener( } - + void SAL_CALL ContainerWindowWrapper::addMouseListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener >& xListener -) +) throw ( ::com::sun::star::uno::RuntimeException ) { - + } + - -void SAL_CALL +void SAL_CALL ContainerWindowWrapper::removeMouseListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener >& xListener @@ -301,17 +301,17 @@ ContainerWindowWrapper::removeMouseListener( void SAL_CALL ContainerWindowWrapper::addMouseMotionListener( const ::com::sun::star::uno::Reference< - ::com::sun::star::awt::XMouseMotionListener >& xListener -) + ::com::sun::star::awt::XMouseMotionListener >& xListener +) throw ( ::com::sun::star::uno::RuntimeException ) { } - + void SAL_CALL -ContainerWindowWrapper::removeMouseMotionListener( +ContainerWindowWrapper::removeMouseMotionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseMotionListener >& xListener ) @@ -326,19 +326,19 @@ void SAL_CALL ContainerWindowWrapper::addPaintListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPaintListener >& xListener -) +) throw ( ::com::sun::star::uno::RuntimeException ) { - + } void SAL_CALL -ContainerWindowWrapper::removePaintListener( - const ::com::sun::star::uno::Reference< +ContainerWindowWrapper::removePaintListener( + const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPaintListener >& xListener -) +) throw ( ::com::sun::star::uno::RuntimeException ) |