ooo-build r13669 - in trunk: . patches/dev300



Author: strba
Date: Mon Aug 25 16:48:57 2008
New Revision: 13669
URL: http://svn.gnome.org/viewvc/ooo-build?rev=13669&view=rev

Log:
Don't apply character styles to 0x15 character that terminates a field in WinWord8

Added:
   trunk/patches/dev300/sw-ww8-fieldandcharstyle.diff
Modified:
   trunk/ChangeLog
   trunk/patches/dev300/apply

Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply	(original)
+++ trunk/patches/dev300/apply	Mon Aug 25 16:48:57 2008
@@ -61,7 +61,7 @@
 SUSE-10.2 : NovellBase, BerkeleyDB43, EMFPlus
 SUSE-10.3 : NovellBase, BerkeleyDB43, EMFPlus
 SUSE-11.0 : NovellBase, BerkeleyDB43, Gcc43, EMFPlus, CairoFonts
-SUSE      : NovellBase, BerkeleyDB43, Gcc43, EMFPlus, CairoFonts
+SUSE      : NovellBase, BerkeleyDB43, Gcc43, EMFPlus, CairoFonts, UnstableLibwpd
 SUSE-reduced:NovellBase,BerkeleyDB43, ReducedDefaults
 # Debian
 DebianBase : LinuxCommon, DebianBaseOnly, Lockdown, GCCSTL, BerkeleyDB43, Split, PostgreSQL
@@ -2456,6 +2456,8 @@
 
 sw-source-filter-ww8-continous-section-break-fix.diff, n#405071, i#91395, fridrich
 
+sw-ww8-fieldandcharstyle.diff, n#414471, i#93105, fridrich
+
 unoxml-boost-workaround.diff, thorsten
 
 [ LocalizeFixes ]

Added: trunk/patches/dev300/sw-ww8-fieldandcharstyle.diff
==============================================================================
--- (empty file)
+++ trunk/patches/dev300/sw-ww8-fieldandcharstyle.diff	Mon Aug 25 16:48:57 2008
@@ -0,0 +1,188 @@
+--- sw/source/filter/ww8/wrtw8nds.cxx	8 Jul 2008 08:29:15 -0000	1.109
++++ sw/source/filter/ww8/wrtw8nds.cxx	25 Aug 2008 15:29:32 -0000
+@@ -1641,11 +1641,27 @@
+                 }
+             }
+         }
+-                                        // Ausgabe der Zeichenattribute
+-        aAttrIter.OutAttr( nAktPos );   // nAktPos - 1 ??
+-        rWW8Wrt.pChpPlc->AppendFkpEntry( rWrt.Strm().Tell(),
++
++        WW8_WrPlcFld* pCurrentFields = rWW8Wrt.CurrentFieldPlc();
++        USHORT nOldFieldResults = pCurrentFields ? pCurrentFields->ResultCount() : 0;
++
++        // Export of Character attributes
++        aAttrIter.OutAttr( nAktPos );  // nAktPos - 1 ??
++
++        pCurrentFields = rWW8Wrt.CurrentFieldPlc();
++        USHORT nNewFieldResults = pCurrentFields ? pCurrentFields->ResultCount() : 0;
++
++        bool bExportedFieldResult = nOldFieldResults != nNewFieldResults;
++	//If we have exported a field result, then we will have been forced to
++	//split up the text into a 0x13, 0x14, <result> 0x15 sequence with the
++	//properties forced out at the end of the result, so the 0x15 itself
++	//should remain clean of all other attributes to avoid #i93105#
++        if (!bExportedFieldResult)
++        {
++            rWW8Wrt.pChpPlc->AppendFkpEntry( rWrt.Strm().Tell(),
+                                             pO->Count(), pO->GetData() );
+-        pO->Remove( 0, pO->Count() );                   // leeren
++        }
++        pO->Remove( 0, pO->Count() );                   // erase
+ 
+                     // Ausnahme: Fussnoten am Zeilenende
+         if (nNextAttr == nEnd)
+--- sw/source/filter/ww8/wrtww8.hxx	10 Apr 2008 17:22:10 -0000	1.76
++++ sw/source/filter/ww8/wrtww8.hxx	25 Aug 2008 15:29:34 -0000
+@@ -710,6 +710,8 @@
+     void AddLinkTarget(const String& rURL);
+     void CollectOutlineBookmarks(const SwDoc &rDoc);
+     void AddBookmark(String sBkmkName);
++
++    WW8_WrPlcFld* CurrentFieldPlc() const;
+ private:
+     //No copying
+     SwWW8Writer(const SwWW8Writer&);
+@@ -842,15 +844,18 @@
+ {
+ private:
+     BYTE nTxtTyp;
++    USHORT nResults;
+ 
+     //No copying
+     WW8_WrPlcFld(const WW8_WrPlcFld&);
+     WW8_WrPlcFld& operator=(const WW8_WrPlcFld&);
+ public:
+     WW8_WrPlcFld( USHORT nStructSz, BYTE nTTyp )
+-        : WW8_WrPlc1( nStructSz ), nTxtTyp( nTTyp )
++        : WW8_WrPlc1( nStructSz ), nTxtTyp( nTTyp ), nResults(0)
+     {}
+     bool Write( SwWW8Writer& rWrt );
++    void ResultAdded() { ++nResults; }
++    USHORT ResultCount() const { return nResults; }
+ };
+ 
+ class WW8_WrMagicTable : public WW8_WrPlc1
+--- sw/source/filter/ww8/ww8atr.cxx	8 Jul 2008 08:30:16 -0000	1.113
++++ sw/source/filter/ww8/ww8atr.cxx	25 Aug 2008 15:29:35 -0000
+@@ -1695,20 +1695,29 @@
+         rStrm.Seek( nCurrPos );
+ 
+         // write attributes of hyperlink character 0x01
+-        SwWW8Writer::InsUInt16( aItems, 0x0802 );
++        SwWW8Writer::InsUInt16( aItems, 0x0802 ); //sprmCFFldVanish
+         aItems.Insert( (BYTE)0x81, aItems.Count() );
+         SwWW8Writer::InsUInt16( aItems, 0x6a03 );
+         SwWW8Writer::InsUInt32( aItems, nLinkPosInDataStrm );
+         SwWW8Writer::InsUInt16( aItems, 0x0806 );
+         aItems.Insert( (BYTE)0x01, aItems.Count() );
+     }
+-    // <--
+-    // fSpec-Attribut true
++
++    //Technically we should probably Remove all attribs
++    //here for the 0x13, 0x14, 0x15, but our import
++    //is slightly lacking
++    //aItems.Remove(0, aItems.Count());
++    // fSpec-Attribute true
+     if( rWrt.bWrtWW8 )
+-        SwWW8Writer::InsUInt16( aItems, 0x855 );
++    {
++        SwWW8Writer::InsUInt16( aItems, 0x855 ); //sprmCFSpec
++        aItems.Insert( 1, aItems.Count() );
++    }
+     else
+-        aItems.Insert( 117, aItems.Count() );
+-    aItems.Insert( 1, aItems.Count() );
++    {
++        aItems.Insert( 117, aItems.Count() ); //sprmCFSpec
++        aItems.Insert( 1, aItems.Count() );
++    }
+ 
+     rWrt.pChpPlc->AppendFkpEntry(rWrt.Strm().Tell(), aItems.Count(),
+         aItems.GetData());
+@@ -1724,11 +1730,9 @@
+     return sRet;
+ }
+ 
+-void SwWW8Writer::OutField(const SwField* pFld, ww::eField eFldType,
+-    const String& rFldCmd, BYTE nMode)
++WW8_WrPlcFld* SwWW8Writer::CurrentFieldPlc() const
+ {
+-    bool bUnicode = IsUnicode();
+-    WW8_WrPlcFld* pFldP;
++    WW8_WrPlcFld* pFldP = NULL;
+     switch (nTxtTyp)
+     {
+         case TXT_MAINTEXT:
+@@ -1751,8 +1755,15 @@
+             break;
+         default:
+             ASSERT( !this, "was ist das fuer ein SubDoc-Type?" );
+-            return;
+     }
++    return pFldP;
++}
++
++void SwWW8Writer::OutField(const SwField* pFld, ww::eField eFldType,
++    const String& rFldCmd, BYTE nMode)
++{
++    bool bUnicode = IsUnicode();
++    WW8_WrPlcFld* pFldP = CurrentFieldPlc();
+ 
+     if (WRITEFIELD_START & nMode)
+     {
+@@ -1820,6 +1831,7 @@
+     {
+         static const BYTE aFld14[2] = { 0x14, 0xff };
+         pFldP->Append( Fc2Cp( Strm().Tell() ), aFld14 );
++        pFldP->ResultAdded();
+         InsertSpecialChar( *this, 0x14 );
+     }
+     if (WRITEFIELD_END & nMode)
+@@ -1847,16 +1859,25 @@
+                     BYTE aArr[12];
+                     BYTE *pArr = aArr;
+ 
+-                    Set_UInt16(pArr, 0x6a03);
+-                    Set_UInt32(pArr, 0x0);
+-
+                     if( bWrtWW8 )
+-                        Set_UInt16( pArr, 0x855 );
++                    {
++                        Set_UInt16(pArr, 0x6a03); //sprmCPicLocation
++                        Set_UInt32(pArr, 0x0);
++
++                        Set_UInt16( pArr, 0x855 );//sprmCFSpec
++                        Set_UInt8( pArr, 1 );
++
++                        Set_UInt16( pArr, 0x875 );//sprmCFNoProof
++                        Set_UInt8(pArr, 1);
++                    }
+                     else
+-                        Set_UInt8( pArr, 117 );
+-                    Set_UInt8( pArr, 1 );
+-                    Set_UInt16( pArr, 0x875 );
+-                    Set_UInt8(pArr, 1);
++                    {
++                        Set_UInt8(pArr, 0x68); //sprmCPicLocation
++                        Set_UInt32(pArr, 0x0);
++
++                        Set_UInt8( pArr, 117 ); //sprmCFSpec
++                        Set_UInt8( pArr, 1 );
++                    }
+                     pChpPlc->AppendFkpEntry( pStrm->Tell(), static_cast< short >(pArr - aArr), aArr );
+                 }
+             }
+@@ -2322,9 +2343,9 @@
+ 
+     // sprmCFSpec true
+     if( bWrtWW8 )
+-        Set_UInt16( pArr, 0x855 );
++        Set_UInt16( pArr, 0x855 ); //sprmCFSpec
+     else
+-        Set_UInt8( pArr, 117 );
++        Set_UInt8( pArr, 117 ); //sprmCFSpec
+     Set_UInt8( pArr, 1 );
+ 
+     pChpPlc->AppendFkpEntry( Strm().Tell() );



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]