summaryrefslogtreecommitdiff
path: root/embedserv/source/embed/ed_ioleobject.cxx
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
commitc774ca591f6d463f91eced67b7fbf2816bc00ea1 (patch)
tree9ede059ac5d4f9a178b356e62794851eb3addeaf /embedserv/source/embed/ed_ioleobject.cxx
parentec44a43fb49afb042eedf756123157d476ea4d2d (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/embed/ed_ioleobject.cxx')
-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 1c8080b0a4b2..8d831f5ac82a 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;