summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-07-31 12:07:51 +0200
committerStephan Bergmann <sbergman@redhat.com>2013-07-31 12:08:06 +0200
commit8434c577ae2b45d70baff4ba0a00048bc0f10e6a (patch)
tree2cf3d98b0c9e5f0a761c7259bfe234a8668a0752 /sw
parent734295ee6081686b62a4521dacf4975240e1109e (diff)
Work around MSVC "may be uninitialized" warnings
Change-Id: Ibac83d2d97f178605f717fc675853d86101195e3
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/doc/visiturl.cxx48
1 files changed, 26 insertions, 22 deletions
diff --git a/sw/source/core/doc/visiturl.cxx b/sw/source/core/doc/visiturl.cxx
index 74e571690b86..78f51e9936e9 100644
--- a/sw/source/core/doc/visiturl.cxx
+++ b/sw/source/core/doc/visiturl.cxx
@@ -56,32 +56,36 @@ void SwURLStateChanged::Notify( SfxBroadcaster& , const SfxHint& rHint )
(sBkmk = pIURL->GetMark()).Insert( INET_MARK_TOKEN, 0 );
bool bAction = false, bUnLockView = false;
- const SwFmtINetFmt* pItem;
- const SwTxtINetFmt* pTxtAttr;
- const SwTxtNode* pTxtNd;
- sal_uInt32 n, nMaxItems = pDoc->GetAttrPool().GetItemCount2( RES_TXTATR_INETFMT );
- for( n = 0; n < nMaxItems; ++n )
- if( 0 != (pItem = (SwFmtINetFmt*)pDoc->GetAttrPool().GetItem2(
- RES_TXTATR_INETFMT, n ) ) &&
- ( pItem->GetValue() == sURL ||
- ( sBkmk.Len() && pItem->GetValue() == sBkmk )) &&
- 0 != ( pTxtAttr = pItem->GetTxtINetFmt()) &&
- 0 != ( pTxtNd = pTxtAttr->GetpTxtNode() ) )
+ sal_uInt32 nMaxItems = pDoc->GetAttrPool().GetItemCount2( RES_TXTATR_INETFMT );
+ for( sal_uInt32 n = 0; n < nMaxItems; ++n )
+ {
+ const SwFmtINetFmt* pItem = (SwFmtINetFmt*)pDoc->GetAttrPool().GetItem2(RES_TXTATR_INETFMT, n );
+ if( pItem != 0 &&
+ ( pItem->GetValue() == sURL || ( sBkmk.Len() && pItem->GetValue() == sBkmk )))
{
- if( !bAction && pESh )
+ const SwTxtINetFmt* pTxtAttr = pItem->GetTxtINetFmt();
+ if (pTxtAttr != 0)
{
- pESh->StartAllAction();
- bAction = true;
- bUnLockView = !pESh->IsViewLocked();
- pESh->LockView( sal_True );
+ const SwTxtNode* pTxtNd = pTxtAttr->GetpTxtNode();
+ if (pTxtNd != 0)
+ {
+ if( !bAction && pESh )
+ {
+ pESh->StartAllAction();
+ bAction = true;
+ bUnLockView = !pESh->IsViewLocked();
+ pESh->LockView( sal_True );
+ }
+ const_cast<SwTxtINetFmt*>(pTxtAttr)->SetVisitedValid( false );
+ const SwTxtAttr* pAttr = pTxtAttr;
+ SwUpdateAttr aUpdateAttr( *pAttr->GetStart(),
+ *pAttr->GetEnd(),
+ RES_FMT_CHG );
+ ((SwTxtNode*)pTxtNd)->ModifyNotification( &aUpdateAttr, &aUpdateAttr );
+ }
}
- const_cast<SwTxtINetFmt*>(pTxtAttr)->SetVisitedValid( false );
- const SwTxtAttr* pAttr = pTxtAttr;
- SwUpdateAttr aUpdateAttr( *pAttr->GetStart(),
- *pAttr->GetEnd(),
- RES_FMT_CHG );
- ((SwTxtNode*)pTxtNd)->ModifyNotification( &aUpdateAttr, &aUpdateAttr );
}
+ }
if( bAction )
pESh->EndAllAction();