Commits

Anonymous committed 1e9853c

accfixes2: Avoid assertion on SetAccessibleName by setting empty first

Comments (0)

Files changed (2)

sfx2/source/view/viewfrm2.cxx

     // Is GetFrame correct???
     Window* pWindow = GetFrame().GetTopWindow_Impl();
     if ( pWindow)
+    {
+        pWindow->SetAccessibleName( String() );	// otherwise getting assertion when changing accessible name
         pWindow->SetAccessibleName( aTitle );
+    }
     //-----IAccessibility2 implementation 2009
 	return aTitle;
 }

vcl/source/window/window.cxx

 
     DBG_ASSERT( !mpWindowImpl->mpAccessibleInfos->pAccessibleName || !rName.Len(), "AccessibleName already set!" );
     delete mpWindowImpl->mpAccessibleInfos->pAccessibleName;
-    mpWindowImpl->mpAccessibleInfos->pAccessibleName = new String( GetNonMnemonicString(rName) );
+	mpWindowImpl->mpAccessibleInfos->pAccessibleName = NULL;
+	if ( rName.Len() )
+		mpWindowImpl->mpAccessibleInfos->pAccessibleName = new String( GetNonMnemonicString(rName) );
 }
 
 String Window::GetAccessibleName() const