summaryrefslogtreecommitdiff
path: root/sw/inc
diff options
context:
space:
mode:
authorAdam Co <rattles2013@gmail.com>2014-02-03 17:44:22 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-02-11 14:18:34 +0000
commitd688069023959ab97d14eb1dbfd5bf6ad3c1b160 (patch)
tree18eec4c66e6e5a2177a5b008ae8ebf64688993cb /sw/inc
parent6cab3069caf9fd5c1ce938d2891e14e6eec7850b (diff)
Add support for 'Table Row Redlines' in SW core
This patch adds support for 'Table Row Redlines' (such as 'table row inserted' or 'table row deleted' in SW core). This is done by adding a new object called 'SwExtraRedlineTbl' that holds all the redlines that are not of type 'SwRangedRedline'. Also this patch adds a function for adding these types of redlines to the 'SwExtraRedlineTbl' object. It also further develops the 'SwTableRowRedline' object. Change-Id: Ic285f33e4f5af8f197d8fc24c2a8a3777755afad Reviewed-on: https://gerrit.libreoffice.org/7821 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/inc')
-rw-r--r--sw/inc/IDocumentRedlineAccess.hxx9
-rw-r--r--sw/inc/doc.hxx8
-rw-r--r--sw/inc/redline.hxx19
3 files changed, 31 insertions, 5 deletions
diff --git a/sw/inc/IDocumentRedlineAccess.hxx b/sw/inc/IDocumentRedlineAccess.hxx
index 8125717feb5e..144eb4a4b131 100644
--- a/sw/inc/IDocumentRedlineAccess.hxx
+++ b/sw/inc/IDocumentRedlineAccess.hxx
@@ -28,7 +28,9 @@
#include <com/sun/star/uno/Sequence.hxx>
class SwRangeRedline;
+ class SwTableRowRedline;
class SwRedlineTbl;
+ class SwExtraRedlineTbl;
class SwPaM;
struct SwPosition;
class SwStartNode;
@@ -64,7 +66,9 @@ namespace nsRedlineType_t
const RedlineType_t REDLINE_FORMAT = 0x2;// Attributes have been applied.
const RedlineType_t REDLINE_TABLE = 0x3;// Table structure has been altered.
const RedlineType_t REDLINE_FMTCOLL = 0x4;// Style has been altered (Autoformat!).
- const RedlineType_t REDLINE_PARAGRAPH_FORMAT = 0x5;// Paragraph attributes have been changed
+ const RedlineType_t REDLINE_PARAGRAPH_FORMAT = 0x5;// Paragraph attributes have been changed.
+ const RedlineType_t REDLINE_TABLE_ROW_INSERT = 0x6;// Table row has been inserted.
+ const RedlineType_t REDLINE_TABLE_ROW_DELETE = 0x7;// Table row has been deleted.
// When larger than 128, flags can be inserted.
const RedlineType_t REDLINE_NO_FLAG_MASK = 0x7F;
@@ -126,6 +130,7 @@ public:
virtual bool IsIgnoreRedline() const = 0;
virtual const SwRedlineTbl& GetRedlineTbl() const = 0;
+ virtual const SwExtraRedlineTbl& GetExtraRedlineTbl() const = 0;
virtual bool IsInRedlines(const SwNode& rNode) const = 0;
@@ -143,6 +148,8 @@ public:
*/
virtual bool AppendRedline(/*[in]*/SwRangeRedline* pPtr, /*[in]*/bool bCallDelete) = 0;
+ virtual bool AppendTableRowRedline(/*[in]*/SwTableRowRedline* pPtr, /*[in]*/bool bCallDelete) = 0;
+
virtual bool SplitRedline(/*[in]*/const SwPaM& rPam) = 0;
virtual bool DeleteRedline(
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 2450a811f620..10159a1cf424 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -144,6 +144,7 @@ class SwPageDesc;
class SwPagePreviewPrtData;
class SwRangeRedline;
class SwRedlineTbl;
+class SwExtraRedlineTbl;
class SwRootFrm;
class SwRubyList;
class SwRubyListEntry;
@@ -356,8 +357,9 @@ class SW_DLLPUBLIC SwDoc :
/// relation between list style and its default list
tHashMapForLists maListStyleLists;
- SwRedlineTbl *mpRedlineTbl; ///< List of all Redlines.
- OUString *mpAutoFmtRedlnComment; ///< Comment for Redlines inserted via AutoFormat.
+ SwRedlineTbl *mpRedlineTbl; ///< List of all Ranged Redlines.
+ SwExtraRedlineTbl *mpExtraRedlineTbl; ///< List of all Extra Redlines.
+ OUString *mpAutoFmtRedlnComment; ///< Comment for Redlines inserted via AutoFormat.
SwUnoCrsrTbl *mpUnoCrsrTbl;
@@ -767,7 +769,9 @@ public:
virtual bool IsIgnoreRedline() const;
virtual bool IsInRedlines(const SwNode& rNode) const;
virtual const SwRedlineTbl& GetRedlineTbl() const;
+ virtual const SwExtraRedlineTbl& GetExtraRedlineTbl() const;
virtual bool AppendRedline(/*[in]*/SwRangeRedline* pPtr, /*[in]*/bool bCallDelete);
+ virtual bool AppendTableRowRedline(/*[in]*/SwTableRowRedline* pPtr, /*[in]*/bool bCallDelete);
virtual bool SplitRedline(const SwPaM& rPam);
virtual bool DeleteRedline(/*[in]*/const SwPaM& rPam, /*[in]*/bool bSaveInUndo, /*[in]*/sal_uInt16 nDelType);
virtual bool DeleteRedline(/*[in]*/const SwStartNode& rSection, /*[in]*/bool bSaveInUndo, /*[in]*/sal_uInt16 nDelType);
diff --git a/sw/inc/redline.hxx b/sw/inc/redline.hxx
index 3dc9dea3e587..a4e0a29e05ca 100644
--- a/sw/inc/redline.hxx
+++ b/sw/inc/redline.hxx
@@ -304,7 +304,7 @@ public:
class SW_DLLPUBLIC SwExtraRedline
{
public:
- SwExtraRedline( RedlineType_t eType );
+ SwExtraRedline( );
SwExtraRedline( const SwExtraRedline& );
virtual ~SwExtraRedline();
};
@@ -312,10 +312,25 @@ public:
/// Redline that holds information about a table-row that had some change
class SW_DLLPUBLIC SwTableRowRedline : public SwExtraRedline
{
+private:
+ SwRedlineData* pRedlineData;
+ const SwTableLine* pTableLine;
+
public:
- SwTableRowRedline( RedlineType_t eType, SwTableLine* pTableLine );
+ SwTableRowRedline( const SwRedlineData& rData, SwTableLine& aTableLine );
SwTableRowRedline( const SwTableRowRedline& );
virtual ~SwTableRowRedline();
+
+ /** ExtraData gets copied, the pointer is therefor not taken over by
+ * the RedLineObject.*/
+ void SetExtraData( const SwRedlineExtraData* pData )
+ { pRedlineData->SetExtraData( pData ); }
+ const SwRedlineExtraData* GetExtraData() const
+ { return pRedlineData->GetExtraData(); }
+ const SwTableLine* GetTableLine() const
+ { return pTableLine; }
+ const SwRedlineData& GetRedlineData() const
+ { return *pRedlineData; }
};