diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2009-10-01 10:29:37 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2009-10-01 10:29:37 +0000 |
commit | 0c81e79b10cfa6a27ae111501a9b0577bccd4374 (patch) | |
tree | 8c9edef91675e8cffab86921b92038f33b201656 /sw/source | |
parent | f207f7739573b94aff29697773c127747335af25 (diff) |
CWS-TOOLING: integrate CWS sw32bf04
2009-09-22 Michael Stahl galobj.hxx: do not export SgaObject methods (fixes wntmsci12 build)
2009-09-21 Michael Stahl #i105149# #i93308# svx: unofield.cxx: support field services with proper case
2009-09-21 Michael Stahl #i105149# #i102468# sc: servuno.cxx: support field services with proper case
2009-09-21 Michael Stahl #i105149# txtflde.cxx: support docinfo field services with proper case
2009-09-18 Michael Stahl #i105148# fmtatr2.cxx: SwFmtMeta::Clone(): avoid assert on clone pool default
2009-09-18 Michael Stahl #i105148# fmtatr2.cxx: SwFmtMeta::~SwFmtMeta(): check if m_pMeta != 0
2009-09-18 Michael Stahl #i105179# unocoll.cxx: SwXFrames::getByName(): add missing breaks
2009-09-18 Michael Stahl dbgoutsw.cxx: explicitly convert from SwNodeIndex to SwPosition
2009-09-18 Michael Stahl galobj.hxx: export class SgaObject from svxcore, needed by unogalitem.cxx
2009-09-17 Michael Stahl #i105149# txtflde.cxx: compare text field prefix case-insensitively
2009-09-16 Michael Stahl #i105117# docdde.cxx: fix possible NULL dereference (patch by cmc)
2009-09-16 Michael Stahl #i105124# docdde.cxx: fix use-after-free bug: make _FindItem member String
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/doc/dbgoutsw.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/doc/docdde.cxx | 31 | ||||
-rw-r--r-- | sw/source/core/txtnode/fmtatr2.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/unocore/unocoll.cxx | 4 |
4 files changed, 29 insertions, 15 deletions
diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx index 507b0adff1..fc9effe7cf 100644 --- a/sw/source/core/doc/dbgoutsw.cxx +++ b/sw/source/core/doc/dbgoutsw.cxx @@ -1084,9 +1084,9 @@ String lcl_dbg_out(const SwNodeRange & rRange) { String aStr("[", RTL_TEXTENCODING_ASCII_US); - aStr += lcl_dbg_out(rRange.aStart); + aStr += lcl_dbg_out(SwPosition(rRange.aStart)); aStr += String(", ", RTL_TEXTENCODING_ASCII_US); - aStr += lcl_dbg_out(rRange.aEnd); + aStr += lcl_dbg_out(SwPosition(rRange.aEnd)); aStr += String("]" , RTL_TEXTENCODING_ASCII_US); diff --git a/sw/source/core/doc/docdde.cxx b/sw/source/core/doc/docdde.cxx index 2454a26602..a6c6d2ab8a 100644 --- a/sw/source/core/doc/docdde.cxx +++ b/sw/source/core/doc/docdde.cxx @@ -70,11 +70,16 @@ namespace ppMark != rMarkAccess.getMarksEnd(); ppMark++) { - ::sw::mark::DdeBookmark* const pBkmk = dynamic_cast< ::sw::mark::DdeBookmark*>(ppMark->get()); - if(pBkmk && - (bCaseSensitive && (pBkmk->GetName() == sNameLc)) || - (!bCaseSensitive && GetAppCharClass().lower(pBkmk->GetName()) == String( sNameLc ))) - return pBkmk; + if (::sw::mark::DdeBookmark* const pBkmk = dynamic_cast< ::sw::mark::DdeBookmark*>(ppMark->get())) + { + if ( + (bCaseSensitive && (pBkmk->GetName() == sNameLc)) || + (!bCaseSensitive && GetAppCharClass().lower(pBkmk->GetName()) == String(sNameLc)) + ) + { + return pBkmk; + } + } } return NULL; } @@ -82,22 +87,25 @@ namespace struct _FindItem { - const String& rItem; + const String m_Item; SwTableNode* pTblNd; SwSectionNode* pSectNd; _FindItem(const String& rS) - : rItem(rS), pTblNd(0), pSectNd(0) + : m_Item(rS), pTblNd(0), pSectNd(0) {} }; BOOL lcl_FindSection( const SwSectionFmtPtr& rpSectFmt, void* pArgs, bool bCaseSensitive ) { + _FindItem * const pItem( static_cast<_FindItem*>(pArgs) ); SwSection* pSect = rpSectFmt->GetSection(); if( pSect ) { String sNm( bCaseSensitive ? pSect->GetName() : GetAppCharClass().lower( pSect->GetName() )); - String sCompare( bCaseSensitive ? ((_FindItem*)pArgs)->rItem : GetAppCharClass().lower( ((_FindItem*)pArgs)->rItem )); + String sCompare( (bCaseSensitive) + ? pItem->m_Item + : GetAppCharClass().lower( pItem->m_Item ) ); if( sNm == sCompare ) { // gefunden, als erfrage die Daten @@ -106,7 +114,7 @@ BOOL lcl_FindSection( const SwSectionFmtPtr& rpSectFmt, void* pArgs, bool bCaseS &rpSectFmt->GetDoc()->GetNodes() == &pIdx->GetNodes() ) { // eine Tabelle im normalen NodesArr - ((_FindItem*)pArgs)->pSectNd = pIdx->GetNode().GetSectionNode(); + pItem->pSectNd = pIdx->GetNode().GetSectionNode(); return FALSE; } //nein!! // sollte der Namen schon passen, der Rest aber nicht, dann haben wir @@ -128,8 +136,9 @@ BOOL lcl_FindSectionCaseInsensitive( const SwSectionFmtPtr& rpSectFmt, void* pAr BOOL lcl_FindTable( const SwFrmFmtPtr& rpTableFmt, void* pArgs ) { + _FindItem * const pItem( static_cast<_FindItem*>(pArgs) ); String sNm( GetAppCharClass().lower( rpTableFmt->GetName() )); - if( sNm.Equals( ((_FindItem*)pArgs)->rItem )) + if (sNm.Equals( pItem->m_Item )) { SwTable* pTmpTbl; SwTableBox* pFBox; @@ -139,7 +148,7 @@ BOOL lcl_FindTable( const SwFrmFmtPtr& rpTableFmt, void* pArgs ) &rpTableFmt->GetDoc()->GetNodes() == &pFBox->GetSttNd()->GetNodes() ) { // eine Tabelle im normalen NodesArr - ((_FindItem*)pArgs)->pTblNd = (SwTableNode*) + pItem->pTblNd = (SwTableNode*) pFBox->GetSttNd()->FindTableNode(); return FALSE; } diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx index ce346a8edc..3d0a043920 100644 --- a/sw/source/core/txtnode/fmtatr2.cxx +++ b/sw/source/core/txtnode/fmtatr2.cxx @@ -615,7 +615,7 @@ SwFmtMeta::SwFmtMeta( ::boost::shared_ptr< ::sw::Meta > const & i_pMeta, SwFmtMeta::~SwFmtMeta() { - if (m_pMeta->GetFmtMeta() == this) + if (m_pMeta && (m_pMeta->GetFmtMeta() == this)) { m_pMeta->SetFmtMeta(0); } @@ -631,7 +631,8 @@ int SwFmtMeta::operator==( const SfxPoolItem & i_rOther ) const SfxPoolItem * SwFmtMeta::Clone( SfxItemPool * /*pPool*/ ) const { // if this is indeed a copy, then DoCopy must be called later! - return new SwFmtMeta( m_pMeta, Which() ); + return (m_pMeta) // #i105148# pool default may be cloned also! + ? new SwFmtMeta( m_pMeta, Which() ) : new SwFmtMeta( Which() ); } void SwFmtMeta::SetTxtAttr(SwTxtMeta * const i_pTxtAttr) diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index e4f7138e06..06bbca43e0 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -1027,6 +1027,7 @@ uno::Any SwXFrames::getByIndex(sal_Int32 nIndex) throw IndexOutOfBoundsException(); return lcl_UnoWrapFrame(pFmt, eType); } + uno::Any SwXFrames::getByName(const OUString& rName) throw(NoSuchElementException, WrappedTargetException, uno::RuntimeException ) { @@ -1038,10 +1039,13 @@ uno::Any SwXFrames::getByName(const OUString& rName) { case FLYCNTTYPE_GRF: pFmt = GetDoc()->FindFlyByName(rName, ND_GRFNODE); + break; case FLYCNTTYPE_OLE: pFmt = GetDoc()->FindFlyByName(rName, ND_OLENODE); + break; default: pFmt = GetDoc()->FindFlyByName(rName, ND_TEXTNODE); + break; } if(!pFmt) throw NoSuchElementException(); |