diff options
author | Tzvetelina Tzeneva <tzvetelina@gmail.com> | 2011-12-22 17:27:32 +0100 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2011-12-22 17:53:53 +0100 |
commit | 062eaeffe7cb986255063bb9b0a5f3fb3fc8e34c (patch) | |
tree | 0f065352d000a11131203cf6832354bde597ff50 /sw/inc | |
parent | 61329db01af7fd7c5915a4d81896d52fda7168db (diff) |
sw: Improved document comparison based on RSIDs.
Diffstat (limited to 'sw/inc')
-rw-r--r-- | sw/inc/doc.hxx | 10 | ||||
-rw-r--r-- | sw/inc/globals.hrc | 1 | ||||
-rw-r--r-- | sw/inc/helpid.h | 1 | ||||
-rw-r--r-- | sw/inc/hintids.hxx | 143 | ||||
-rw-r--r-- | sw/inc/modcfg.hxx | 46 | ||||
-rw-r--r-- | sw/inc/ndtxt.hxx | 7 | ||||
-rw-r--r-- | sw/inc/swmodule.hxx | 10 | ||||
-rw-r--r-- | sw/inc/unoprnms.hxx | 4 |
8 files changed, 147 insertions, 75 deletions
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index c7255d94f00d..0251d46d3527 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -416,6 +416,9 @@ private: RedlineMode_t eRedlineMode; // Current Redline Mode. SwCharCompressType eChrCmprType; // for ASIAN: compress punctuation/kana + sal_uInt32 nRsid; // current session ID of the document + sal_uInt32 nRsidRoot; // session ID when the document was created + sal_Int32 mReferenceCount; sal_Int32 mIdleBlockCount; sal_Int8 nLockExpFld; // If != 0 UpdateExpFlds() has no effect! @@ -732,6 +735,10 @@ public: virtual void setFieldUpdateFlags( /*[in]*/ SwFldUpdateFlags eMode ); virtual SwCharCompressType getCharacterCompressionType() const; virtual void setCharacterCompressionType( /*[in]*/SwCharCompressType nType ); + virtual sal_uInt32 getRsid() const; + virtual void setRsid( sal_uInt32 nVal ); + virtual sal_uInt32 getRsidRoot() const; + virtual void setRsidRoot( sal_uInt32 nVal ); /** IDocumentDeviceAccess */ @@ -859,6 +866,9 @@ public: virtual bool Overwrite(const SwPaM &rRg, const String& rStr); virtual bool InsertString(const SwPaM &rRg, const String&, const enum InsertFlags nInsertMode = INS_EMPTYEXPAND ); + virtual bool UpdateRsid( SwTxtNode *pTxtNode, xub_StrLen nStt, xub_StrLen nEnd ); + virtual bool UpdateParRsid( SwTxtNode *pTxtNode, sal_uInt32 nVal = 0 ); + virtual bool UpdateRsid( const SwPaM &rRg, xub_StrLen nLen ); virtual SwFlyFrmFmt* Insert(const SwPaM &rRg, const String& rGrfName, const String& rFltName, const Graphic* pGraphic, const SfxItemSet* pFlyAttrSet, const SfxItemSet* pGrfAttrSet, SwFrmFmt*); virtual SwFlyFrmFmt* Insert(const SwPaM& rRg, const GraphicObject& rGrfObj, const SfxItemSet* pFlyAttrSet, diff --git a/sw/inc/globals.hrc b/sw/inc/globals.hrc index d68ada7ca26d..17e919d58f61 100644 --- a/sw/inc/globals.hrc +++ b/sw/inc/globals.hrc @@ -273,6 +273,7 @@ #define TP_OPTCOMPATIBILITY_PAGE (RC_GLOBALS_BEGIN + 103) #define TP_MAILCONFIG (RC_GLOBALS_BEGIN + 104) #define TP_TITLEPAGE (RC_GLOBALS_BEGIN + 105) +#define TP_COMPARISON_OPT (RC_GLOBALS_BEGIN + 106) //maximum: RC_GLOBALS_BEGIN + 120 diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h index c5dc7f9dd3db..9f19b8ea2029 100644 --- a/sw/inc/helpid.h +++ b/sw/inc/helpid.h @@ -308,6 +308,7 @@ #define HID_TEXTGRID_PAGE "SW_HID_TEXTGRID_PAGE" #define HID_OPTCOMPATIBILITY_PAGE "SW_HID_OPTCOMPATIBILITY_PAGE" #define HID_COMPATIBILITY_OPTIONS_BOX "SW_HID_COMPATIBILITY_OPTIONS_BOX" +#define HID_COMPARISON_OPT "SW_HID_COMPARISON_OPT" // AutoPilot Help-IDs diff --git a/sw/inc/hintids.hxx b/sw/inc/hintids.hxx index afd57f3bfb4a..9428072fa53a 100644 --- a/sw/inc/hintids.hxx +++ b/sw/inc/hintids.hxx @@ -96,8 +96,8 @@ RES_CHRATR_BEGIN = HINT_BEGIN, RES_CHRATR_RELIEF, // 36 RES_CHRATR_HIDDEN, // 37 RES_CHRATR_OVERLINE, // 38 - RES_CHRATR_DUMMY1, // 39 - RES_CHRATR_DUMMY2, // 40 + RES_CHRATR_RSID, // 39 + RES_CHRATR_DUMMY1, // 40 RES_CHRATR_END }; @@ -168,6 +168,7 @@ RES_PARATR_BEGIN = RES_TXTATR_END, RES_PARATR_SNAPTOGRID, // 72 RES_PARATR_CONNECT_BORDER, // 73 RES_PARATR_OUTLINELEVEL, // 74 + RES_PARATR_RSID, // 75 RES_PARATR_END }; @@ -176,99 +177,99 @@ RES_PARATR_END enum RES_PARATR_LIST { RES_PARATR_LIST_BEGIN = RES_PARATR_END, - RES_PARATR_LIST_ID = RES_PARATR_LIST_BEGIN, // 75 - RES_PARATR_LIST_LEVEL, // 76 - RES_PARATR_LIST_ISRESTART, // 77 - RES_PARATR_LIST_RESTARTVALUE, // 78 - RES_PARATR_LIST_ISCOUNTED, // 79 + RES_PARATR_LIST_ID = RES_PARATR_LIST_BEGIN, // 76 + RES_PARATR_LIST_LEVEL, // 77 + RES_PARATR_LIST_ISRESTART, // 78 + RES_PARATR_LIST_RESTARTVALUE, // 79 + RES_PARATR_LIST_ISCOUNTED, // 80 RES_PARATR_LIST_END }; enum RES_FRMATR { RES_FRMATR_BEGIN = RES_PARATR_LIST_END, - RES_FILL_ORDER = RES_FRMATR_BEGIN, // 80 - RES_FRM_SIZE, // 81 - RES_PAPER_BIN, // 82 - RES_LR_SPACE, // 83 - RES_UL_SPACE, // 84 - RES_PAGEDESC, // 85 - RES_BREAK, // 86 - RES_CNTNT, // 87 - RES_HEADER, // 88 - RES_FOOTER, // 89 - RES_PRINT, // 90 - RES_OPAQUE, // 91 - RES_PROTECT, // 92 - RES_SURROUND, // 93 - RES_VERT_ORIENT, // 94 - RES_HORI_ORIENT, // 95 - RES_ANCHOR, // 96 - RES_BACKGROUND, // 97 - RES_BOX, // 98 - RES_SHADOW, // 99 - RES_FRMMACRO, // 100 - RES_COL, // 101 - RES_KEEP, // 102 - RES_URL, // 103 - RES_EDIT_IN_READONLY, // 104 - RES_LAYOUT_SPLIT, // 105 - RES_CHAIN, // 106 - RES_TEXTGRID, // 107 - RES_LINENUMBER , // 108 - RES_FTN_AT_TXTEND, // 109 - RES_END_AT_TXTEND, // 110 - RES_COLUMNBALANCE, // 111 - RES_FRAMEDIR, // 112 - RES_HEADER_FOOTER_EAT_SPACING, // 113 - RES_ROW_SPLIT, // 114 - RES_FOLLOW_TEXT_FLOW, // 115 - RES_COLLAPSING_BORDERS, // 116 - RES_WRAP_INFLUENCE_ON_OBJPOS, // 117 - RES_AUTO_STYLE, // 118 - RES_FRMATR_STYLE_NAME, // 119 - RES_FRMATR_CONDITIONAL_STYLE_NAME, // 120 + RES_FILL_ORDER = RES_FRMATR_BEGIN, // 81 + RES_FRM_SIZE, // 82 + RES_PAPER_BIN, // 83 + RES_LR_SPACE, // 84 + RES_UL_SPACE, // 85 + RES_PAGEDESC, // 86 + RES_BREAK, // 87 + RES_CNTNT, // 88 + RES_HEADER, // 89 + RES_FOOTER, // 90 + RES_PRINT, // 91 + RES_OPAQUE, // 92 + RES_PROTECT, // 93 + RES_SURROUND, // 94 + RES_VERT_ORIENT, // 95 + RES_HORI_ORIENT, // 96 + RES_ANCHOR, // 97 + RES_BACKGROUND, // 98 + RES_BOX, // 99 + RES_SHADOW, // 100 + RES_FRMMACRO, // 101 + RES_COL, // 102 + RES_KEEP, // 103 + RES_URL, // 104 + RES_EDIT_IN_READONLY, // 105 + RES_LAYOUT_SPLIT, // 106 + RES_CHAIN, // 107 + RES_TEXTGRID, // 108 + RES_LINENUMBER , // 109 + RES_FTN_AT_TXTEND, // 110 + RES_END_AT_TXTEND, // 111 + RES_COLUMNBALANCE, // 112 + RES_FRAMEDIR, // 113 + RES_HEADER_FOOTER_EAT_SPACING, // 114 + RES_ROW_SPLIT, // 115 + RES_FOLLOW_TEXT_FLOW, // 116 + RES_COLLAPSING_BORDERS, // 117 + RES_WRAP_INFLUENCE_ON_OBJPOS, // 118 + RES_AUTO_STYLE, // 119 + RES_FRMATR_STYLE_NAME, // 120 + RES_FRMATR_CONDITIONAL_STYLE_NAME, // 121 RES_FRMATR_END }; enum RES_GRFATR { RES_GRFATR_BEGIN = RES_FRMATR_END, - RES_GRFATR_MIRRORGRF = RES_GRFATR_BEGIN, // 121 - RES_GRFATR_CROPGRF, // 122 - - RES_GRFATR_ROTATION, // 123 - RES_GRFATR_LUMINANCE, // 124 - RES_GRFATR_CONTRAST, // 125 - RES_GRFATR_CHANNELR, // 126 - RES_GRFATR_CHANNELG, // 127 - RES_GRFATR_CHANNELB, // 128 - RES_GRFATR_GAMMA, // 129 - RES_GRFATR_INVERT, // 130 - RES_GRFATR_TRANSPARENCY, // 131 - RES_GRFATR_DRAWMODE, // 132 - - RES_GRFATR_DUMMY1, // 133 - RES_GRFATR_DUMMY2, // 134 - RES_GRFATR_DUMMY3, // 135 - RES_GRFATR_DUMMY4, // 136 - RES_GRFATR_DUMMY5, // 137 + RES_GRFATR_MIRRORGRF = RES_GRFATR_BEGIN, // 122 + RES_GRFATR_CROPGRF, // 123 + + RES_GRFATR_ROTATION, // 124 + RES_GRFATR_LUMINANCE, // 125 + RES_GRFATR_CONTRAST, // 126 + RES_GRFATR_CHANNELR, // 127 + RES_GRFATR_CHANNELG, // 128 + RES_GRFATR_CHANNELB, // 129 + RES_GRFATR_GAMMA, // 130 + RES_GRFATR_INVERT, // 131 + RES_GRFATR_TRANSPARENCY, // 132 + RES_GRFATR_DRAWMODE, // 133 + + RES_GRFATR_DUMMY1, // 134 + RES_GRFATR_DUMMY2, // 135 + RES_GRFATR_DUMMY3, // 136 + RES_GRFATR_DUMMY4, // 137 + RES_GRFATR_DUMMY5, // 138 RES_GRFATR_END }; enum RES_BOXATR { RES_BOXATR_BEGIN = RES_GRFATR_END, - RES_BOXATR_FORMAT = RES_BOXATR_BEGIN, // 138 - RES_BOXATR_FORMULA, // 139 - RES_BOXATR_VALUE, // 140 + RES_BOXATR_FORMAT = RES_BOXATR_BEGIN, // 139 + RES_BOXATR_FORMULA, // 140 + RES_BOXATR_VALUE, // 141 RES_BOXATR_END }; enum RES_UNKNOWNATR { RES_UNKNOWNATR_BEGIN = RES_BOXATR_END, - RES_UNKNOWNATR_CONTAINER = RES_UNKNOWNATR_BEGIN,// 141 + RES_UNKNOWNATR_CONTAINER = RES_UNKNOWNATR_BEGIN,// 142 RES_UNKNOWNATR_END }; diff --git a/sw/inc/modcfg.hxx b/sw/inc/modcfg.hxx index 14a3b2ac2f7e..b1fb71325b07 100644 --- a/sw/inc/modcfg.hxx +++ b/sw/inc/modcfg.hxx @@ -39,6 +39,7 @@ #include "tblenum.hxx" #include "itabenum.hxx" #include <tools/globname.hxx> +#include <editeng/svxenum.hxx> class SwModuleOptions; class InsCaptionOpt; @@ -77,6 +78,26 @@ class SwRevisionConfig : public utl::ConfigItem void SetModified(){ConfigItem::SetModified();} }; +class SwCompareConfig : public utl::ConfigItem +{ + friend class SwModuleOptions; + + sal_uInt16 eCmpMode; //Compare/CompareDocuments; + sal_Bool bUseRsid; //Compare/Settings/Use RSID + sal_Bool bIgnorePieces; //Compare/Settings/Ignore pieces of length + sal_uInt16 nPieceLen; //Compare/Settings/Ignore pieces of length + + const com::sun::star::uno::Sequence<rtl::OUString>& GetPropertyNames(); + public: + SwCompareConfig(); + ~SwCompareConfig(); + + virtual void Commit(); + virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ){ }; + void Load(); + void SetModified() {ConfigItem::SetModified(); } +}; + class SwInsertConfig : public utl::ConfigItem { friend class SwModuleOptions; @@ -167,6 +188,8 @@ class SW_DLLPUBLIC SwModuleOptions SwMiscConfig aMiscConfig; + SwCompareConfig aCompareConfig; + //fiscus: don't show tips of text fields - it's not part of the configuration! sal_Bool bHideFieldTips : 1; @@ -309,20 +332,37 @@ public: //convert word delimiter from or to user interface static String ConvertWordDelimiter(const String& rDelim, sal_Bool bFromUI); - sal_Bool IsShowIndexPreview() const {return aMiscConfig.bShowIndexPreview;} + sal_Bool IsShowIndexPreview() const {return aMiscConfig.bShowIndexPreview;} void SetShowIndexPreview(sal_Bool bSet) {aMiscConfig.bShowIndexPreview = bSet; aMiscConfig.SetModified();} - sal_Bool IsDefaultFontInCurrDocOnly() const { return aMiscConfig.bDefaultFontsInCurrDocOnly;} + sal_Bool IsDefaultFontInCurrDocOnly() const { return aMiscConfig.bDefaultFontsInCurrDocOnly;} void SetDefaultFontInCurrDocOnly(sal_Bool bSet) { aMiscConfig.bDefaultFontsInCurrDocOnly = bSet; aMiscConfig.SetModified(); } - sal_Bool IsHideFieldTips() const {return bHideFieldTips;} + sal_Bool IsHideFieldTips() const {return bHideFieldTips;} void SetHideFieldTips(sal_Bool bSet) {bHideFieldTips = bSet;} + + SvxCompareMode GetCompareMode() const { return (SvxCompareMode)aCompareConfig.eCmpMode; } + void SetCompareMode( SvxCompareMode eMode ) { aCompareConfig.eCmpMode = eMode; + aCompareConfig.SetModified(); } + + sal_Bool IsUseRsid() const { return aCompareConfig.bUseRsid; } + void SetUseRsid( sal_Bool b ) { aCompareConfig.bUseRsid = b; + aCompareConfig.SetModified(); } + + sal_Bool IsIgnorePieces() const { return aCompareConfig.bIgnorePieces; } + void SetIgnorePieces( sal_Bool b ) { aCompareConfig.bIgnorePieces = b; + aCompareConfig.SetModified(); } + + sal_uInt16 GetPieceLen() const { return aCompareConfig.nPieceLen; } + void SetPieceLen( sal_uInt16 nLen ) { aCompareConfig.nPieceLen = nLen; + aCompareConfig.SetModified(); } + }; #endif diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx index b4a772d2455f..b412aa43fadf 100644 --- a/sw/inc/ndtxt.hxx +++ b/sw/inc/ndtxt.hxx @@ -803,6 +803,13 @@ public: virtual void dumpAsXml( xmlTextWriterPtr writer = NULL ); + sal_uInt32 GetRsid( xub_StrLen nStt, xub_StrLen nEnd ) const; + sal_uInt32 GetParRsid() const; + + bool CompareRsid( const SwTxtNode &rTxtNode, xub_StrLen nStt1, xub_StrLen nStt2, + xub_StrLen nEnd1 = 0, xub_StrLen nEnd2 = 0 ) const; + bool CompareParRsid( const SwTxtNode &rTxtNode ) const; + DECL_FIXEDMEMPOOL_NEWDEL(SwTxtNode) }; diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx index 763923725958..aca0d48925db 100644 --- a/sw/inc/swmodule.hxx +++ b/sw/inc/swmodule.hxx @@ -40,6 +40,7 @@ #include <fldupde.hxx> #include <com/sun/star/linguistic2/XLinguServiceEventListener.hpp> #include <com/sun/star/linguistic2/XLanguageGuessing.hpp> +#include <editeng/svxenum.hxx> class SvStringsDtor; class Color; @@ -210,6 +211,15 @@ public: sal_uInt16 GetRedlineMarkPos(); const Color& GetRedlineMarkColor(); + SvxCompareMode GetCompareMode() const; + void SetCompareMode( SvxCompareMode eMode ); + sal_Bool IsUseRsid() const; + void SetUseRsid( sal_Bool b ); + sal_Bool IsIgnorePieces() const; + void SetIgnorePieces( sal_Bool b ); + sal_uInt16 GetPieceLen() const; + void SetPieceLen( sal_uInt16 nLen ); + // Return defined DocStat - WordDelimiter. const String& GetDocStatWordDelim() const; diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx index 8df75ee59bfb..e70963a19ccd 100644 --- a/sw/inc/unoprnms.hxx +++ b/sw/inc/unoprnms.hxx @@ -806,7 +806,9 @@ enum SwPropNameIds /* 0742 */ UNO_NAME_SEPARATOR_LINE_STYLE, /* 0743 */ UNO_NAME_FOOTNOTE_LINE_STYLE, /* 0744 */ UNO_NAME_EMBEDDED_OBJECT, -/* 0745 */ SW_PROPNAME_END +/* 0745 */ UNO_NAME_RSID, +/* 0746 */ UNO_NAME_PARRSID, +/* 0747 */ SW_PROPNAME_END // new items in this array must match SwPropNameTab aPropNameTab }; |