diff options
author | Oliver Specht <os@openoffice.org> | 2000-11-15 14:00:49 +0000 |
---|---|---|
committer | Oliver Specht <os@openoffice.org> | 2000-11-15 14:00:49 +0000 |
commit | 6cc4a943b2ebc590e4f6e0ef3aed0895d404f030 (patch) | |
tree | 007c34ef561527215f0fee0fae80655331f748c4 /sw/source/core | |
parent | 0fdecb565f8ddc16781d0483dfc1f8f6f7f45232 (diff) |
chg: use optimized SfxItemPropertySet::get/setPropertyValue - methods
Diffstat (limited to 'sw/source/core')
-rw-r--r-- | sw/source/core/unocore/unodraw.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/unocore/unoframe.cxx | 19 | ||||
-rw-r--r-- | sw/source/core/unocore/unoidx.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/unocore/unoobj.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/unocore/unoprnms.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/unocore/unosect.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/unocore/unosett.cxx | 18 | ||||
-rw-r--r-- | sw/source/core/unocore/unostyle.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/unocore/unotbl.cxx | 28 |
9 files changed, 71 insertions, 41 deletions
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index f06fe5d18b90..54d9e3cc7788 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unodraw.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: os $ $Date: 2000-11-02 09:44:01 $ + * last change: $Author: os $ $Date: 2000-11-15 15:00:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -879,7 +879,7 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a } else { - aPropSet.setPropertyValue(rPropertyName, aValue, aSet); + aPropSet.setPropertyValue(*pMap, aValue, aSet); pFmt->SetAttr(aSet); } } @@ -952,7 +952,7 @@ uno::Any SwXShape::getPropertyValue(const OUString& rPropertyName) if(pFmt) { const SwAttrSet& rSet = pFmt->GetAttrSet(); - aRet = aPropSet.getPropertyValue(rPropertyName, rSet); + aRet = aPropSet.getPropertyValue(*pMap, rSet); } else { diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 819231891244..42953c1d68c3 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unoframe.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: os $ $Date: 2000-11-08 14:56:39 $ + * last change: $Author: os $ $Date: 2000-11-15 15:00:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1034,6 +1034,8 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const uno::Any& a { sal_Bool bNextFrame = sal_False; const SfxItemPropertyMap* pCur = SfxItemPropertyMap::GetByName(_pMap, rPropertyName); + if(!pCur) + throw UnknownPropertyException(); SwDoc* pDoc = pFmt->GetDoc(); if( eType == FLYCNTTYPE_GRF && (COMPARE_EQUAL == rPropertyName.compareToAscii(UNO_NAME_ALTERNATIVE_TEXT)|| @@ -1081,7 +1083,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const uno::Any& a else { SfxItemSet aSet(pNoTxt->GetSwAttrSet()); - aPropSet.setPropertyValue(rPropertyName, aValue, aSet); + aPropSet.setPropertyValue(*pCur, aValue, aSet); pNoTxt->SetAttr(aSet); } } @@ -1178,7 +1180,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const uno::Any& a RES_FRMATR_BEGIN, RES_FRMATR_END - 1 ); aSet.SetParent(&pFmt->GetAttrSet()); - aPropSet.setPropertyValue(rPropertyName, aValue, aSet); + aPropSet.setPropertyValue(*pCur, aValue, aSet); if(COMPARE_EQUAL == rPropertyName.compareToAscii(UNO_NAME_ANCHOR_TYPE)) pFmt->GetDoc()->SetFlyFrmAttr( *pFmt, aSet ); else @@ -1216,6 +1218,8 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) else if(pFmt) { const SfxItemPropertyMap* pCur = SfxItemPropertyMap::GetByName(_pMap, rPropertyName); + if(!pCur) + throw UnknownPropertyException(); if(eType == FLYCNTTYPE_GRF && pCur && (pCur->nWID == RES_GRFATR_CROPGRF || @@ -1252,7 +1256,7 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) else { SfxItemSet aSet(pNoTxt->GetSwAttrSet()); - aAny = aPropSet.getPropertyValue(rPropertyName, aSet); + aAny = aPropSet.getPropertyValue(*pCur, aSet); } } } @@ -1298,7 +1302,7 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) else { const SwAttrSet& rSet = pFmt->GetAttrSet(); - aAny = aPropSet.getPropertyValue(rPropertyName, rSet); + aAny = aPropSet.getPropertyValue(*pCur, rSet); } } else if(IsDescriptor()) @@ -2636,6 +2640,9 @@ sal_uInt16 SwXOLEListener::FindEntry( const EventObject& rEvent,SwOLENode** ppNd /*------------------------------------------------------------------------ $Log: not supported by cvs2svn $ + Revision 1.7 2000/11/08 14:56:39 os + #80121# createTextCursor in frames: skip tables + Revision 1.6 2000/10/27 13:52:45 mib #79648#: Conversion to twip for crop property diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index 927a00913b28..1e481abf0ae1 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unoidx.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: os $ $Date: 2000-11-10 10:18:36 $ + * last change: $Author: os $ $Date: 2000-11-15 15:00:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -616,7 +616,7 @@ void SwXDocumentIndex::setPropertyValue(const OUString& rPropertyName, SfxItemPropertySet aPropSet(_pMap); const SwAttrSet& rSet = m_pDoc->GetTOXBaseAttrSet(*pTOXBase); pAttrSet = new SfxItemSet(rSet); - aPropSet.setPropertyValue(rPropertyName, aValue, *pAttrSet); + aPropSet.setPropertyValue(*pMap, aValue, *pAttrSet); const SwSectionFmts& rSects = m_pDoc->GetSections(); const SwSectionFmt* pOwnFmt = GetFmt(); @@ -897,7 +897,7 @@ uno::Any SwXDocumentIndex::getPropertyValue(const OUString& rPropertyName) { SfxItemPropertySet aPropSet(_pMap); const SwAttrSet& rSet = m_pDoc->GetTOXBaseAttrSet(*pTOXBase); - aRet = aPropSet.getPropertyValue(rPropertyName, rSet); + aRet = aPropSet.getPropertyValue(*pMap, rSet); } } if(bBOOL) diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index 1190763de028..8855be5e90cd 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unoobj.cxx,v $ * - * $Revision: 1.21 $ + * $Revision: 1.22 $ * - * last change: $Author: os $ $Date: 2000-11-09 10:59:02 $ + * last change: $Author: os $ $Date: 2000-11-15 15:00:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -2592,7 +2592,7 @@ Any SwXTextCursor::GetPropertyValue( PropertyState eTemp; bDone = lcl_getCrsrPropertyValue(pMap, rPaM, aSet, aAny, eTemp ); if(!bDone) - aAny = rPropSet.getPropertyValue(aPropertyName, aSet); + aAny = rPropSet.getPropertyValue(*pMap, aSet); } else throw UnknownPropertyException(); @@ -2620,7 +2620,7 @@ void SwXTextCursor::SetPropertyValue( BOOL bDef = FALSE; BOOL bPut; if(!lcl_setCrsrPropertyValue(pMap, rPaM, rSet, aValue, bPut )) - rPropSet.setPropertyValue(rPropertyName, aValue, rSet); + rPropSet.setPropertyValue(*pMap, aValue, rSet); if(bPut) SwXTextCursor::SetCrsrAttr(rPaM, rSet); } @@ -4633,7 +4633,7 @@ uno::Any SwXParagraph::getPropertyValue(const OUString& rPropertyName) PropertyState eTemp; bDone = lcl_getCrsrPropertyValue(pMap, *pUnoCrsr, rAttrSet, aAny, eTemp ); if(!bDone) - aAny = aPropSet.getPropertyValue(aPropertyName, rAttrSet); + aAny = aPropSet.getPropertyValue(*pMap, rAttrSet); } else throw UnknownPropertyException(); diff --git a/sw/source/core/unocore/unoprnms.cxx b/sw/source/core/unocore/unoprnms.cxx index df2a4be209a1..7b05947564a6 100644 --- a/sw/source/core/unocore/unoprnms.cxx +++ b/sw/source/core/unocore/unoprnms.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unoprnms.cxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.15 $ * - * last change: $Author: os $ $Date: 2000-11-09 14:13:20 $ + * last change: $Author: os $ $Date: 2000-11-15 15:00:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -310,6 +310,7 @@ const SwPropNameLen __FAR_DATA UNO_NAME_CHAR_CONTOURED const SwPropNameLen __FAR_DATA UNO_NAME_CONTOUR_OUTSIDE (MAP_CHAR_LEN("ContourOutside")); const SwPropNameLen __FAR_DATA UNO_NAME_CONTENT_PROTECTED (MAP_CHAR_LEN("ContentProtected")); const SwPropNameLen __FAR_DATA UNO_NAME_COUNT_EMPTY_LINES (MAP_CHAR_LEN("CountEmptyLines")); +const SwPropNameLen __FAR_DATA UNO_NAME_RESTART_AT_EACH_PAGE (MAP_CHAR_LEN("RestartAtEachPage")); const SwPropNameLen __FAR_DATA UNO_NAME_DATA_BASE_NAME (MAP_CHAR_LEN("DataBaseName")); const SwPropNameLen __FAR_DATA UNO_NAME_DATA_TABLE_NAME (MAP_CHAR_LEN("DataTableName")); const SwPropNameLen __FAR_DATA UNO_NAME_DATA_COLUMN_NAME (MAP_CHAR_LEN("DataColumnName")); diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx index 34c22d8f210d..5a5d290c7487 100644 --- a/sw/source/core/unocore/unosect.cxx +++ b/sw/source/core/unocore/unosect.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unosect.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: os $ $Date: 2000-11-08 12:42:49 $ + * last change: $Author: os $ $Date: 2000-11-15 15:00:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -543,7 +543,7 @@ void SwXTextSection::setPropertyValue( pNewAttrSet = new SfxItemSet(*rOldAttrSet.GetPool(), pMap->nWID, pMap->nWID, 0); pNewAttrSet->Put(rOldAttrSet); - aPropSet.setPropertyValue(rPropertyName, aValue, *pNewAttrSet); + aPropSet.setPropertyValue(*pMap, aValue, *pNewAttrSet); } else { @@ -681,7 +681,7 @@ uno::Any SwXTextSection::getPropertyValue(const OUString& rPropertyName) break; default: if(pFmt) - aRet = aPropSet.getPropertyValue(rPropertyName, pFmt->GetAttrSet()); + aRet = aPropSet.getPropertyValue(*pMap, pFmt->GetAttrSet()); else { const SfxPoolItem* pQueryItem = 0; diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx index fc268132a967..b6c3dfd5dd57 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unosett.cxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: mib $ $Date: 2000-10-31 08:53:34 $ + * last change: $Author: os $ $Date: 2000-11-15 15:00:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -291,6 +291,7 @@ const SfxItemPropertyMap* GetNumberingRulesMap() //#define WID_CHARACTER_STYLE 7 #define WID_COUNT_EMPTY_LINES 8 #define WID_COUNT_LINES_IN_FRAMES 9 +#define WID_RESTART_AT_EACH_PAGE 10 const SfxItemPropertyMap* GetLineNumberingMap() { @@ -305,6 +306,7 @@ const SfxItemPropertyMap* GetLineNumberingMap() { SW_PROP_NAME(UNO_NAME_NUMBER_POSITION), WID_NUMBER_POSITION, &::getCppuType((const sal_Int16*)0),PROPERTY_NONE, 0}, { SW_PROP_NAME(UNO_NAME_NUMBERING_TYPE), WID_NUMBERING_TYPE , &::getCppuType((const sal_Int16*)0),PROPERTY_NONE, 0}, { SW_PROP_NAME(UNO_NAME_ON), WID_NUM_ON, &::getBooleanCppuType() , PROPERTY_NONE, 0}, + { SW_PROP_NAME(UNO_NAME_RESTART_AT_EACH_PAGE), WID_RESTART_AT_EACH_PAGE, &::getBooleanCppuType() , PROPERTY_NONE, 0}, { SW_PROP_NAME(UNO_NAME_SEPARATOR_LINE_DISTANCE), WID_SEPARATOR_LINE_DISTANCE, &::getCppuType((const sal_Int16*)0),PROPERTY_NONE, 0}, {0,0,0,0} }; @@ -1133,6 +1135,12 @@ void SwXLineNumberingProperties::setPropertyValue( aInfo.SetCountInFlys(bVal); } break; + case WID_RESTART_AT_EACH_PAGE : + { + sal_Bool bVal = *(sal_Bool*)aValue.getValue(); + aInfo.SetRestartEachPage(bVal); + } + break; } pDoc->SetLineNumberInfo(aInfo); } @@ -1221,6 +1229,12 @@ Any SwXLineNumberingProperties::getPropertyValue(const OUString& rPropertyName) aRet.setValue(&bTemp, ::getCppuBooleanType()); } break; + case WID_RESTART_AT_EACH_PAGE : + { + sal_Bool bTemp = rInfo.IsRestartEachPage(); + aRet.setValue(&bTemp, ::getCppuBooleanType()); + } + break; } } else diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 7333cb5ffb15..6a79e95effa3 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unostyle.cxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: mib $ $Date: 2000-11-15 14:11:07 $ + * last change: $Author: os $ $Date: 2000-11-15 15:00:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1777,7 +1777,7 @@ put_itemset: SfxItemSet& rStyleSet = aBase.GetItemSet(); SfxItemSet aSet(*rStyleSet.GetPool(), pMap->nWID, pMap->nWID); aSet.Put(rStyleSet); - aPropSet.setPropertyValue(rPropertyName, aValue, aSet); + aPropSet.setPropertyValue(*pMap, aValue, aSet); aBase.SetItemSet(aSet); } @@ -1928,7 +1928,7 @@ Any SwXStyle::getPropertyValue(const OUString& rPropertyName) query_itemset: { SfxItemSet& rSet = aStyle.GetItemSet(); - aRet = aPropSet.getPropertyValue(rPropertyName, rSet); + aRet = aPropSet.getPropertyValue(*pMap, rSet); } } } diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index 39cb16655658..b7390d912e13 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unotbl.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: os $ $Date: 2000-11-02 12:11:49 $ + * last change: $Author: os $ $Date: 2000-11-15 15:00:49 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1251,7 +1251,7 @@ void SwXTextTableRow::setPropertyValue(const OUString& rPropertyName, { SwFrmFmt* pLnFmt = pLn->ClaimFrmFmt(); SwAttrSet aSet(pLnFmt->GetAttrSet()); - aPropSet.setPropertyValue(rPropertyName, aValue, aSet); + aPropSet.setPropertyValue(*pMap, aValue, aSet); pDoc->SetAttr(aSet, *pLnFmt); } } @@ -1299,7 +1299,7 @@ uno::Any SwXTextTableRow::getPropertyValue(const OUString& rPropertyName) throw( default: { const SwAttrSet& rSet = pLn->GetFrmFmt()->GetAttrSet(); - aRet = aPropSet.getPropertyValue(rPropertyName, rSet); + aRet = aPropSet.getPropertyValue(*pMap, rSet); } } } @@ -1686,11 +1686,13 @@ void SwXTextTableCursor::setPropertyValue(const OUString& rPropertyName, RES_UNKNOWNATR_CONTAINER, RES_UNKNOWNATR_CONTAINER, 0L); SwXTextCursor::GetCrsrAttr(pTblCrsr->GetSelRing(), rSet); - aPropSet.setPropertyValue(rPropertyName, aValue, rSet); + aPropSet.setPropertyValue(*pMap, aValue, rSet); SwXTextCursor::SetCrsrAttr(pTblCrsr->GetSelRing(), rSet, sal_True); } } } + else + throw UnknownPropertyException(); } } /*-- 11.12.98 12:16:17--------------------------------------------------- @@ -1744,10 +1746,12 @@ uno::Any SwXTextTableCursor::getPropertyValue(const OUString& rPropertyName) 0L); // erstmal die Attribute des Cursors SwXTextCursor::GetCrsrAttr(pTblCrsr->GetSelRing(), aSet); - aRet = aPropSet.getPropertyValue(rPropertyName, aSet); + aRet = aPropSet.getPropertyValue(*pMap, aSet); } } } + else + throw UnknownPropertyException(); } return aRet; } @@ -3002,7 +3006,7 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName, default: { SwAttrSet aSet(pFmt->GetAttrSet()); - aPropSet.setPropertyValue(rPropertyName, aValue, aSet); + aPropSet.setPropertyValue(*pMap, aValue, aSet); pFmt->GetDoc()->SetAttr(aSet, *pFmt); } } @@ -3125,7 +3129,7 @@ uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName) throw( be default: { const SwAttrSet& rSet = pFmt->GetAttrSet(); - aRet = aPropSet.getPropertyValue(rPropertyName, rSet); + aRet = aPropSet.getPropertyValue(*pMap, rSet); } } } @@ -3625,11 +3629,13 @@ void SwXCellRange::setPropertyValue(const OUString& rPropertyName, 0L); SwUnoTableCrsr* pCrsr = *pTblCrsr; SwXTextCursor::GetCrsrAttr(pCrsr->GetSelRing(), rSet); - aPropSet.setPropertyValue(rPropertyName, aValue, rSet); + aPropSet.setPropertyValue(*pMap, aValue, rSet); SwXTextCursor::SetCrsrAttr(pCrsr->GetSelRing(), rSet, sal_True); } } } + else + throw UnknownPropertyException(); } } /*-- 11.12.98 14:27:35--------------------------------------------------- @@ -3689,10 +3695,12 @@ uno::Any SwXCellRange::getPropertyValue(const OUString& rPropertyName) throw( be // erstmal die Attribute des Cursors SwUnoTableCrsr* pCrsr = *pTblCrsr; SwXTextCursor::GetCrsrAttr(pCrsr->GetSelRing(), aSet); - aRet = aPropSet.getPropertyValue(rPropertyName, aSet); + aRet = aPropSet.getPropertyValue(*pMap, aSet); } } } + else + throw UnknownPropertyException(); } return aRet; } |