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
commitb83943dbd42b67fa0914c5d8bfa351f6b72df75e (patch)
tree0fa31b76a83c724ec659aeadbaac5f4e8f56200b /sw
parentd3c001f6e069f93e1385fabd3c9fcd334ccb28dc (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 58e3cccc6f..9b86bc5c48 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;