[ooo-build-commit] .: 3 commits - patches/dev300

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Wed Sep 22 02:00:41 PDT 2010


 patches/dev300/apply                       |    5 +
 patches/dev300/dummy-fields-ole-links.diff |   65 +++++++++++++++++++
 patches/dev300/fields-nested-set.diff      |   95 +++++++++++++++++++++++++++++
 patches/dev300/sw-table-frame-uno-fix.diff |   72 +++++++++++++++++++++
 4 files changed, 237 insertions(+)

New commits:
commit c1c99d3f3fc3809015ea689444ce17909153a618
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Wed Sep 22 10:59:16 2010 +0200

    Backported fix for i#112564 from cbosdo06 CWS

diff --git a/patches/dev300/apply b/patches/dev300/apply
index 3b280c9..13e1d8d 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -2184,6 +2184,9 @@ dummy-fields-ole-links.diff, n#628098, cbosdo
 fields-nested-set.diff, n#634478, cbosdo
 fields-double-click.diff, n#639288, cbosdo
 
+# Backport from cbosdo06 CWS
+sw-table-frame-uno-fix.diff, i#112564, cbosdo
+
 svx-hacky-htmlselect-control-import.diff, n#523191, noelpwer
 
 sd-slideshow-slideshowview-transformation-fix.diff, rodo
diff --git a/patches/dev300/sw-table-frame-uno-fix.diff b/patches/dev300/sw-table-frame-uno-fix.diff
new file mode 100644
index 0000000..37b793b
--- /dev/null
+++ b/patches/dev300/sw-table-frame-uno-fix.diff
@@ -0,0 +1,72 @@
+diff --git sw/inc/doc.hxx sw/inc/doc.hxx
+index baaeef6..0344486 100644
+--- sw/inc/doc.hxx
++++ sw/inc/doc.hxx
+@@ -1096,7 +1096,8 @@ public:
+     // ( Start < Pos < End ) !!!
+     // (wird fuer die Writer benoetigt)
+     void GetAllFlyFmts( SwPosFlyFrms& rPosFlyFmts, const SwPaM* = 0,
+-                        sal_Bool bDrawAlso = sal_False ) const;
++                        sal_Bool bDrawAlso = sal_False, 
++                        sal_Bool bAsCharAlso = sal_False ) const;
+ 
+     // wegen swrtf.cxx und define private public, jetzt hier
+     SwFlyFrmFmt  *MakeFlyFrmFmt (const String &rFmtName, SwFrmFmt *pDerivedFrom);
+diff --git sw/source/core/doc/doclay.cxx sw/source/core/doc/doclay.cxx
+index 021bb55..3f8eb9d 100644
+--- sw/source/core/doc/doclay.cxx
++++ sw/source/core/doc/doclay.cxx
+@@ -1088,7 +1088,8 @@ sal_Bool TstFlyRange( const SwPaM* pPam, const SwPosition* pFlyPos,
+ 
+ 
+ void SwDoc::GetAllFlyFmts( SwPosFlyFrms& rPosFlyFmts,
+-                           const SwPaM* pCmpRange, sal_Bool bDrawAlso ) const
++                           const SwPaM* pCmpRange, sal_Bool bDrawAlso,
++                           sal_Bool bAsCharAlso ) const
+ {
+     SwPosFlyFrm *pFPos = 0;
+     SwFrmFmt *pFly;
+@@ -1106,7 +1107,8 @@ void SwDoc::GetAllFlyFmts( SwPosFlyFrms& rPosFlyFmts,
+             if (pAPos &&
+                 ((FLY_AT_PARA == rAnchor.GetAnchorId()) ||
+                  (FLY_AT_FLY  == rAnchor.GetAnchorId()) ||
+-                 (FLY_AT_CHAR == rAnchor.GetAnchorId())))
++                 (FLY_AT_CHAR == rAnchor.GetAnchorId()) ||
++                 ((FLY_AS_CHAR == rAnchor.GetAnchorId()) && bAsCharAlso)))
+             {
+                 if( pCmpRange &&
+                     !TstFlyRange( pCmpRange, pAPos, rAnchor.GetAnchorId() ))
+diff --git sw/source/core/unocore/unoobj2.cxx sw/source/core/unocore/unoobj2.cxx
+index 1b3ed92..66dabf1 100644
+--- sw/source/core/unocore/unoobj2.cxx
++++ sw/source/core/unocore/unoobj2.cxx
+@@ -1975,7 +1975,7 @@ SwXParaFrameEnumeration::SwXParaFrameEnumeration(
+         {
+             SwPosFlyFrms aFlyFrms;
+             //get all frames that are bound at paragraph or at character
+-            rPaM.GetDoc()->GetAllFlyFmts(aFlyFrms, m_pImpl->GetCursor());
++            rPaM.GetDoc()->GetAllFlyFmts(aFlyFrms, m_pImpl->GetCursor(), sal_False, sal_True);
+             for(USHORT i = 0; i < aFlyFrms.Count(); i++)
+             {
+                 SwPosFlyFrm* pPosFly = aFlyFrms[i];
+@@ -1987,20 +1987,6 @@ SwXParaFrameEnumeration::SwXParaFrameEnumeration(
+                 m_pImpl->m_Frames.push_back(
+                         ::boost::shared_ptr<SwDepend>(pNewDepend) );
+             }
+-            //created from any text range
+-            if (m_pImpl->GetCursor()->HasMark())
+-            {
+-                m_pImpl->GetCursor()->Normalize();
+-                do
+-                {
+-                    lcl_FillFrame(*m_pImpl.get(), *m_pImpl->GetCursor(),
+-                            m_pImpl->m_Frames);
+-                    m_pImpl->GetCursor()->Right(
+-                            1, CRSR_SKIP_CHARS, FALSE, FALSE);
+-                }
+-                while (*m_pImpl->GetCursor()->GetPoint() <
+-                        *m_pImpl->GetCursor()->GetMark());
+-            }
+         }
+         lcl_FillFrame(*m_pImpl.get(), *m_pImpl->GetCursor(), m_pImpl->m_Frames);
+     }
commit fce7167b324d537ceef098ff23093a793d0cf976
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Wed Sep 22 10:03:44 2010 +0200

    n#634478: WW8 nested SET/FILLIN fields import improvement

diff --git a/patches/dev300/apply b/patches/dev300/apply
index 47e05e4..3b280c9 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -2181,6 +2181,7 @@ dummy-fields.diff, n#628098, cbosdo
 empty-fields.diff, n#623944, cbosdo
 floating-tables.diff n#617593, cbosdo
 dummy-fields-ole-links.diff, n#628098, cbosdo
+fields-nested-set.diff, n#634478, cbosdo
 fields-double-click.diff, n#639288, cbosdo
 
 svx-hacky-htmlselect-control-import.diff, n#523191, noelpwer
diff --git a/patches/dev300/fields-nested-set.diff b/patches/dev300/fields-nested-set.diff
new file mode 100644
index 0000000..e0fac16
--- /dev/null
+++ b/patches/dev300/fields-nested-set.diff
@@ -0,0 +1,95 @@
+diff --git sw/source/filter/ww8/ww8par5.cxx sw/source/filter/ww8/ww8par5.cxx
+index f22d1b5..0976a9c 100644
+--- sw/source/filter/ww8/ww8par5.cxx
++++ sw/source/filter/ww8/ww8par5.cxx
+@@ -238,20 +238,29 @@ xub_StrLen _ReadFieldParams::FindNextStringPiece(const xub_StrLen nStart)
+ 
+     while( (nLen > n) && (aData.GetChar( n ) == ' ') )
+         ++n;
++    
++    if ( aData.GetChar( n ) == 0x13 )
++    {
++        // Skip the nested field code since it's not supported
++        while ( ( nLen > n ) && ( aData.GetChar( n ) != 0x14 ) )
++            n++;
++    }
+ 
+     if( nLen == n )
+         return STRING_NOTFOUND;     // String End reached!
+ 
+     if(     (aData.GetChar( n ) == '"')     // Anfuehrungszeichen vor Para?
+         ||  (aData.GetChar( n ) == 0x201c)
+-        ||  (aData.GetChar( n ) == 132) )
++        ||  (aData.GetChar( n ) == 132)
++        ||  (aData.GetChar( n ) == 0x14) )
+     {
+         n++;                        // Anfuehrungszeichen ueberlesen
+         n2 = n;                     // ab hier nach Ende suchen
+         while(     (nLen > n2)
+                 && (aData.GetChar( n2 ) != '"')
+                 && (aData.GetChar( n2 ) != 0x201d)
+-                && (aData.GetChar( n2 ) != 147) )
++                && (aData.GetChar( n2 ) != 147)
++                && (aData.GetChar( n2 ) != 0x15) )
+             n2++;                   // Ende d. Paras suchen
+     }
+     else                        // keine Anfuehrungszeichen
+@@ -1027,6 +1036,8 @@ long SwWW8ImplReader::Read_Field(WW8PLCFManResult* pRes)
+ 
+     ASSERT(bOk, "WW8: Bad Field!\n");
+     if (aF.nId == 33) aF.bCodeNest=false; //#124716#: do not recurse into nested page fields
++    bool bCodeNest = aF.bCodeNest;
++    if ( aF.nId == 6 ) bCodeNest = false; // We can handle them and loose the inner data
+ 
+     maFieldStack.push_back(FieldEntry(*pPaM->GetPoint(), aF.nId));
+ 
+@@ -1056,7 +1067,7 @@ long SwWW8ImplReader::Read_Field(WW8PLCFManResult* pRes)
+         return aF.nLen;
+ 
+     // keine Routine vorhanden
+-    if (bNested || !aWW8FieldTab[aF.nId] || aF.bCodeNest)
++    if (bNested || !aWW8FieldTab[aF.nId] || bCodeNest)
+     {
+         if( nFieldTagBad[nI] & nMask )      // Flag: Tag it when bad
+             return Read_F_Tag( &aF );       // Resultat nicht als Text
+@@ -1075,8 +1086,9 @@ long SwWW8ImplReader::Read_Field(WW8PLCFManResult* pRes)
+         if ( STRING_NOTFOUND == nSpacePos )
+             nSpacePos = aStr.Len( );
+         xub_StrLen nSearchPos = STRING_NOTFOUND;
+-        if ( ( ( nSearchPos = aStr.Search('.') ) != STRING_NOTFOUND && nSearchPos < nSpacePos ) ||
+-             ( ( nSearchPos = aStr.Search('/') ) != STRING_NOTFOUND && nSearchPos < nSpacePos ) )
++        if ( !( aStr.EqualsAscii( "=", 1, 1 ) ) && (
++                ( ( nSearchPos = aStr.Search('.') ) != STRING_NOTFOUND && nSearchPos < nSpacePos ) ||
++                ( ( nSearchPos = aStr.Search('/') ) != STRING_NOTFOUND && nSearchPos < nSpacePos ) ) )
+             return aF.nLen;
+         else
+         {
+@@ -1094,8 +1106,17 @@ long SwWW8ImplReader::Read_Field(WW8PLCFManResult* pRes)
+     {                                   // Lies Feld
+         long nOldPos = pStrm->Tell();
+         String aStr;
+-        aF.nLCode = pSBase->WW8ReadString( *pStrm, aStr, pPlcxMan->GetCpOfs()+
+-            aF.nSCode, aF.nLCode, eTextCharSet );
++        if ( aF.nId == 6 && aF.bCodeNest )
++        {
++            // TODO Extract the whole code string using the nested codes
++            aF.nLCode = pSBase->WW8ReadString( *pStrm, aStr, pPlcxMan->GetCpOfs() +
++                aF.nSCode, aF.nSRes - aF.nSCode - 1, eTextCharSet );
++        }
++        else
++        {
++            aF.nLCode = pSBase->WW8ReadString( *pStrm, aStr, pPlcxMan->GetCpOfs()+
++                aF.nSCode, aF.nLCode, eTextCharSet );
++        }
+ 
+         // --> OD 2005-07-25 #i51312# - graphics inside field code not supported
+         // by Writer. Thus, delete character 0x01, which stands for such a graphic.
+@@ -2149,7 +2170,7 @@ eF_ResT SwWW8ImplReader::Read_F_Ref( WW8FieldDesc*, String& rStr )
+             */
+             SwGetRefField aFld(
+                 (SwGetRefFieldType*)rDoc.GetSysFldType( RES_GETREFFLD ),
+-                sOrigBkmName,REF_BOOKMARK,0,REF_CONTENT);
++                sBkmName,REF_BOOKMARK,0,REF_CONTENT);
+             pReffingStck->NewAttr( *pPaM->GetPoint(), SwFmtFld(aFld) );
+             pReffingStck->SetAttr( *pPaM->GetPoint(), RES_TXTATR_FIELD);
+         }
commit 221ac00ddc102c96d954fac57301fd523fb470d5
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Wed Sep 22 09:46:48 2010 +0200

    n#628098: WW8 OLE Links with image inside were badly imported

diff --git a/patches/dev300/apply b/patches/dev300/apply
index 65ca71d..47e05e4 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -2180,6 +2180,7 @@ fix-ppt-linespacing-import-export.diff, n#355302, rodo
 dummy-fields.diff, n#628098, cbosdo
 empty-fields.diff, n#623944, cbosdo
 floating-tables.diff n#617593, cbosdo
+dummy-fields-ole-links.diff, n#628098, cbosdo
 fields-double-click.diff, n#639288, cbosdo
 
 svx-hacky-htmlselect-control-import.diff, n#523191, noelpwer
diff --git a/patches/dev300/dummy-fields-ole-links.diff b/patches/dev300/dummy-fields-ole-links.diff
new file mode 100644
index 0000000..664f4f4
--- /dev/null
+++ b/patches/dev300/dummy-fields-ole-links.diff
@@ -0,0 +1,65 @@
+diff --git sw/source/filter/ww8/ww8par.hxx sw/source/filter/ww8/ww8par.hxx
+index 8f25441..6cddc25 100644
+--- sw/source/filter/ww8/ww8par.hxx
++++ sw/source/filter/ww8/ww8par.hxx
+@@ -369,6 +369,7 @@ class FieldEntry
+     public:
+         sw::hack::Position maStartPos;
+         sal_uInt16 mnFieldId;
++        ULONG mnObjLocFc;
+         FieldEntry(SwPosition &rPos, sal_uInt16 nFieldId) throw();
+         FieldEntry(const FieldEntry &rOther) throw();
+         FieldEntry &operator=(const FieldEntry &rOther) throw();
+diff --git sw/source/filter/ww8/ww8par5.cxx sw/source/filter/ww8/ww8par5.cxx
+index fe2119c..5b80db4 100644
+--- sw/source/filter/ww8/ww8par5.cxx
++++ sw/source/filter/ww8/ww8par5.cxx
+@@ -762,11 +762,11 @@ sal_uInt16 SwWW8ImplReader::End_Field()
+                                     rtl::OUString::createFromAscii( ODF_CODE_PARAM ),
+                                     uno::makeAny( aCode ) ) );
+ 
+-                        if ( nObjLocFc > 0 )
++                        if ( maFieldStack.back().mnObjLocFc > 0 )
+                         {
+                             // Store the OLE object as an internal link
+                             String sOleId = '_';
+-                            sOleId += String::CreateFromInt32( nObjLocFc );
++                            sOleId += String::CreateFromInt32( maFieldStack.back().mnObjLocFc );
+ 
+                             SvStorageRef xSrc0 = pStg->OpenSotStorage(CREATE_CONST_ASC(SL::aObjectPool));
+                             SvStorageRef xSrc1 = xSrc0->OpenSotStorage( sOleId, STREAM_READ );
+@@ -830,12 +830,12 @@ bool AcceptableNestedField(sal_uInt16 nFieldCode)
+ }
+ 
+ FieldEntry::FieldEntry(SwPosition &rPos, sal_uInt16 nFieldId) throw()
+-    : maStartPos(rPos), mnFieldId(nFieldId)
++    : maStartPos(rPos), mnFieldId(nFieldId), mnObjLocFc(0)
+ {
+ }
+ 
+ FieldEntry::FieldEntry(const FieldEntry &rOther) throw()
+-    : maStartPos(rOther.maStartPos), mnFieldId(rOther.mnFieldId)
++    : maStartPos(rOther.maStartPos), mnFieldId(rOther.mnFieldId), mnObjLocFc(rOther.mnObjLocFc)
+ {
+ }
+ 
+diff --git sw/source/filter/ww8/ww8par6.cxx sw/source/filter/ww8/ww8par6.cxx
+index cf60083..a049e09 100644
+--- sw/source/filter/ww8/ww8par6.cxx
++++ sw/source/filter/ww8/ww8par6.cxx
+@@ -2827,7 +2827,14 @@ void SwWW8ImplReader::Read_Obj(USHORT , const BYTE* pData, short nLen)
+         bObj = 0 != *pData;
+ 
+         if( bObj && nPicLocFc && bEmbeddObj )
+-            nObjLocFc = nPicLocFc;
++        {
++            if ( maFieldStack.back().mnFieldId == 56 ) {
++                // For LINK fields, store the nObjLocFc value in the field entry
++                maFieldStack.back().mnObjLocFc = nPicLocFc;
++            } else {
++                nObjLocFc = nPicLocFc;
++            }
++        }
+     }
+ }
+ 


More information about the ooo-build-commit mailing list