summaryrefslogtreecommitdiff
path: root/embedserv/source
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2007-01-25 10:36:17 +0000
committerOliver Bolte <obo@openoffice.org>2007-01-25 10:36:17 +0000
commitcbc0be0319dedc6e8f67a03c5ac33583070a8f15 (patch)
tree2965b55b9891df462a9122f7cc8bdd2e8c432325 /embedserv/source
parent68c168b82d55cd33498b87b8f1272b7ff636a17f (diff)
INTEGRATION: CWS mbafixesfor22 (1.18.10); FILE MERGED
2007/01/18 13:06:01 mav 1.18.10.1: #i73611# handle the error cases correctly
Diffstat (limited to 'embedserv/source')
-rwxr-xr-xembedserv/source/embed/ed_ioleobject.cxx145
1 files changed, 76 insertions, 69 deletions
diff --git a/embedserv/source/embed/ed_ioleobject.cxx b/embedserv/source/embed/ed_ioleobject.cxx
index 33f065b1f..268bbc7c7 100755
--- a/embedserv/source/embed/ed_ioleobject.cxx
+++ b/embedserv/source/embed/ed_ioleobject.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: ed_ioleobject.cxx,v $
*
- * $Revision: 1.18 $
+ * $Revision: 1.19 $
*
- * last change: $Author: rt $ $Date: 2006-12-05 13:03:27 $
+ * last change: $Author: obo $ $Date: 2007-01-25 11:36:17 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -182,73 +182,80 @@ STDMETHODIMP EmbedDocument_Impl::DoVerb(
iVerb = OLEIVERB_SHOW;
}
- switch(iVerb) {
- case OLEIVERB_DISCARDUNDOSTATE:
- // free any undostate?
- break;
- case OLEIVERB_INPLACEACTIVATE:
- OSL_ENSURE(m_pDocHolder,"no document for inplace activation");
-
- return m_pDocHolder->InPlaceActivate(pActiveSite,FALSE);
- break;
- case OLEIVERB_UIACTIVATE:
- OSL_ENSURE(m_pDocHolder,"no document for inplace activation");
-
- return m_pDocHolder->InPlaceActivate(pActiveSite,TRUE);
- break;
- case OLEIVERB_PRIMARY:
- case OLEIVERB_SHOW:
- OSL_ENSURE(m_pDocHolder,"no document for inplace activation");
-
- if(m_pDocHolder->isActive())
- return NOERROR; //Already active
-
- if(SUCCEEDED(
- m_pDocHolder->InPlaceActivate(
- pActiveSite,TRUE)))
- return NOERROR;
-
- // intended fall trough
- case OLEIVERB_OPEN:
- OSL_ENSURE(m_pDocHolder,"no document to open");
-
- // the commented code could be usefull in case
- // outer window would be resized depending from inner one
- // RECTL aEmbArea;
- // m_pDocHolder->GetVisArea( &aEmbArea );
- // m_pDocHolder->show();
- // m_pDocHolder->SetVisArea( &aEmbArea );
-
- if(m_pDocHolder->isActive())
- {
- m_pDocHolder->InPlaceDeactivate();
- m_pDocHolder->DisableInplaceActivation(true);
- }
-
- SIZEL aEmbSize;
- m_pDocHolder->GetExtent( &aEmbSize );
- m_pDocHolder->show();
- m_pDocHolder->resizeWin( aEmbSize );
-
- if ( m_pClientSite )
- m_pClientSite->OnShowWindow( TRUE );
-
- notify();
- break;
- case OLEIVERB_HIDE:
- OSL_ENSURE(m_pDocHolder,"no document to hide");
-
- if(m_pDocHolder->isActive())
- m_pDocHolder->InPlaceDeactivate();
- else {
- m_pDocHolder->hide();
-
- if( m_pClientSite )
- m_pClientSite->OnShowWindow(FALSE);
- }
- break;
- default:
- break;
+ try
+ {
+ switch(iVerb) {
+ case OLEIVERB_DISCARDUNDOSTATE:
+ // free any undostate?
+ break;
+ case OLEIVERB_INPLACEACTIVATE:
+ OSL_ENSURE(m_pDocHolder,"no document for inplace activation");
+
+ return m_pDocHolder->InPlaceActivate(pActiveSite,FALSE);
+ break;
+ case OLEIVERB_UIACTIVATE:
+ OSL_ENSURE(m_pDocHolder,"no document for inplace activation");
+
+ return m_pDocHolder->InPlaceActivate(pActiveSite,TRUE);
+ break;
+ case OLEIVERB_PRIMARY:
+ case OLEIVERB_SHOW:
+ OSL_ENSURE(m_pDocHolder,"no document for inplace activation");
+
+ if(m_pDocHolder->isActive())
+ return NOERROR; //Already active
+
+ if(SUCCEEDED(
+ m_pDocHolder->InPlaceActivate(
+ pActiveSite,TRUE)))
+ return NOERROR;
+
+ // intended fall trough
+ case OLEIVERB_OPEN:
+ OSL_ENSURE(m_pDocHolder,"no document to open");
+
+ // the commented code could be usefull in case
+ // outer window would be resized depending from inner one
+ // RECTL aEmbArea;
+ // m_pDocHolder->GetVisArea( &aEmbArea );
+ // m_pDocHolder->show();
+ // m_pDocHolder->SetVisArea( &aEmbArea );
+
+ if(m_pDocHolder->isActive())
+ {
+ m_pDocHolder->InPlaceDeactivate();
+ m_pDocHolder->DisableInplaceActivation(true);
+ }
+
+ SIZEL aEmbSize;
+ m_pDocHolder->GetExtent( &aEmbSize );
+ m_pDocHolder->show();
+ m_pDocHolder->resizeWin( aEmbSize );
+
+ if ( m_pClientSite )
+ m_pClientSite->OnShowWindow( TRUE );
+
+ notify();
+ break;
+ case OLEIVERB_HIDE:
+ OSL_ENSURE(m_pDocHolder,"no document to hide");
+
+ if(m_pDocHolder->isActive())
+ m_pDocHolder->InPlaceDeactivate();
+ else {
+ m_pDocHolder->hide();
+
+ if( m_pClientSite )
+ m_pClientSite->OnShowWindow(FALSE);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ catch( uno::Exception& )
+ {
+ return OLEOBJ_S_CANNOT_DOVERB_NOW;
}
return NOERROR;