summaryrefslogtreecommitdiff
path: root/sw/source/core/edit/edundo.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/edit/edundo.cxx')
-rw-r--r--sw/source/core/edit/edundo.cxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/sw/source/core/edit/edundo.cxx b/sw/source/core/edit/edundo.cxx
index 466db86bd93a..9ae0d641a3c2 100644
--- a/sw/source/core/edit/edundo.cxx
+++ b/sw/source/core/edit/edundo.cxx
@@ -238,10 +238,16 @@ void lcl_SelectSdrMarkList( SwEditShell* pShell,
if( pShell->ISA( SwFEShell ) )
{
SwFEShell* pFEShell = static_cast<SwFEShell*>( pShell );
+ bool bFirst = true;
for( sal_uInt16 i = 0; i < pSdrMarkList->GetMarkCount(); ++i )
- pFEShell->SelectObj( Point(),
- (i==0) ? 0 : SW_ADD_SELECT,
- pSdrMarkList->GetMark( i )->GetMarkedSdrObj() );
+ {
+ SdrObject *pObj = pSdrMarkList->GetMark( i )->GetMarkedSdrObj();
+ if( pObj )
+ {
+ pFEShell->SelectObj( Point(), bFirst ? 0 : SW_ADD_SELECT, pObj );
+ bFirst = false;
+ }
+ }
// the old implementation would always unselect
// objects, even if no new ones were selected. If this