summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mst@openoffice.org>2010-01-13 13:03:53 +0100
committerMichael Stahl <mst@openoffice.org>2010-01-13 13:03:53 +0100
commitb7ecc322a4e36a8882cbf107186ac46c55a4950b (patch)
tree0419859c8669345bf860ee58bc92dac655257567 /sw
parentc3436b84cde501fee0f8ddde012f5c81d20a1760 (diff)
#i107826#: apply patch from cmc
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/doc/doccomp.cxx52
1 files changed, 40 insertions, 12 deletions
diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx
index 047b5b2dc582..6b32eebc35ce 100644
--- a/sw/source/core/doc/doccomp.cxx
+++ b/sw/source/core/doc/doccomp.cxx
@@ -969,6 +969,29 @@ BOOL SwCompareLine::Compare( const CompareLine& rLine ) const
return CompareNode( rNode, ((SwCompareLine&)rLine).rNode );
}
+namespace
+{
+ static String SimpleTableToText(const SwNode &rNode)
+ {
+ String sRet;
+ const SwNode* pEndNd = rNode.EndOfSectionNode();
+ SwNodeIndex aIdx( rNode );
+ while (&aIdx.GetNode() != pEndNd)
+ {
+ if (aIdx.GetNode().IsTxtNode())
+ {
+ if (sRet.Len())
+ {
+ sRet.Append( '\n' );
+ }
+ sRet.Append( aIdx.GetNode().GetTxtNode()->GetExpandTxt() );
+ }
+ aIdx++;
+ }
+ return sRet;
+ }
+}
+
BOOL SwCompareLine::CompareNode( const SwNode& rDstNd, const SwNode& rSrcNd )
{
if( rSrcNd.GetNodeType() != rDstNd.GetNodeType() )
@@ -989,6 +1012,13 @@ BOOL SwCompareLine::CompareNode( const SwNode& rDstNd, const SwNode& rSrcNd )
bRet = ( rTSrcNd.EndOfSectionIndex() - rTSrcNd.GetIndex() ) ==
( rTDstNd.EndOfSectionIndex() - rTDstNd.GetIndex() );
+
+ // --> #i107826#: compare actual table content
+ if (bRet)
+ {
+ bRet = (SimpleTableToText(rSrcNd) == SimpleTableToText(rDstNd));
+ }
+ // <--
}
break;
@@ -1043,6 +1073,15 @@ BOOL SwCompareLine::CompareNode( const SwNode& rDstNd, const SwNode& rSrcNd )
case ND_ENDNODE:
bRet = rSrcNd.StartOfSectionNode()->GetNodeType() ==
rDstNd.StartOfSectionNode()->GetNodeType();
+
+ // --> #i107826#: compare actual table content
+ if (bRet && rSrcNd.StartOfSectionNode()->GetNodeType() == ND_TABLENODE)
+ {
+ bRet = CompareNode(
+ *rSrcNd.StartOfSectionNode(), *rDstNd.StartOfSectionNode());
+ }
+ // <--
+
break;
}
return bRet;
@@ -1059,18 +1098,7 @@ String SwCompareLine::GetText() const
case ND_TABLENODE:
{
- const SwNode* pEndNd = rNode.EndOfSectionNode();
- SwNodeIndex aIdx( rNode );
- while( &aIdx.GetNode() != pEndNd )
- {
- if( aIdx.GetNode().IsTxtNode() )
- {
- if( sRet.Len() )
- sRet.Append( '\n' );
- sRet.Append( ((SwTxtNode&)rNode).GetExpandTxt() );
- }
- aIdx++;
- }
+ sRet = SimpleTableToText(rNode);
sRet.InsertAscii( "Tabelle: ", 0 );
}
break;