diff options
author | Oliver Specht <os@openoffice.org> | 2001-09-28 05:44:10 +0000 |
---|---|---|
committer | Oliver Specht <os@openoffice.org> | 2001-09-28 05:44:10 +0000 |
commit | b8c2a7714813272518ab1713df002ec3962778cc (patch) | |
tree | 81ad71546dcd43539a8b25834f7f12ec150bd3bc | |
parent | f40e165ca53316322db7dc29f87432986248c64b (diff) |
#92514# cast of Any::getValue removed
-rw-r--r-- | sw/source/ui/shells/drformsh.cxx | 37 | ||||
-rw-r--r-- | sw/source/ui/uno/unoatxt.cxx | 25 | ||||
-rw-r--r-- | sw/source/ui/uno/unomod.cxx | 16 | ||||
-rw-r--r-- | sw/source/ui/uno/unotxdoc.cxx | 61 | ||||
-rw-r--r-- | sw/source/ui/uno/unotxvw.cxx | 11 | ||||
-rw-r--r-- | sw/source/ui/utlui/content.cxx | 10 | ||||
-rw-r--r-- | sw/source/ui/utlui/uiitems.cxx | 10 | ||||
-rw-r--r-- | sw/source/ui/utlui/unotools.cxx | 19 | ||||
-rw-r--r-- | sw/source/ui/wrtsh/wrtsh3.cxx | 25 |
9 files changed, 108 insertions, 106 deletions
diff --git a/sw/source/ui/shells/drformsh.cxx b/sw/source/ui/shells/drformsh.cxx index bfa404dd1d..ea2f591037 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.2 $ + * $Revision: 1.3 $ * - * last change: $Author: jp $ $Date: 2001-08-13 21:12:30 $ + * last change: $Author: os $ $Date: 2001-09-28 06:40:02 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -239,18 +239,16 @@ void SwDrawFormShell::GetState(SfxItemSet& rSet) { form::FormButtonType eButtonType = form::FormButtonType_URL; aTmp = xPropSet->getPropertyValue( C2U("ButtonType") ); - if( aTmp.getValueType() == ::getCppuType((form::FormButtonType*)0) - && eButtonType == *( form::FormButtonType*)aTmp.getValue()) + if( aTmp >>= eButtonType ) { // Label if(xInfo->hasPropertyByName( C2U("Label") )) { aTmp = xPropSet->getPropertyValue( C2U("Label") ); - if( aTmp.getValueType() == ::getCppuType((const OUString*)0) ) + OUString sTmp; + if( (aTmp >>= sTmp) && sTmp.getLength()) { - OUString sTmp = *(OUString*)aTmp.getValue(); - if(sTmp.getLength()) - aHLinkItem.SetName(sTmp); + aHLinkItem.SetName(sTmp); } } @@ -258,11 +256,10 @@ void SwDrawFormShell::GetState(SfxItemSet& rSet) if(xInfo->hasPropertyByName( C2U("TargetURL" ))) { aTmp = xPropSet->getPropertyValue( C2U("TargetURL") ); - if( aTmp.getValueType() == ::getCppuType((const OUString*)0)) + OUString sTmp; + if( (aTmp >>= sTmp) && sTmp.getLength()) { - OUString sTmp = *(OUString*)aTmp.getValue(); - if(sTmp.getLength()) - aHLinkItem.SetURL(sTmp); + aHLinkItem.SetURL(sTmp); } } @@ -270,11 +267,10 @@ void SwDrawFormShell::GetState(SfxItemSet& rSet) if(xInfo->hasPropertyByName( C2U("TargetFrame") )) { aTmp = xPropSet->getPropertyValue( C2U("TargetFrame") ); - if( aTmp.getValueType() == ::getCppuType((const OUString*)0)) + OUString sTmp; + if( (aTmp >>= sTmp) && sTmp.getLength()) { - OUString sTmp = *(OUString*) aTmp.getValue(); - if(sTmp.getLength()) - aHLinkItem.SetTargetFrame(sTmp); + aHLinkItem.SetTargetFrame(sTmp); } } aHLinkItem.SetInsertMode(HLINK_BUTTON); @@ -312,15 +308,18 @@ SwDrawFormShell::~SwDrawFormShell() Source Code Control System - History $Log: not supported by cvs2svn $ + Revision 1.2 2001/08/13 21:12:30 jp + Bug #90815#: Execute - use hasPropertyState + 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. - + Revision 1.18 2000/05/26 07:21:32 os old SW Basic API Slots removed - + Revision 1.17 2000/05/16 09:15:13 os project usr removed diff --git a/sw/source/ui/uno/unoatxt.cxx b/sw/source/ui/uno/unoatxt.cxx index 6315131cf0..a491a7b27d 100644 --- a/sw/source/ui/uno/unoatxt.cxx +++ b/sw/source/ui/uno/unoatxt.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unoatxt.cxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: mtg $ $Date: 2001-08-31 15:11:03 $ + * last change: $Author: os $ $Date: 2001-09-28 06:44:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -669,13 +669,13 @@ void SwXAutoTextGroup::setName(const OUString& rName) throw( uno::RuntimeExcepti // check value after delimiter... OUString aNewSuffix (rName.copy ( 1 + rName.lastIndexOf ( GLOS_DELIM ) ) ); OUString aOldSuffix (sName.copy ( 1 + sName.lastIndexOf ( GLOS_DELIM ) ) ); - + sal_Int32 nNewNumeric = aNewSuffix.toInt32(); sal_Int32 nOldNumeric = aOldSuffix.toInt32(); OUString aNewPrefix (rName.copy ( 0, rName.lastIndexOf ( GLOS_DELIM ) ) ); OUString aOldPrefix (sName.copy ( 0, sName.lastIndexOf ( GLOS_DELIM ) ) ); - + if ( sName == rName || ( nNewNumeric == nOldNumeric && aNewPrefix == aOldPrefix ) ) return; @@ -882,10 +882,11 @@ void SwXAutoTextGroup::setPropertyValue( { case WID_GROUP_TITLE: { - if(aValue.getValueType() != ::getCppuType((OUString*)0)) + OUString sNewTitle; + aValue >>= sNewTitle; + if(!sNewTitle.getLength()) throw lang::IllegalArgumentException(); - String sNewTitle = *(OUString*)aValue.getValue(); - sal_Bool bChanged = sNewTitle != pGlosGroup->GetName(); + sal_Bool bChanged = !sNewTitle.equals(pGlosGroup->GetName()); pGlosGroup->SetName(sNewTitle); if(bChanged && HasGlossaryList()) GetGlossaryList()->ClearGroups(); @@ -1151,11 +1152,11 @@ void SwXAutoTextEntry::applyTo(const Reference< text::XTextRange > & xTextRange) if(xTunnel.is()) { - pRange = reinterpret_cast < SwXTextRange* > + pRange = reinterpret_cast < SwXTextRange* > ( xTunnel->getSomething( SwXTextRange::getUnoTunnelId() ) ); - pCursor = reinterpret_cast < SwXTextCursor*> + pCursor = reinterpret_cast < SwXTextCursor*> ( xTunnel->getSomething( SwXTextCursor::getUnoTunnelId() ) ); - pText = reinterpret_cast < SwXText* > + pText = reinterpret_cast < SwXText* > ( xTunnel->getSomething( SwXText::getUnoTunnelId() ) ); } @@ -1169,7 +1170,7 @@ void SwXAutoTextEntry::applyTo(const Reference< text::XTextRange > & xTextRange) xTunnel = Reference < lang::XUnoTunnel > (pText->getStart(), uno::UNO_QUERY); if (xTunnel.is()) { - pCursor = reinterpret_cast < SwXTextCursor* > + pCursor = reinterpret_cast < SwXTextCursor* > ( xTunnel->getSomething( SwXTextCursor::getUnoTunnelId() ) ); if (pCursor) pDoc = pText->GetDoc(); @@ -1240,7 +1241,7 @@ Reference< container::XNameReplace > SwXAutoTextEntry::getEvents() ---------------------------------------------------------------------------*/ const struct SvEventDescription aAutotextEvents[] = -{ +{ { SW_EVENT_START_INS_GLOSSARY, "OnInsertStart" }, { SW_EVENT_END_INS_GLOSSARY, "OnInsertDone" }, { 0, NULL } diff --git a/sw/source/ui/uno/unomod.cxx b/sw/source/ui/uno/unomod.cxx index c5e725ffd4..a3bfb23c7c 100644 --- a/sw/source/ui/uno/unomod.cxx +++ b/sw/source/ui/uno/unomod.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unomod.cxx,v $ * - * $Revision: 1.15 $ + * $Revision: 1.16 $ * - * last change: $Author: mtg $ $Date: 2001-09-20 14:36:39 $ + * last change: $Author: os $ $Date: 2001-09-28 06:44:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -761,8 +761,8 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c break; case HANDLE_VIEWSET_ZOOM : { - sal_Int16 nZoom = *(sal_Int16*)rValue.getValue(); - if(nZoom > 1000 || nZoom < 5) + sal_Int16 nZoom; + if(!(rValue >>= nZoom) || nZoom > 1000 || nZoom < 5) throw lang::IllegalArgumentException(); mpViewOption->SetZoom((sal_uInt16)nZoom); mbApplyZoom = sal_True; @@ -770,7 +770,9 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c break; case HANDLE_VIEWSET_ZOOM_TYPE: { - sal_Int16 nZoom = *(sal_Int16*)rValue.getValue(); + sal_Int16 nZoom; + if(!(rValue >>= nZoom)) + throw IllegalArgumentException(); SvxZoomType eZoom = (SvxZoomType)USHRT_MAX; switch(nZoom) { @@ -819,7 +821,7 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c sal_uInt32 nHelpId = sNumber.toInt32(); rEditWin.SetHelpId ( nHelpId ); } - else + else throw UnknownPropertyException(); } break; @@ -927,7 +929,7 @@ void SwXViewSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, : sHelpURL.append ( static_cast < sal_Int32 > ( rEditWin.GetHelpId() ) ); rValue <<= sHelpURL.makeStringAndClear(); } - else + else throw UnknownPropertyException(); } break; diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index 3b88128540..90c4e7be1b 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unotxdoc.cxx,v $ * - * $Revision: 1.51 $ + * $Revision: 1.52 $ * - * last change: $Author: os $ $Date: 2001-09-14 14:47:05 $ + * last change: $Author: os $ $Date: 2001-09-28 06:44:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -380,12 +380,11 @@ Sequence< uno::Type > SAL_CALL SwXTextDocument::getTypes() throw(RuntimeExceptio GetNumberFormatter(); if(xNumFmtAgg.is()) { - const uno::Type& rProvType = ::getCppuType((Reference<XTypeProvider>*) 0); + const uno::Type& rProvType = ::getCppuType((Reference <XTypeProvider>*)0); Any aNumProv = xNumFmtAgg->queryAggregation(rProvType); - if(aNumProv.getValueType() == rProvType) + Reference<XTypeProvider> xNumProv; + if(aNumProv >>= xNumProv) { - Reference<XTypeProvider> xNumProv = - *(Reference<XTypeProvider>*)aNumProv.getValue(); aNumTypes = xNumProv->getTypes(); } } @@ -484,13 +483,12 @@ void SwXTextDocument::GetNumberFormatter() } else { - const uno::Type& rTunnelType = ::getCppuType((Reference< XUnoTunnel > *)0); + const uno::Type& rTunnelType = ::getCppuType((Reference <XUnoTunnel>*)0); Any aNumTunnel = xNumFmtAgg->queryAggregation(rTunnelType); SvNumberFormatsSupplierObj* pNumFmt = 0; - if(aNumTunnel.getValueType() == rTunnelType) + Reference< XUnoTunnel > xNumTunnel; + if(aNumTunnel >>= xNumTunnel) { - Reference< XUnoTunnel > xNumTunnel = *(Reference< XUnoTunnel >*) - aNumTunnel.getValue(); pNumFmt = (SvNumberFormatsSupplierObj*) xNumTunnel->getSomething(SvNumberFormatsSupplierObj::getUnoTunnelId()); @@ -596,7 +594,7 @@ Reference< XInterface > SwXTextDocument::getCurrentSelection() throw( RuntimeEx if(pView) { Any aRef = pView->GetUNOObject()->getSelection(); - xRef = *(Reference< XInterface > *)aRef.getValue(); + aRef >>= xRef; } } return xRef; @@ -1299,8 +1297,9 @@ void SwXTextDocument::printPages(const Sequence< beans::PropertyValue >& xOption // Pages-Property else if ( rProp.Name == sPages ) { - if ( rProp.Value.getValueType() == ::getCppuType((const OUString*)0) ) - aReq.AppendItem( SfxStringItem( SID_PRINT_PAGES, *(OUString*)rProp.Value.getValue() ) ); + OUString sTmp; + if ( rProp.Value >>= sTmp ) + aReq.AppendItem( SfxStringItem( SID_PRINT_PAGES, sTmp ) ); else throw IllegalArgumentException(); } @@ -1503,20 +1502,17 @@ void SwXTextDocument::Invalidate() bObjectValid = sal_False; if(xNumFmtAgg.is()) { + const uno::Type& rTunnelType = ::getCppuType((Reference <XUnoTunnel>*)0); + Any aNumTunnel = xNumFmtAgg->queryAggregation(rTunnelType); + SvNumberFormatsSupplierObj* pNumFmt = 0; + Reference< XUnoTunnel > xNumTunnel; + if(aNumTunnel >>= xNumTunnel) { - const uno::Type& rTunnelType = ::getCppuType((Reference< XUnoTunnel > *)0); - Any aNumTunnel = xNumFmtAgg->queryAggregation(rTunnelType); - SvNumberFormatsSupplierObj* pNumFmt = 0; - if(aNumTunnel.getValueType() == rTunnelType) - { - Reference< XUnoTunnel > xNumTunnel = *(Reference< XUnoTunnel >*) - aNumTunnel.getValue(); - pNumFmt = (SvNumberFormatsSupplierObj*) - xNumTunnel->getSomething(SvNumberFormatsSupplierObj::getUnoTunnelId()); - pNumFmt->SetNumberFormatter(0); - } - DBG_ASSERT(pNumFmt, "No number formatter available"); + pNumFmt = (SvNumberFormatsSupplierObj*) + xNumTunnel->getSomething(SvNumberFormatsSupplierObj::getUnoTunnelId()); + pNumFmt->SetNumberFormatter(0); } + DBG_ASSERT(pNumFmt, "No number formatter available"); } InitNewDoc(); pDocShell = 0; @@ -1578,13 +1574,12 @@ void SwXTextDocument::InitNewDoc() if(xNumFmtAgg.is()) { - const uno::Type& rTunnelType = ::getCppuType((Reference< XUnoTunnel > *)0); + const uno::Type& rTunnelType = ::getCppuType((Reference <XUnoTunnel>*)0); Any aNumTunnel = xNumFmtAgg->queryAggregation(rTunnelType); SvNumberFormatsSupplierObj* pNumFmt = 0; - if(aNumTunnel.getValueType() == rTunnelType) + Reference< XUnoTunnel > xNumTunnel; + if(aNumTunnel >>= xNumTunnel) { - Reference< XUnoTunnel > xNumTunnel = *(Reference< XUnoTunnel >*) - aNumTunnel.getValue(); pNumFmt = (SvNumberFormatsSupplierObj*) xNumTunnel->getSomething(SvNumberFormatsSupplierObj::getUnoTunnelId()); @@ -2610,11 +2605,11 @@ Any SwXLinkNameAccessWrapper::getByName(const OUString& rName) else { aRet = xRealAccess->getByName(sParam.Copy(0, sParam.Len() - sSuffix.Len())); - Reference< XInterface > * pxInt = (Reference< XInterface > *)aRet.getValue(); - if(!pxInt) + Reference< XInterface > xInt; + if(!(aRet >>= xInt)) throw RuntimeException(); - Reference< XPropertySet > xProp((*pxInt), UNO_QUERY); - aRet.setValue(&xProp, ::getCppuType((Reference<XPropertySet>*)0)); + Reference< XPropertySet > xProp(xInt, UNO_QUERY); + aRet <<= xProp; bFound = sal_True; } } diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx index 62f3e64438..bfd3f152d7 100644 --- a/sw/source/ui/uno/unotxvw.cxx +++ b/sw/source/ui/uno/unotxvw.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unotxvw.cxx,v $ * - * $Revision: 1.23 $ + * $Revision: 1.24 $ * - * last change: $Author: os $ $Date: 2001-09-14 14:47:05 $ + * last change: $Author: os $ $Date: 2001-09-28 06:44:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -405,9 +405,9 @@ uno::Any SAL_CALL SwXTextView::queryInterface( const uno::Type& aType ) sal_Bool SwXTextView::select(const uno::Any& aInterface) throw( lang::IllegalArgumentException, uno::RuntimeException ) { ::vos::OGuard aGuard(Application::GetSolarMutex()); - if(GetView() && aInterface.getValueType().getTypeClass() == uno::TypeClass_INTERFACE) + Reference< uno::XInterface > xInterface; + if(GetView() && (aInterface >>= xInterface)) { - Reference< uno::XInterface > xInterface = *(Reference< uno::XInterface > *)aInterface.getValue(); SwWrtShell& rSh = GetView()->GetWrtShell(); SwDoc* pDoc = GetView()->GetDocShell()->GetDoc(); Reference< lang::XUnoTunnel > xIfcTunnel(xInterface, uno::UNO_QUERY); @@ -610,8 +610,7 @@ sal_Bool SwXTextView::select(const uno::Any& aInterface) throw( lang::IllegalArg { Reference< drawing::XShape > xShapeInt; uno::Any aAny = xShapeColl->getByIndex(i); - if ( aAny.getValueType() == ::getCppuType((Reference<drawing::XShape>*)0)) - xShapeInt = *((Reference< drawing::XShape > *) aAny.getValue()); + aAny >>= xShapeInt; if (xShapeInt.is()) { Reference< lang::XUnoTunnel> xShapeTunnel(xShapeInt, uno::UNO_QUERY); diff --git a/sw/source/ui/utlui/content.cxx b/sw/source/ui/utlui/content.cxx index 135ba9daf8..038bc5f123 100644 --- a/sw/source/ui/utlui/content.cxx +++ b/sw/source/ui/utlui/content.cxx @@ -2,9 +2,9 @@ * * $RCSfile: content.cxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: os $ $Date: 2001-07-26 06:09:42 $ + * last change: $Author: os $ $Date: 2001-09-28 06:39:30 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -2907,7 +2907,8 @@ void SwContentTree::EditEntry(SvLBoxEntry* pEntry, sal_uInt8 nMode) else if(xNameAccess.is()) { uno::Any aObj = xNameAccess->getByName(pCnt->GetName()); - uno::Reference< uno::XInterface > xTmp = *(uno::Reference< uno::XInterface > *)aObj.getValue(); + uno::Reference< uno::XInterface > xTmp; + aObj >>= xTmp; uno::Reference< container::XNamed > xNamed(xTmp, uno::UNO_QUERY); SwRenameXNamedDlg aDlg(this, xNamed, xNameAccess); if(xSecond.is()) @@ -3138,6 +3139,9 @@ void SwContentLBoxString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFl /*------------------------------------------------------------------------ $Log: not supported by cvs2svn $ + Revision 1.11 2001/07/26 06:09:42 os + #89714# prevent removing of current entry after drag and drop + Revision 1.10 2001/07/04 13:00:06 os #75450# restore scroll position diff --git a/sw/source/ui/utlui/uiitems.cxx b/sw/source/ui/utlui/uiitems.cxx index f18abb0fc7..881eaa0ca5 100644 --- a/sw/source/ui/utlui/uiitems.cxx +++ b/sw/source/ui/utlui/uiitems.cxx @@ -2,9 +2,9 @@ * * $RCSfile: uiitems.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: er $ $Date: 2001-05-13 03:33:17 $ + * last change: $Author: os $ $Date: 2001-09-28 06:39:30 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -334,10 +334,10 @@ BOOL SwUINumRuleItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const } BOOL SwUINumRuleItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) { - if(rVal.getValueType() == ::getCppuType((uno::Reference< container::XIndexReplace >*)0) ) + uno::Reference< container::XIndexReplace> xRulesRef; + if(rVal >>= xRulesRef) { - uno::Reference< container::XIndexReplace>* pxRulesRef = (uno::Reference< container::XIndexReplace>*)rVal.getValue(); - uno::Reference< lang::XUnoTunnel > xTunnel(*pxRulesRef, uno::UNO_QUERY); + uno::Reference< lang::XUnoTunnel > xTunnel(xRulesRef, uno::UNO_QUERY); SwXNumberingRules* pSwXRules = xTunnel.is() ? (SwXNumberingRules*) xTunnel->getSomething(SwXNumberingRules::getUnoTunnelId()) : 0; if(pSwXRules) diff --git a/sw/source/ui/utlui/unotools.cxx b/sw/source/ui/utlui/unotools.cxx index e5cdd69f67..269c2ae3a8 100644 --- a/sw/source/ui/utlui/unotools.cxx +++ b/sw/source/ui/utlui/unotools.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unotools.cxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: jp $ $Date: 2001-08-20 09:46:38 $ + * last change: $Author: os $ $Date: 2001-09-28 06:38:26 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -382,7 +382,8 @@ IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer ) // now get the model uno::Reference< beans::XPropertySet > xPrSet(_xControl, uno::UNO_QUERY); uno::Any aFrame = xPrSet->getPropertyValue(C2U("Frame")); - uno::Reference< frame::XFrame > xFrm = *(uno::Reference< frame::XFrame > *)aFrame.getValue(); + uno::Reference< frame::XFrame > xFrm; + aFrame >>= xFrm; _xController = xFrm->getController(); if(_xController.is()) { @@ -456,16 +457,16 @@ IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer ) uno::Reference< style::XStyleFamiliesSupplier > xSSupp( xDoc, uno::UNO_QUERY); uno::Reference< container::XNameAccess > xStyles = xSSupp->getStyleFamilies(); uno::Any aPFamily = xStyles->getByName( C2U("PageStyles" ) ); - uno::Reference< container::XNameContainer > xPFamily = - *(uno::Reference< container::XNameContainer > *)aPFamily.getValue(); - if( sPageStyle.getLength() ) + uno::Reference< container::XNameContainer > xPFamily; + if( (aPFamily >>= xPFamily) && sPageStyle.getLength() ) { uno::Any aPStyle = xPFamily->getByName( sPageStyle ); - uno::Reference< style::XStyle > xPStyle = - *(uno::Reference< style::XStyle > *)aPStyle.getValue(); + uno::Reference< style::XStyle > xPStyle; + aPStyle >>= xPStyle; uno::Reference< beans::XPropertySet > xPProp(xPStyle, uno::UNO_QUERY); uno::Any aSize = xPProp->getPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SIZE))); - awt::Size aPSize = *(awt::Size*)aSize.getValue(); + awt::Size aPSize; + aSize >>= aPSize; //TODO: set page width to card width aPSize.Width = 10000; aSize.setValue(&aPSize, ::getCppuType((awt::Size*)0)); diff --git a/sw/source/ui/wrtsh/wrtsh3.cxx b/sw/source/ui/wrtsh/wrtsh3.cxx index 3719cf5332..d5e621f585 100644 --- a/sw/source/ui/wrtsh/wrtsh3.cxx +++ b/sw/source/ui/wrtsh/wrtsh3.cxx @@ -2,9 +2,9 @@ * * $RCSfile: wrtsh3.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: th $ $Date: 2001-05-11 09:50:08 $ + * last change: $Author: os $ $Date: 2001-09-28 06:37:51 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -246,25 +246,23 @@ sal_Bool SwWrtShell::GetURLFromButton( String& rURL, String& rDescr ) const if(xInfo->hasPropertyByName( C2U("ButtonType") )) { aTmp = xPropSet->getPropertyValue( C2U("ButtonType") ); - if( eButtonType == *((form::FormButtonType*)aTmp.getValue())) + form::FormButtonType eTmpButtonType; + aTmp >>= eTmpButtonType; + if( eButtonType == eTmpButtonType) { // Label aTmp = xPropSet->getPropertyValue( C2U("Label") ); - - if( aTmp.getValueType() == ::getCppuType((OUString*)0)) + OUString uTmp; + if( (aTmp >>= uTmp) && uTmp.getLength()) { - OUString uTmp(*(OUString*)aTmp.getValue()); - if(uTmp.getLength()) - rDescr = String(uTmp); + rDescr = String(uTmp); } // util::URL aTmp = xPropSet->getPropertyValue( C2U("TargetURL") ); - if( aTmp.getValueType() == ::getCppuType((const OUString*)0)) + if( (aTmp >>= uTmp) && uTmp.getLength()) { - OUString uTmp(*(OUString*)aTmp.getValue()); - if(uTmp.getLength()) - rURL = String(uTmp); + rURL = String(uTmp); } bRet = sal_True; } @@ -329,6 +327,9 @@ sal_Bool SwWrtShell::SetURLToButton( const String& rURL, const String& rDescr ) /*------------------------------------------------------------------------- $Log: not supported by cvs2svn $ + Revision 1.2 2001/05/11 09:50:08 th + rtl-string-changes + Revision 1.1.1.1 2000/09/18 17:14:53 hr initial import |