Commits

Thomas Lange [tl]  committed a9f4cd6

cws tl77: #i111876# getting rid of problems causing assertions in Calc

  • Participants
  • Parent commits 75dbca7

Comments (0)

Files changed (6)

File editeng/inc/editeng/editobj.hxx

 
 	bool				operator==( const EditTextObject& rCompare ) const;
 
+    bool                EETextObjEqual( const EditTextObject& rCompare ) const;
+
     // #i102062#
     bool isWrongListEqual(const EditTextObject& rCompare) const;
 };

File editeng/source/editeng/editobj.cxx

 	return false;
 }
 
+
+bool ContentInfo::EETextObjEqual( const ContentInfo& rCompare ) const
+{
+    // similar to operator== but without comparing items
+    if( aText   == rCompare.aText && 
+        aStyle  == rCompare.aStyle  &&
+        eFamily == rCompare.eFamily )
+    {
+        return true;
+    }
+
+    return false;
+}
+    
+
 EditTextObject::EditTextObject( USHORT n)
 {
 	DBG_CTOR( EE_EditTextObject, 0 );
 	return static_cast< const BinTextObject* >( this )->operator==( static_cast< const BinTextObject& >( rCompare ) );
 }
 
+bool EditTextObject::EETextObjEqual( const EditTextObject& rCompare ) const
+{
+    return static_cast< const BinTextObject* >( this )->EETextObjEqual( static_cast< const BinTextObject& >( rCompare ) );
+}    
+
 // #i102062#
 bool EditTextObject::isWrongListEqual(const EditTextObject& rCompare) const
 {
 	return true;
 }
 
+
+bool BinTextObject::EETextObjEqual( const BinTextObject& rCompare ) const
+{
+    // similar to operator== but without comparing the itempool
+    if( this == &rCompare )
+        return true;
+
+    if( ( aContents.Count() != rCompare.aContents.Count() ) ||
+/*            ( pPool != rCompare.pPool ) || */
+            ( nMetric != rCompare.nMetric ) ||
+            ( nUserType!= rCompare.nUserType ) ||
+            ( nScriptType != rCompare.nScriptType ) ||
+            ( bVertical != rCompare.bVertical ) )
+        return false;
+
+    USHORT n;
+    for( n = 0; n < aContents.Count(); n++ )
+    {
+        if( !( aContents.GetObject( n )->EETextObjEqual( *rCompare.aContents.GetObject( n ) ) ) )
+            return false;
+    }
+
+    return true;
+}    
+
+
 // #i102062#
 bool BinTextObject::isWrongListEqual(const BinTextObject& rCompare) const
 {

File editeng/source/editeng/editobj2.hxx

 	void				SetWrongList( WrongList* p )	{ pWrongs = p; }
 	bool				operator==( const ContentInfo& rCompare ) const;
 
+    bool                EETextObjEqual( const ContentInfo& rCompare ) const;
+
     // #i102062#
     bool isWrongListEqual(const ContentInfo& rCompare) const;
 };
 
 	bool					operator==( const BinTextObject& rCompare ) const;
 
+    bool                    EETextObjEqual( const BinTextObject& rCompare ) const;
+
     // #i102062#
     bool isWrongListEqual(const BinTextObject& rCompare) const;
 

File sc/source/core/data/global.cxx

 		return TRUE;
 
 	if ( pObj1 && pObj2 )
-	{
-		//	first test for equal text content
-		USHORT nParCount = pObj1->GetParagraphCount();
-		if ( nParCount != pObj2->GetParagraphCount() )
-			return FALSE;
-		for (USHORT nPar=0; nPar<nParCount; nPar++)
-			if ( pObj1->GetText(nPar) != pObj2->GetText(nPar) )
-				return FALSE;
-
-		SvMemoryStream	aStream1;
-		SvMemoryStream	aStream2;
-		pObj1->Store( aStream1 );
-		pObj2->Store( aStream2 );
-		ULONG nSize = aStream1.Tell();
-		if ( aStream2.Tell() == nSize )
-			if ( !memcmp( aStream1.GetData(), aStream2.GetData(), (USHORT) nSize ) )
-				return TRUE;
-	}
+        return pObj1->EETextObjEqual( *pObj2 );
 
 	return FALSE;
 }

File sc/source/ui/pagedlg/tphfedit.cxx

 
 	pEdView->SetBackgroundColor( aBgColor );
 	pEdEngine->InsertView( pEdView );
+
+    SfxObjectShell*	pDocSh	= SfxObjectShell::Current();
+    ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > xModel(
+            pDocSh? pDocSh->GetModel() : NULL );
+    pEdEngine->SetUnoModel( xModel );
 }
 
 // -----------------------------------------------------------------------

File sd/source/filter/ppt/propread.cxx

     if (nSize > STRING_MAXLEN)
 		nSize = STRING_MAXLEN;
 
-	return nSize;
+	return static_cast< xub_StrLen >(nSize);
 }
 
 BOOL PropItem::Read( String& rString, sal_uInt32 nStringType, sal_Bool bAlign )