[Libreoffice-commits] core.git: sw/inc sw/source

Lei De Bin leidb at apache.org
Wed Feb 26 08:13:56 PST 2014


 sw/inc/doc.hxx                               |    7 
 sw/inc/hintids.hxx                           |  221 +++++++++++++--------------
 sw/source/core/bastyp/init.cxx               |   10 -
 sw/source/core/doc/docnew.cxx                |    3 
 sw/source/core/text/atrstck.cxx              |   25 +--
 sw/source/filter/html/css1atr.cxx            |   11 -
 sw/source/filter/html/htmlatr.cxx            |    7 
 sw/source/filter/ww8/attributeoutputbase.hxx |    6 
 sw/source/filter/ww8/docxattributeoutput.cxx |    8 
 sw/source/filter/ww8/docxattributeoutput.hxx |    6 
 sw/source/filter/ww8/rtfattributeoutput.cxx  |    8 
 sw/source/filter/ww8/rtfattributeoutput.hxx  |    6 
 sw/source/filter/ww8/ww8atr.cxx              |   31 +++
 sw/source/filter/ww8/ww8attributeoutput.hxx  |    6 
 sw/source/filter/ww8/ww8par.cxx              |    5 
 sw/source/filter/ww8/ww8par6.cxx             |   35 +++-
 16 files changed, 248 insertions(+), 147 deletions(-)

New commits:
commit 5faf5492741abfd013ae677b1ec2fc06276d8644
Author: Lei De Bin <leidb at apache.org>
Date:   Wed Sep 12 04:07:30 2012 +0000

    Resolves: #i119612# fix the order of Hebraic string are changed after..
    
    save as new .doc
    
    * when opening .doc in AOO, preserve the RTL property(property ID is 0x085A)
    and export.
    
    Reported by: Lou Qing le
    Patch by: Chen Zuo Jun
    Review by: Lei De Bin
    (cherry picked from commit daa4da26a7ba0c58c79af69fc6624729f7b22c10)
    
    Conflicts:
    	sw/inc/hintids.hxx
    	sw/source/core/bastyp/init.cxx
    	sw/source/core/doc/docnew.cxx
    	sw/source/core/text/atrstck.cxx
    	sw/source/filter/ww8/ww8atr.cxx
    
    Change-Id: I2a1788452475e0deebf530aae41e543eae3cd45d
    
    Resolves: #i120935# Insert blank entry for RES_CHRATR_BIDITRL...
    
    and RES_CHRATR_IDCTHINT, to keep the identical res order
    
    (cherry picked from commit 919e99308395c572a7298e6db2b96df8bf7ec3fd)
    
    Conflicts:
    	sw/source/filter/html/htmlatr.cxx
    
    Change-Id: I3c2a3513de3c146ece583ff40bf3ffb3845f971c
    
    Resolves: #i122867# HTML export - correct function pointer table...
    
    which holds the export functions for certain attributes
    
    (cherry picked from commit 5d963c0c996d50fa1033e7c2da48b5d1c3747f20)
    
    Conflicts:
    	sw/source/filter/html/css1atr.cxx
    
    Change-Id: I7f31cfab8c654d5c549db1343d1e222f50a42c60

diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 995f2ea..d15b353 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -703,6 +703,13 @@ private:
     bool ReplaceRangeImpl(SwPaM&, OUString const&, const bool);
 
 public:
+    enum DocumentType {
+        DOCTYPE_NATIVE,
+        DOCTYPE_MSWORD              //This doc medul is come from Ms Word
+        };
+    DocumentType    meDocType;
+    DocumentType    GetDocumentType(){ return meDocType; }
+    void            SetDocumentType( DocumentType eDocType ) { meDocType = eDocType; }
 
     /** Life cycle
     */
diff --git a/sw/inc/hintids.hxx b/sw/inc/hintids.hxx
index cf911ab..e49255e 100644
--- a/sw/inc/hintids.hxx
+++ b/sw/inc/hintids.hxx
@@ -96,7 +96,8 @@ RES_CHRATR_BEGIN = HINT_BEGIN,
     RES_CHRATR_SHADOW,                      // 41
     RES_CHRATR_HIGHLIGHT,                   // 42
     RES_CHRATR_GRABBAG,                     // 43
-    RES_CHRATR_DUMMY3,                      // 44
+    RES_CHRATR_BIDIRTL,                     // 44
+    RES_CHRATR_IDCTHINT,                    // 45
 RES_CHRATR_END
 };
 
@@ -122,27 +123,27 @@ RES_TXTATR_BEGIN = RES_CHRATR_END,
    - META and METAFIELD must precede CJK_RUBY and INETFMT
  */
 RES_TXTATR_WITHEND_BEGIN = RES_TXTATR_BEGIN ,
-    RES_TXTATR_REFMARK = RES_TXTATR_WITHEND_BEGIN,  // 45
-    RES_TXTATR_TOXMARK,                             // 46
-    RES_TXTATR_META,                                // 47
-    RES_TXTATR_METAFIELD,                           // 48
-    RES_TXTATR_AUTOFMT,                             // 49
-    RES_TXTATR_INETFMT,                             // 50
-    RES_TXTATR_CHARFMT,                             // 51
-    RES_TXTATR_CJK_RUBY,                            // 52
-    RES_TXTATR_UNKNOWN_CONTAINER,                   // 53
-    RES_TXTATR_INPUTFIELD,                          // 54
+    RES_TXTATR_REFMARK = RES_TXTATR_WITHEND_BEGIN,  // 46
+    RES_TXTATR_TOXMARK,                             // 47
+    RES_TXTATR_META,                                // 48
+    RES_TXTATR_METAFIELD,                           // 49
+    RES_TXTATR_AUTOFMT,                             // 50
+    RES_TXTATR_INETFMT,                             // 51
+    RES_TXTATR_CHARFMT,                             // 52
+    RES_TXTATR_CJK_RUBY,                            // 53
+    RES_TXTATR_UNKNOWN_CONTAINER,                   // 54
+    RES_TXTATR_INPUTFIELD,                          // 55
 RES_TXTATR_WITHEND_END,
 
 // all TextAttributes without an end
 RES_TXTATR_NOEND_BEGIN = RES_TXTATR_WITHEND_END,
-    RES_TXTATR_FIELD = RES_TXTATR_NOEND_BEGIN,      // 55
-    RES_TXTATR_FLYCNT,                              // 56
-    RES_TXTATR_FTN,                                 // 57
-    RES_TXTATR_ANNOTATION,                          // 58
-    RES_TXTATR_DUMMY3,                              // 59
-    RES_TXTATR_DUMMY1,                              // 60
-    RES_TXTATR_DUMMY2,                              // 61
+    RES_TXTATR_FIELD = RES_TXTATR_NOEND_BEGIN,      // 56
+    RES_TXTATR_FLYCNT,                              // 57
+    RES_TXTATR_FTN,                                 // 58
+    RES_TXTATR_ANNOTATION,                          // 59
+    RES_TXTATR_DUMMY3,                              // 60
+    RES_TXTATR_DUMMY1,                              // 61
+    RES_TXTATR_DUMMY2,                              // 62
 RES_TXTATR_NOEND_END,
 RES_TXTATR_END = RES_TXTATR_NOEND_END
 };
@@ -150,25 +151,25 @@ RES_TXTATR_END = RES_TXTATR_NOEND_END
 enum RES_PARATR
 {
 RES_PARATR_BEGIN = RES_TXTATR_END,
-    RES_PARATR_LINESPACING = RES_PARATR_BEGIN,      // 62
-    RES_PARATR_ADJUST,                              // 63
-    RES_PARATR_SPLIT,                               // 64
-    RES_PARATR_ORPHANS,                             // 65
-    RES_PARATR_WIDOWS,                              // 66
-    RES_PARATR_TABSTOP,                             // 67
-    RES_PARATR_HYPHENZONE,                          // 68
-    RES_PARATR_DROP,                                // 69
-    RES_PARATR_REGISTER,                            // 70
-    RES_PARATR_NUMRULE,                             // 71
-    RES_PARATR_SCRIPTSPACE,                         // 72
-    RES_PARATR_HANGINGPUNCTUATION,                  // 73
-    RES_PARATR_FORBIDDEN_RULES,                     // 74
-    RES_PARATR_VERTALIGN,                           // 75
-    RES_PARATR_SNAPTOGRID,                          // 76
-    RES_PARATR_CONNECT_BORDER,                      // 77
-    RES_PARATR_OUTLINELEVEL,                        // 78
-    RES_PARATR_RSID,                                // 79
-    RES_PARATR_GRABBAG,                             // 80
+    RES_PARATR_LINESPACING = RES_PARATR_BEGIN,      // 63
+    RES_PARATR_ADJUST,                              // 64
+    RES_PARATR_SPLIT,                               // 65
+    RES_PARATR_ORPHANS,                             // 66
+    RES_PARATR_WIDOWS,                              // 67
+    RES_PARATR_TABSTOP,                             // 68
+    RES_PARATR_HYPHENZONE,                          // 69
+    RES_PARATR_DROP,                                // 70
+    RES_PARATR_REGISTER,                            // 71
+    RES_PARATR_NUMRULE,                             // 72
+    RES_PARATR_SCRIPTSPACE,                         // 73
+    RES_PARATR_HANGINGPUNCTUATION,                  // 74
+    RES_PARATR_FORBIDDEN_RULES,                     // 75
+    RES_PARATR_VERTALIGN,                           // 76
+    RES_PARATR_SNAPTOGRID,                          // 77
+    RES_PARATR_CONNECT_BORDER,                      // 78
+    RES_PARATR_OUTLINELEVEL,                        // 79
+    RES_PARATR_RSID,                                // 80
+    RES_PARATR_GRABBAG,                             // 81
 RES_PARATR_END
 };
 
@@ -177,103 +178,103 @@ RES_PARATR_END
 enum RES_PARATR_LIST
 {
 RES_PARATR_LIST_BEGIN = RES_PARATR_END,
-    RES_PARATR_LIST_ID = RES_PARATR_LIST_BEGIN,     // 81
-    RES_PARATR_LIST_LEVEL,                          // 82
-    RES_PARATR_LIST_ISRESTART,                      // 83
-    RES_PARATR_LIST_RESTARTVALUE,                   // 84
-    RES_PARATR_LIST_ISCOUNTED,                      // 85
+    RES_PARATR_LIST_ID = RES_PARATR_LIST_BEGIN,     // 82
+    RES_PARATR_LIST_LEVEL,                          // 83
+    RES_PARATR_LIST_ISRESTART,                      // 84
+    RES_PARATR_LIST_RESTARTVALUE,                   // 85
+    RES_PARATR_LIST_ISCOUNTED,                      // 86
 RES_PARATR_LIST_END
 };
 
 enum RES_FRMATR
 {
 RES_FRMATR_BEGIN = RES_PARATR_LIST_END,
-    RES_FILL_ORDER = RES_FRMATR_BEGIN,              // 86
-    RES_FRM_SIZE,                                   // 87
-    RES_PAPER_BIN,                                  // 88
-    RES_LR_SPACE,                                   // 89
-    RES_UL_SPACE,                                   // 90
-    RES_PAGEDESC,                                   // 91
-    RES_BREAK,                                      // 92
-    RES_CNTNT,                                      // 93
-    RES_HEADER,                                     // 94
-    RES_FOOTER,                                     // 95
-    RES_PRINT,                                      // 96
-    RES_OPAQUE,                                     // 97
-    RES_PROTECT,                                    // 98
-    RES_SURROUND,                                   // 99
-    RES_VERT_ORIENT,                                // 100
-    RES_HORI_ORIENT,                                // 101
-    RES_ANCHOR,                                     // 102
-    RES_BACKGROUND,                                 // 103
-    RES_BOX,                                        // 104
-    RES_SHADOW,                                     // 105
-    RES_FRMMACRO,                                   // 106
-    RES_COL,                                        // 107
-    RES_KEEP,                                       // 108
-    RES_URL,                                        // 109
-    RES_EDIT_IN_READONLY,                           // 110
-    RES_LAYOUT_SPLIT,                               // 111
-    RES_CHAIN,                                      // 112
-    RES_TEXTGRID,                                   // 113
-    RES_LINENUMBER  ,                               // 114
-    RES_FTN_AT_TXTEND,                              // 115
-    RES_END_AT_TXTEND,                              // 116
-    RES_COLUMNBALANCE,                              // 117
-    RES_FRAMEDIR,                                   // 118
-    RES_HEADER_FOOTER_EAT_SPACING,                  // 119
-    RES_ROW_SPLIT,                                  // 120
-    RES_FOLLOW_TEXT_FLOW,                           // 121
-    RES_COLLAPSING_BORDERS,                         // 122
-    RES_WRAP_INFLUENCE_ON_OBJPOS,                   // 123
-    RES_AUTO_STYLE,                                 // 124
-    RES_FRMATR_STYLE_NAME,                          // 125
-    RES_FRMATR_CONDITIONAL_STYLE_NAME,              // 126
-    RES_FILL_STYLE,                                 // 127
-    RES_FILL_GRADIENT,                              // 128
-    RES_FRMATR_GRABBAG,                             // 129
-    RES_TEXT_VERT_ADJUST,                           // 130
+    RES_FILL_ORDER = RES_FRMATR_BEGIN,              // 87
+    RES_FRM_SIZE,                                   // 88
+    RES_PAPER_BIN,                                  // 89
+    RES_LR_SPACE,                                   // 90
+    RES_UL_SPACE,                                   // 91
+    RES_PAGEDESC,                                   // 92
+    RES_BREAK,                                      // 93
+    RES_CNTNT,                                      // 94
+    RES_HEADER,                                     // 95
+    RES_FOOTER,                                     // 96
+    RES_PRINT,                                      // 97
+    RES_OPAQUE,                                     // 98
+    RES_PROTECT,                                    // 99
+    RES_SURROUND,                                   // 100
+    RES_VERT_ORIENT,                                // 101
+    RES_HORI_ORIENT,                                // 102
+    RES_ANCHOR,                                     // 103
+    RES_BACKGROUND,                                 // 104
+    RES_BOX,                                        // 105
+    RES_SHADOW,                                     // 106
+    RES_FRMMACRO,                                   // 107
+    RES_COL,                                        // 108
+    RES_KEEP,                                       // 109
+    RES_URL,                                        // 110
+    RES_EDIT_IN_READONLY,                           // 111
+    RES_LAYOUT_SPLIT,                               // 112
+    RES_CHAIN,                                      // 113
+    RES_TEXTGRID,                                   // 114
+    RES_LINENUMBER  ,                               // 115
+    RES_FTN_AT_TXTEND,                              // 116
+    RES_END_AT_TXTEND,                              // 117
+    RES_COLUMNBALANCE,                              // 118
+    RES_FRAMEDIR,                                   // 119
+    RES_HEADER_FOOTER_EAT_SPACING,                  // 120
+    RES_ROW_SPLIT,                                  // 121
+    RES_FOLLOW_TEXT_FLOW,                           // 122
+    RES_COLLAPSING_BORDERS,                         // 123
+    RES_WRAP_INFLUENCE_ON_OBJPOS,                   // 124
+    RES_AUTO_STYLE,                                 // 125
+    RES_FRMATR_STYLE_NAME,                          // 126
+    RES_FRMATR_CONDITIONAL_STYLE_NAME,              // 127
+    RES_FILL_STYLE,                                 // 128
+    RES_FILL_GRADIENT,                              // 129
+    RES_FRMATR_GRABBAG,                             // 130
+    RES_TEXT_VERT_ADJUST,                           // 131
 RES_FRMATR_END
 };
 
 enum RES_GRFATR
 {
 RES_GRFATR_BEGIN = RES_FRMATR_END,
-    RES_GRFATR_MIRRORGRF = RES_GRFATR_BEGIN,        // 131
-    RES_GRFATR_CROPGRF,                             // 132
-
-    RES_GRFATR_ROTATION,                            // 133
-    RES_GRFATR_LUMINANCE,                           // 134
-    RES_GRFATR_CONTRAST,                            // 135
-    RES_GRFATR_CHANNELR,                            // 136
-    RES_GRFATR_CHANNELG,                            // 137
-    RES_GRFATR_CHANNELB,                            // 138
-    RES_GRFATR_GAMMA,                               // 139
-    RES_GRFATR_INVERT,                              // 140
-    RES_GRFATR_TRANSPARENCY,                        // 141
-    RES_GRFATR_DRAWMODE,                            // 142
-
-    RES_GRFATR_DUMMY1,                              // 143
-    RES_GRFATR_DUMMY2,                              // 144
-    RES_GRFATR_DUMMY3,                              // 145
-    RES_GRFATR_DUMMY4,                              // 146
-    RES_GRFATR_DUMMY5,                              // 147
+    RES_GRFATR_MIRRORGRF = RES_GRFATR_BEGIN,        // 132
+    RES_GRFATR_CROPGRF,                             // 133
+
+    RES_GRFATR_ROTATION,                            // 134
+    RES_GRFATR_LUMINANCE,                           // 135
+    RES_GRFATR_CONTRAST,                            // 136
+    RES_GRFATR_CHANNELR,                            // 137
+    RES_GRFATR_CHANNELG,                            // 138
+    RES_GRFATR_CHANNELB,                            // 139
+    RES_GRFATR_GAMMA,                               // 140
+    RES_GRFATR_INVERT,                              // 141
+    RES_GRFATR_TRANSPARENCY,                        // 142
+    RES_GRFATR_DRAWMODE,                            // 143
+
+    RES_GRFATR_DUMMY1,                              // 144
+    RES_GRFATR_DUMMY2,                              // 145
+    RES_GRFATR_DUMMY3,                              // 146
+    RES_GRFATR_DUMMY4,                              // 147
+    RES_GRFATR_DUMMY5,                              // 148
 RES_GRFATR_END
 };
 
 enum RES_BOXATR
 {
 RES_BOXATR_BEGIN = RES_GRFATR_END,
-    RES_BOXATR_FORMAT = RES_BOXATR_BEGIN,           // 148
-    RES_BOXATR_FORMULA,                             // 149
-    RES_BOXATR_VALUE,                               // 150
+    RES_BOXATR_FORMAT = RES_BOXATR_BEGIN,           // 149
+    RES_BOXATR_FORMULA,                             // 150
+    RES_BOXATR_VALUE,                               // 151
 RES_BOXATR_END
 };
 
 enum RES_UNKNOWNATR
 {
 RES_UNKNOWNATR_BEGIN = RES_BOXATR_END,
-    RES_UNKNOWNATR_CONTAINER = RES_UNKNOWNATR_BEGIN,// 151
+    RES_UNKNOWNATR_CONTAINER = RES_UNKNOWNATR_BEGIN,// 152
 RES_UNKNOWNATR_END
 };
 
diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx
index 5df6e83..e88efae 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -292,9 +292,10 @@ SfxItemInfo aSlotTab[] =
     { 0, SFX_ITEM_POOLABLE },                           // RES_CHRATR_RSID
     { 0, SFX_ITEM_POOLABLE },                           // RES_CHRATR_BOX
     { 0, SFX_ITEM_POOLABLE },                           // RES_CHRATR_SHADOW
-    { 0, SFX_ITEM_POOLABLE },                           // RES_CHRATR_DUMMY1
+    { 0, SFX_ITEM_POOLABLE },                           // RES_CHRATR_HIGHLIGHT
     { 0, SFX_ITEM_POOLABLE },                           // RES_CHRATR_GRABBAG
-    { 0, SFX_ITEM_POOLABLE },                           // RES_CHRATR_DUMMY3
+    { 0, SFX_ITEM_POOLABLE },                           // RES_CHRATR_BIDIRTL
+    { 0, SFX_ITEM_POOLABLE },                           // RES_CHRATR_IDCTHINT
 
     { 0, 0 },                                           // RES_TXTATR_REFMARK
     { 0, 0 },                                           // RES_TXTATR_TOXMARK
@@ -502,8 +503,9 @@ void _InitCore()
     aAttrTab[ RES_CHRATR_HIGHLIGHT - POOLATTR_BEGIN ] =     new SvxBrushItem( RES_CHRATR_HIGHLIGHT );
     aAttrTab[ RES_CHRATR_GRABBAG - POOLATTR_BEGIN ] =       new SfxGrabBagItem( RES_CHRATR_GRABBAG );
 
-// CharakterAttr - Dummies
-    aAttrTab[ RES_CHRATR_DUMMY3 - POOLATTR_BEGIN ] =        new SfxBoolItem( RES_CHRATR_DUMMY3 );
+// CharakterAttr - MSWord weak char direction/script override emulation
+    aAttrTab[ RES_CHRATR_BIDIRTL - POOLATTR_BEGIN ] = new SfxInt16Item( RES_CHRATR_BIDIRTL, sal_Int16(-1) );
+    aAttrTab[ RES_CHRATR_IDCTHINT - POOLATTR_BEGIN ] = new SfxInt16Item( RES_CHRATR_IDCTHINT, sal_Int16(-1) );
 
 
     aAttrTab[ RES_TXTATR_REFMARK - POOLATTR_BEGIN ] =       new SwFmtRefMark( OUString() );
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 4b37bc1..dad0fdb 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -322,7 +322,8 @@ SwDoc::SwDoc()
     // COMPATIBILITY FLAGS END
 
     mbStartIdleTimer(false),
-    mbReadOnly(false)
+    mbReadOnly(false),
+    meDocType(DOCTYPE_NATIVE)
 {
     // COMPATIBILITY FLAGS START
 
diff --git a/sw/source/core/text/atrstck.cxx b/sw/source/core/text/atrstck.cxx
index d71ab45..5de97e2 100644
--- a/sw/source/core/text/atrstck.cxx
+++ b/sw/source/core/text/atrstck.cxx
@@ -115,18 +115,19 @@ const sal_uInt8 StackPos[ static_cast<sal_uInt16>(RES_TXTATR_WITHEND_END) -
     36, // RES_CHRATR_BOX,                       // 40
     37, // RES_CHRATR_SHADOW,                    // 41
     38, // RES_CHRATR_HIGHLIGHT,                 // 42
-     0, // RES_CHRATR_DUMMY2,                    // 43
-     0, // RES_CHRATR_DUMMY3,                    // 44
-    39, // RES_TXTATR_REFMARK,                   // 45
-    40, // RES_TXTATR_TOXMARK,                   // 46
-    41, // RES_TXTATR_META,                      // 47
-    41, // RES_TXTATR_METAFIELD,                 // 48
-     0, // RES_TXTATR_AUTOFMT,                   // 49
-     0, // RES_TXTATR_INETFMT                    // 50
-     0, // RES_TXTATR_CHARFMT,                   // 51
-    42, // RES_TXTATR_CJK_RUBY,                  // 52
-     0, // RES_TXTATR_UNKNOWN_CONTAINER,         // 53
-    43, // RES_TXTATR_INPUTFIELD                 // 54
+     0, // RES_CHRATR_GRABBAG,                   // 43
+     0, // RES_CHRATR_BIDIRTL,                   // 44
+     0, // RES_CHRATR_IDCTHINT,                  // 45
+    39, // RES_TXTATR_REFMARK,                   // 46
+    40, // RES_TXTATR_TOXMARK,                   // 47
+    41, // RES_TXTATR_META,                      // 48
+    41, // RES_TXTATR_METAFIELD,                 // 49
+     0, // RES_TXTATR_AUTOFMT,                   // 50
+     0, // RES_TXTATR_INETFMT                    // 51
+     0, // RES_TXTATR_CHARFMT,                   // 52
+    42, // RES_TXTATR_CJK_RUBY,                  // 53
+     0, // RES_TXTATR_UNKNOWN_CONTAINER,         // 54
+    43, // RES_TXTATR_INPUTFIELD                 // 55
 };
 
 /*************************************************************************
diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx
index 4e6a324..ac8162d 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -3608,8 +3608,9 @@ SwAttrFnTab aCSS1AttrFnTab = {
 /* RES_CHRATR_BOX */                OutCSS1_SvxBox,
 /* RES_CHRATR_SHADOW */             0,
 /* RES_CHRATR_HIGHLIGHT */          0,
-/* RES_CHRATR_DUMMY2 */             0,
-/* RES_CHRATR_DUMMY3 */             0,
+/* RES_CHRATR_GRABBAG */            0,
+/* RES_CHRATR_BIDIRTL */            0,
+/* RES_CHRATR_IDCTHINT */           0,
 
 /* RES_TXTATR_REFMARK */            0,
 /* RES_TXTATR_TOXMARK */            0,
@@ -3639,9 +3640,9 @@ SwAttrFnTab aCSS1AttrFnTab = {
 /* RES_PARATR_HYPHENZONE*/          0,
 /* RES_PARATR_DROP */               OutCSS1_SwFmtDrop,
 /* RES_PARATR_REGISTER */           0, // neu:  Registerhaltigkeit
-/* RES_PARATR_NUMRULE */            0, // Dummy:
-/* RES_PARATR_SCRIPTSPACE */        0, // Dummy:
-/* RES_PARATR_HANGINGPUNCTUATION */ 0, // Dummy:
+/* RES_PARATR_NUMRULE */            0,
+/* RES_PARATR_SCRIPTSPACE */        0,
+/* RES_PARATR_HANGINGPUNCTUATION */ 0,
 /* RES_PARATR_FORBIDDEN_RULES */    0, // new
 /* RES_PARATR_VERTALIGN */          0, // new
 /* RES_PARATR_SNAPTOGRID*/          0, // new
diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx
index a274a7d..083b282 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -3265,9 +3265,10 @@ SwAttrFnTab aHTMLAttrFnTab = {
 /* RES_CHRATR_RSID */               0,
 /* RES_CHRATR_BOX */                OutHTML_CSS1Attr,
 /* RES_CHRATR_SHADOW */             0,
-/* RES_CHRATR_HIGHLGHT */           0,
-/* RES_CHRATR_DUMMY2 */             0,
-/* RES_CHRATR_DUMMY3 */             0,
+/* RES_CHRATR_HIGHLIGHT */          0,
+/* RES_CHRATR_GRABBAG */            0,
+/* RES_CHRATR_BIDIRTL */            0,
+/* RES_CHRATR_IDCTHINT */           0,
 
 /* RES_TXTATR_REFMARK */            0,
 /* RES_TXTATR_TOXMARK */            0,
diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx b/sw/source/filter/ww8/attributeoutputbase.hxx
index 2557d21..da7a93b 100644
--- a/sw/source/filter/ww8/attributeoutputbase.hxx
+++ b/sw/source/filter/ww8/attributeoutputbase.hxx
@@ -434,6 +434,12 @@ protected:
     /// Sfx item RES_CHRATR_CTL_WEIGHT
     virtual void CharWeightCTL( const SvxWeightItem& ) = 0;
 
+    /// Sfx item RES_CHRATR_BidiRTL
+    virtual void CharBidiRTL( const SfxPoolItem& ) = 0;
+
+    /// Sfx item RES_CHRATR_IdctHint
+    virtual void CharIdctHint( const SfxPoolItem& ) = 0;
+
     /// Sfx item RES_CHRATR_ROTATE
     virtual void CharRotate( const SvxCharRotateItem& ) = 0;
 
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 44372b6..27304ca 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4943,6 +4943,14 @@ void DocxAttributeOutput::CharWeightCTL( const SvxWeightItem& rWeight )
         m_pSerializer->singleElementNS( XML_w, XML_bCs, FSNS( XML_w, XML_val ), "false", FSEND );
 }
 
+void DocxAttributeOutput::CharBidiRTL( const SfxPoolItem& )
+{
+}
+
+void DocxAttributeOutput::CharIdctHint( const SfxPoolItem& )
+{
+}
+
 void DocxAttributeOutput::CharRotate( const SvxCharRotateItem& rRotate)
 {
     // Not rorated or we the rotation already handled?
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx
index b311f1d..9335b55f 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -507,6 +507,12 @@ protected:
     /// Sfx item RES_CHRATR_CTL_WEIGHT
     virtual void CharWeightCTL( const SvxWeightItem& rWeight );
 
+    /// Sfx item RES_CHRATR_BidiRTL
+    virtual void CharBidiRTL( const SfxPoolItem& );
+
+    /// Sfx item RES_CHRATR_IdctHint
+    virtual void CharIdctHint( const SfxPoolItem& );
+
     /// Sfx item RES_CHRATR_ROTATE
     virtual void CharRotate( const SvxCharRotateItem& rRotate );
 
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index be583d6..b03f20b 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -2340,6 +2340,14 @@ void RtfAttributeOutput::CharWeightCTL( const SvxWeightItem& rWeight )
         m_aStyles.append((sal_Int32)0);
 }
 
+void RtfAttributeOutput::CharBidiRTL( const SfxPoolItem& )
+{
+}
+
+void RtfAttributeOutput::CharIdctHint( const SfxPoolItem&)
+{
+}
+
 void RtfAttributeOutput::CharRotate( const SvxCharRotateItem& rRotate)
 {
     SAL_INFO("sw.rtf", OSL_THIS_FUNC);
diff --git a/sw/source/filter/ww8/rtfattributeoutput.hxx b/sw/source/filter/ww8/rtfattributeoutput.hxx
index 24fefa2..c64b8e0 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.hxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.hxx
@@ -295,6 +295,12 @@ protected:
     /// Sfx item RES_CHRATR_CTL_WEIGHT
     virtual void CharWeightCTL( const SvxWeightItem& rWeight );
 
+    /// Sfx item RES_CHRATR_BidiRTL
+    virtual void CharBidiRTL( const SfxPoolItem& );
+
+    /// Sfx item RES_CHRATR_IdctHint
+    virtual void CharIdctHint( const SfxPoolItem& );
+
     /// Sfx item RES_CHRATR_ROTATE
     virtual void CharRotate( const SvxCharRotateItem& rRotate );
 
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index cf87602..cad1e42 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -921,8 +921,11 @@ void WW8AttributeOutput::RTLAndCJKState( bool bIsRTL, sal_uInt16 nScript )
 {
     if ( m_rWW8Export.bWrtWW8 && bIsRTL )
     {
-        m_rWW8Export.InsUInt16( NS_sprm::LN_CFBiDi );
-        m_rWW8Export.pO->push_back( (sal_uInt8)1 );
+        if( m_rWW8Export.pDoc->GetDocumentType() != SwDoc::DOCTYPE_MSWORD )
+        {
+            m_rWW8Export.InsUInt16( NS_sprm::LN_CFBiDi );
+            m_rWW8Export.pO->push_back( (sal_uInt8)1 );
+        }
     }
 
     // #i46087# patch from james_clark; complex texts needs the undocumented SPRM CComplexScript with param 0x81.
@@ -1482,6 +1485,23 @@ void WW8AttributeOutput::CharRelief( const SvxCharReliefItem& rRelief )
     }
 }
 
+void WW8AttributeOutput::CharBidiRTL( const SfxPoolItem& rHt )
+{
+    const SfxInt16Item& rAttr = (const SfxInt16Item&)rHt;
+    if( rAttr.GetValue() == 1 )
+    {
+        m_rWW8Export.InsUInt16(0x85a);
+        m_rWW8Export.pO->push_back((sal_uInt8)(1));
+    }
+}
+
+void WW8AttributeOutput::CharIdctHint( const SfxPoolItem& rHt )
+{
+    const SfxInt16Item& rAttr = (const SfxInt16Item&)rHt;
+    m_rWW8Export.InsUInt16(0x286F);
+    m_rWW8Export.pO->push_back((sal_uInt8)(rAttr.GetValue()));
+}
+
 void WW8AttributeOutput::CharRotate( const SvxCharRotateItem& rRotate )
 {
     // #i28331# - check that a Value is set
@@ -5226,7 +5246,12 @@ void AttributeOutputBase::OutputItem( const SfxPoolItem& rHt )
         case RES_CHRATR_HIGHLIGHT:
             CharHighlight( static_cast< const SvxBrushItem& >( rHt ) );
             break;
-
+        case RES_CHRATR_BIDIRTL:
+            CharBidiRTL( static_cast< const SfxPoolItem& >( rHt ) );
+            break;
+        case RES_CHRATR_IDCTHINT:
+            CharIdctHint( static_cast< const SfxPoolItem& >( rHt ) );
+            break;
         case RES_TXTATR_INETFMT:
             TextINetFormat( static_cast< const SwFmtINetFmt& >( rHt ) );
             break;
diff --git a/sw/source/filter/ww8/ww8attributeoutput.hxx b/sw/source/filter/ww8/ww8attributeoutput.hxx
index bca05b7..8fc38db 100644
--- a/sw/source/filter/ww8/ww8attributeoutput.hxx
+++ b/sw/source/filter/ww8/ww8attributeoutput.hxx
@@ -281,6 +281,12 @@ protected:
     /// Sfx item RES_CHRATR_CTL_WEIGHT
     virtual void CharWeightCTL( const SvxWeightItem& );
 
+    /// Sfx item RES_CHRATR_BidiRTL
+    virtual void CharBidiRTL( const SfxPoolItem& rHt );
+
+    /// Sfx item RES_CHRATR_IdctHint
+    virtual void CharIdctHint( const SfxPoolItem& rHt );
+
     /// Sfx item RES_CHRATR_ROTATE
     virtual void CharRotate( const SvxCharRotateItem& );
 
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index dcc3d8f..8e715c5 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -3205,6 +3205,10 @@ namespace
 // to auto-bias to LATIN.
 //
 // See https://bugs.libreoffice.org/show_bug.cgi?id=34319 for an example
+//
+// TO-DO: revisit this after the fix of #i119612# which retains the
+// idcthint feature on import from word and has it available for reexport
+// but we don't use it yet for the actual rendering and layout
 void SwWW8ImplReader::emulateMSWordAddTextToParagraph(const OUString& rAddString)
 {
     if (rAddString.isEmpty())
@@ -4809,6 +4813,7 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos)
 {
     sal_uLong nErrRet = 0;
 
+    rDoc.SetDocumentType( SwDoc::DOCTYPE_MSWORD );
     if (mbNewDoc && pStg && !pGloss)
         ReadDocInfo();
 
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 8b4e254..c3aa747 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -2858,12 +2858,19 @@ void SwWW8ImplReader::Read_BoldUsw( sal_uInt16 nId, const sal_uInt8* pData, shor
     SetToggleAttr( nI, bOn );
 }
 
-void SwWW8ImplReader::Read_Bidi(sal_uInt16, const sal_uInt8*, short nLen)
+void SwWW8ImplReader::Read_Bidi(sal_uInt16, const sal_uInt8* pData, short nLen)
 {
-    if (nLen > 0)
-        bBidi = true;
-    else
-        bBidi = false;
+    if( nLen < 0 )  //Property end
+    {
+        bBidi = sal_False;
+        pCtrlStck->SetAttr(*pPaM->GetPoint(),RES_CHRATR_BIDIRTL);
+    }
+    else    //Property start
+    {
+        bBidi = sal_True;
+        sal_uInt8 nBidi = *pData;
+        NewAttr( SfxInt16Item( RES_CHRATR_BIDIRTL, (nBidi!=0)? 1 : 0 ) );
+    }
 }
 
 // Read_BoldUsw for BiDi Italic, Bold
@@ -4205,10 +4212,20 @@ void SwWW8ImplReader::Read_ParaContextualSpacing( sal_uInt16, const sal_uInt8* p
 
 void SwWW8ImplReader::Read_IdctHint( sal_uInt16, const sal_uInt8* pData, short nLen )
 {
-    if (nLen < 0)
-        nIdctHint = 0;
-    else
-        nIdctHint = *pData;
+    // sprmcidcthint (opcode 0x286f) specifies a script bias for the text in the run.
+    // for unicode characters that are shared between far east and non-far east scripts,
+    // this property determines what font and language the character will use.
+    // when this value is 0, text properties bias towards non-far east properties.
+    // when this value is 1, text properties bias towards far east properties.
+    if( nLen < 0 )  //Property end
+    {
+        pCtrlStck->SetAttr(*pPaM->GetPoint(),RES_CHRATR_IDCTHINT);
+    }
+    else    //Property start
+    {
+        sal_uInt8 nVal = *pData;
+        NewAttr( SfxInt16Item( RES_CHRATR_IDCTHINT, (nVal!=0)? 1 : 0 ) );
+    }
 }
 
 void SwWW8ImplReader::Read_Justify( sal_uInt16, const sal_uInt8* pData, short nLen )


More information about the Libreoffice-commits mailing list