diff options
author | jp <jp@openoffice.org> | 2001-08-13 20:12:30 +0000 |
---|---|---|
committer | jp <jp@openoffice.org> | 2001-08-13 20:12:30 +0000 |
commit | b638992bfbc0c5fbd3da91e8e1c569e5db0b74b4 (patch) | |
tree | 99b27254a97223d31ed6e85bfe4c63960fc5e3fe /sw | |
parent | 6cca3c689848df4175d34ea8ff5260bda679bc25 (diff) |
Bug #90815#: Execute - use hasPropertyState
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/shells/drformsh.cxx | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/sw/source/ui/shells/drformsh.cxx b/sw/source/ui/shells/drformsh.cxx index ad41700f61..bfa404dd1d 100644 --- a/sw/source/ui/shells/drformsh.cxx +++ b/sw/source/ui/shells/drformsh.cxx @@ -2,9 +2,9 @@ * * $RCSfile: drformsh.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:14:46 $ + * last change: $Author: jp $ $Date: 2001-08-13 21:12:30 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -165,30 +165,33 @@ void SwDrawFormShell::Execute(SfxRequest &rReq) uno::Reference< beans::XPropertySet > xPropSet(xControlModel, uno::UNO_QUERY); - uno::Any aTmp; - // Darf man eine URL an dem Objekt setzen? + OUString sTargetURL( C2U( "TargetURL" )); uno::Reference< beans::XPropertySetInfo > xPropInfoSet = xPropSet->getPropertySetInfo(); - beans::Property aProp = xPropInfoSet->getPropertyByName( C2U("TargetURL" )); - if (aProp.Name.getLength()) + if( xPropInfoSet->hasPropertyByName( sTargetURL )) { - // Ja! - aTmp <<= OUString(rHLinkItem.GetName()); - xPropSet->setPropertyValue(C2U("Label"), aTmp ); + beans::Property aProp = xPropInfoSet->getPropertyByName( sTargetURL ); + if( aProp.Name.getLength() ) + { + uno::Any aTmp; + // Ja! + aTmp <<= OUString(rHLinkItem.GetName()); + xPropSet->setPropertyValue(C2U("Label"), aTmp ); - aTmp <<= OUString(INetURLObject::RelToAbs(rHLinkItem.GetURL())); - xPropSet->setPropertyValue( C2U("TargetURL"), aTmp ); + aTmp <<= OUString(INetURLObject::RelToAbs(rHLinkItem.GetURL())); + xPropSet->setPropertyValue( sTargetURL, aTmp ); - if( rHLinkItem.GetTargetFrame().Len() ) - { - aTmp <<= OUString(rHLinkItem.GetTargetFrame()); - xPropSet->setPropertyValue( C2U("TargetFrame"), aTmp ); - } + if( rHLinkItem.GetTargetFrame().Len() ) + { + aTmp <<= OUString(rHLinkItem.GetTargetFrame()); + xPropSet->setPropertyValue( C2U("TargetFrame"), aTmp ); + } - form::FormButtonType eButtonType = form::FormButtonType_URL; - aTmp.setValue( &eButtonType, ::getCppuType((const form::FormButtonType*)0)); - xPropSet->setPropertyValue( C2U("ButtonType"), aTmp ); + form::FormButtonType eButtonType = form::FormButtonType_URL; + aTmp.setValue( &eButtonType, ::getCppuType((const form::FormButtonType*)0)); + xPropSet->setPropertyValue( C2U("ButtonType"), aTmp ); + } } } } @@ -309,6 +312,9 @@ SwDrawFormShell::~SwDrawFormShell() Source Code Control System - History $Log: not supported by cvs2svn $ + Revision 1.1.1.1 2000/09/18 17:14:46 hr + initial import + Revision 1.19 2000/09/18 16:06:03 willem.vandorp OpenOffice header added. |