[ooo-build-commit] .: Branch 'ooo-build-3-2-1' - 4 commits - patches/dev300

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Fri Sep 17 01:19:17 PDT 2010


 patches/dev300/apply                        |    7 -
 patches/dev300/dummy-fields-ole-links.diff  |   78 +++++++++++
 patches/dev300/fields-double-click.diff     |   61 +++++++++
 patches/dev300/fields-nested-set.diff       |   95 ++++++++++++++
 patches/dev300/pdf-link-export-fix.diff     |  184 ++++++++++++++++++++++++++++
 patches/dev300/skip-empty-links-in-pdf.diff |   11 -
 6 files changed, 423 insertions(+), 13 deletions(-)

New commits:
commit 5842c9211218432206217d246b8b60bfd240b325
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Fri Sep 17 10:15:14 2010 +0200

    Fixed the pdf links export
    
    * patches/dev300/apply:
        Applied all the patches
    
    * patches/dev300/pdf-link-export-fix.diff:
        Fix for n#598816, n#639278, n#615812
    * patches/dev300/skip-empty-links-in-pdf.diff:
        Removed wrong fix

diff --git a/patches/dev300/apply b/patches/dev300/apply
index 7c493b6..1de3768 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -3046,6 +3046,9 @@ field-patch-lock.diff, n#601355, cbosdo
 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
 
 sw-import-html-controls.diff, n#485609, freuter
 svx-hacky-htmlselect-control-import.diff, n#523191, noelpwer
@@ -4027,8 +4030,8 @@ extensions-geometry-in-control-propsheet-fix.diff, bnc#610921, cbosdo
 # In some cases when exporting a PDF from a presentation, we are asked
 # to export an empty "link annotation", which gets turned into a
 # rather bogus file: link to the directory the presentadion document
-# is in.  Just don't bother handling such empty "link annotations".
-skip-empty-links-in-pdf.diff, bnc#598816, tml
+# is in.
+pdf-link-export-fix.diff, n#598816, n#639278, cbosdo
 
 # don't set header in DDE tables, usually not what the user wants
 sw-dde-table-no-header.diff, n#634517, jholesov
diff --git a/patches/dev300/pdf-link-export-fix.diff b/patches/dev300/pdf-link-export-fix.diff
new file mode 100644
index 0000000..1bd93b0
--- /dev/null
+++ b/patches/dev300/pdf-link-export-fix.diff
@@ -0,0 +1,184 @@
+diff --git sd/source/ui/unoidl/unomodel.cxx sd/source/ui/unoidl/unomodel.cxx
+index d7e36f9..ec181ed 100644
+--- sd/source/ui/unoidl/unomodel.cxx
++++ sd/source/ui/unoidl/unomodel.cxx
+@@ -1947,7 +1947,9 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r
+                                     // if necessary, the master page interactions will be exported first
+                                     sal_Bool bIsBackgroundObjectsVisible = sal_False;	// SJ: #i39428# IsBackgroundObjectsVisible not available for Draw
+                                     const rtl::OUString sIsBackgroundObjectsVisible( RTL_CONSTASCII_USTRINGPARAM( "IsBackgroundObjectsVisible" ) );
+-                                    if ( mbImpressDoc && ( xPagePropSet->getPropertyValue( sIsBackgroundObjectsVisible ) >>= bIsBackgroundObjectsVisible ) && bIsBackgroundObjectsVisible )
++                                    if ( xPagePropSet->getPropertySetInfo( )->hasPropertyByName( sIsBackgroundObjectsVisible ) )
++                                        xPagePropSet->getPropertyValue( sIsBackgroundObjectsVisible ) >>= bIsBackgroundObjectsVisible;
++                                    if ( mbImpressDoc && bIsBackgroundObjectsVisible )
+                                     {
+                                         uno::Reference< drawing::XMasterPageTarget > xMasterPageTarget( xPage, uno::UNO_QUERY );
+                                         if ( xMasterPageTarget.is() )
+@@ -1986,82 +1988,93 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r
+                                         const rtl::OUString sSpeed ( RTL_CONSTASCII_USTRINGPARAM( "Speed" ) );
+                                         sal_Int32 nTime = 800;
+                                         presentation::AnimationSpeed aAs;
+-                                        aAny = xPagePropSet->getPropertyValue( sSpeed );
+-                                        if ( aAny >>= aAs )
++                                        if ( xPagePropSet->getPropertySetInfo( )->hasPropertyByName( sSpeed ) )
+                                         {
+-                                            switch( aAs )
++                                            aAny = xPagePropSet->getPropertyValue( sSpeed );
++                                            if ( aAny >>= aAs )
+                                             {
+-                                                case presentation::AnimationSpeed_SLOW : nTime = 1500; break;
+-                                                case presentation::AnimationSpeed_FAST : nTime = 300; break;
+-                                                default:
+-                                                case presentation::AnimationSpeed_MEDIUM : nTime = 800;
++                                                switch( aAs )
++                                                {
++                                                    case presentation::AnimationSpeed_SLOW : nTime = 1500; break;
++                                                    case presentation::AnimationSpeed_FAST : nTime = 300; break;
++                                                    default:
++                                                    case presentation::AnimationSpeed_MEDIUM : nTime = 800;
++                                                }
+                                             }
+                                         }
+                                         presentation::FadeEffect eFe;
+-                                        aAny = xPagePropSet->getPropertyValue( sEffect );
+                                         vcl::PDFWriter::PageTransition eType = vcl::PDFWriter::Regular;
+-                                        if ( aAny >>= eFe )
++                                        if ( xPagePropSet->getPropertySetInfo( )->hasPropertyByName( sEffect ) )
+                                         {
+-                                            switch( eFe )
++                                            aAny = xPagePropSet->getPropertyValue( sEffect );
++                                            if ( aAny >>= eFe )
+                                             {
+-                                                case presentation::FadeEffect_HORIZONTAL_LINES :
+-                                                case presentation::FadeEffect_HORIZONTAL_CHECKERBOARD :
+-                                                case presentation::FadeEffect_HORIZONTAL_STRIPES : eType = vcl::PDFWriter::BlindsHorizontal; break;
+-
+-                                                case presentation::FadeEffect_VERTICAL_LINES :
+-                                                case presentation::FadeEffect_VERTICAL_CHECKERBOARD :
+-                                                case presentation::FadeEffect_VERTICAL_STRIPES : eType = vcl::PDFWriter::BlindsVertical; break;
+-
+-                                                case presentation::FadeEffect_UNCOVER_TO_RIGHT :
+-                                                case presentation::FadeEffect_UNCOVER_TO_UPPERRIGHT :
+-                                                case presentation::FadeEffect_ROLL_FROM_LEFT :
+-                                                case presentation::FadeEffect_FADE_FROM_UPPERLEFT :
+-                                                case presentation::FadeEffect_MOVE_FROM_UPPERLEFT :
+-                                                case presentation::FadeEffect_FADE_FROM_LEFT :
+-                                                case presentation::FadeEffect_MOVE_FROM_LEFT : eType = vcl::PDFWriter::WipeLeftToRight; break;
+-
+-                                                case presentation::FadeEffect_UNCOVER_TO_BOTTOM :
+-                                                case presentation::FadeEffect_UNCOVER_TO_LOWERRIGHT :
+-                                                case presentation::FadeEffect_ROLL_FROM_TOP :
+-                                                case presentation::FadeEffect_FADE_FROM_UPPERRIGHT :
+-                                                case presentation::FadeEffect_MOVE_FROM_UPPERRIGHT :
+-                                                case presentation::FadeEffect_FADE_FROM_TOP :
+-                                                case presentation::FadeEffect_MOVE_FROM_TOP : eType = vcl::PDFWriter::WipeTopToBottom; break;
+-
+-                                                case presentation::FadeEffect_UNCOVER_TO_LEFT :
+-                                                case presentation::FadeEffect_UNCOVER_TO_LOWERLEFT :
+-                                                case presentation::FadeEffect_ROLL_FROM_RIGHT :
+-
+-                                                case presentation::FadeEffect_FADE_FROM_LOWERRIGHT :
+-                                                case presentation::FadeEffect_MOVE_FROM_LOWERRIGHT :
+-                                                case presentation::FadeEffect_FADE_FROM_RIGHT :
+-                                                case presentation::FadeEffect_MOVE_FROM_RIGHT : eType = vcl::PDFWriter::WipeRightToLeft; break;
+-
+-                                                case presentation::FadeEffect_UNCOVER_TO_TOP :
+-                                                case presentation::FadeEffect_UNCOVER_TO_UPPERLEFT :
+-                                                case presentation::FadeEffect_ROLL_FROM_BOTTOM :
+-                                                case presentation::FadeEffect_FADE_FROM_LOWERLEFT :
+-                                                case presentation::FadeEffect_MOVE_FROM_LOWERLEFT :
+-                                                case presentation::FadeEffect_FADE_FROM_BOTTOM :
+-                                                case presentation::FadeEffect_MOVE_FROM_BOTTOM : eType = vcl::PDFWriter::WipeBottomToTop; break;
+-
+-                                                case presentation::FadeEffect_OPEN_VERTICAL : eType = vcl::PDFWriter::SplitHorizontalInward; break;
+-                                                case presentation::FadeEffect_CLOSE_HORIZONTAL : eType = vcl::PDFWriter::SplitHorizontalOutward; break;
+-
+-                                                case presentation::FadeEffect_OPEN_HORIZONTAL : eType = vcl::PDFWriter::SplitVerticalInward; break;
+-                                                case presentation::FadeEffect_CLOSE_VERTICAL : eType = vcl::PDFWriter::SplitVerticalOutward; break;
+-
+-                                                case presentation::FadeEffect_FADE_TO_CENTER : eType = vcl::PDFWriter::BoxInward; break;
+-                                                case presentation::FadeEffect_FADE_FROM_CENTER : eType = vcl::PDFWriter::BoxOutward; break;
+-
+-                                                case presentation::FadeEffect_NONE : eType = vcl::PDFWriter::Regular; break;
+-
+-                                                case presentation::FadeEffect_RANDOM :
+-                                                case presentation::FadeEffect_DISSOLVE :
+-                                                default: eType = vcl::PDFWriter::Dissolve; break;
++                                                switch( eFe )
++                                                {
++                                                    case presentation::FadeEffect_HORIZONTAL_LINES :
++                                                    case presentation::FadeEffect_HORIZONTAL_CHECKERBOARD :
++                                                    case presentation::FadeEffect_HORIZONTAL_STRIPES : eType = vcl::PDFWriter::BlindsHorizontal; break;
++
++                                                    case presentation::FadeEffect_VERTICAL_LINES :
++                                                    case presentation::FadeEffect_VERTICAL_CHECKERBOARD :
++                                                    case presentation::FadeEffect_VERTICAL_STRIPES : eType = vcl::PDFWriter::BlindsVertical; break;
++
++                                                    case presentation::FadeEffect_UNCOVER_TO_RIGHT :
++                                                    case presentation::FadeEffect_UNCOVER_TO_UPPERRIGHT :
++                                                    case presentation::FadeEffect_ROLL_FROM_LEFT :
++                                                    case presentation::FadeEffect_FADE_FROM_UPPERLEFT :
++                                                    case presentation::FadeEffect_MOVE_FROM_UPPERLEFT :
++                                                    case presentation::FadeEffect_FADE_FROM_LEFT :
++                                                    case presentation::FadeEffect_MOVE_FROM_LEFT : eType = vcl::PDFWriter::WipeLeftToRight; break;
++
++                                                    case presentation::FadeEffect_UNCOVER_TO_BOTTOM :
++                                                    case presentation::FadeEffect_UNCOVER_TO_LOWERRIGHT :
++                                                    case presentation::FadeEffect_ROLL_FROM_TOP :
++                                                    case presentation::FadeEffect_FADE_FROM_UPPERRIGHT :
++                                                    case presentation::FadeEffect_MOVE_FROM_UPPERRIGHT :
++                                                    case presentation::FadeEffect_FADE_FROM_TOP :
++                                                    case presentation::FadeEffect_MOVE_FROM_TOP : eType = vcl::PDFWriter::WipeTopToBottom; break;
++
++                                                    case presentation::FadeEffect_UNCOVER_TO_LEFT :
++                                                    case presentation::FadeEffect_UNCOVER_TO_LOWERLEFT :
++                                                    case presentation::FadeEffect_ROLL_FROM_RIGHT :
++
++                                                    case presentation::FadeEffect_FADE_FROM_LOWERRIGHT :
++                                                    case presentation::FadeEffect_MOVE_FROM_LOWERRIGHT :
++                                                    case presentation::FadeEffect_FADE_FROM_RIGHT :
++                                                    case presentation::FadeEffect_MOVE_FROM_RIGHT : eType = vcl::PDFWriter::WipeRightToLeft; break;
++
++                                                    case presentation::FadeEffect_UNCOVER_TO_TOP :
++                                                    case presentation::FadeEffect_UNCOVER_TO_UPPERLEFT :
++                                                    case presentation::FadeEffect_ROLL_FROM_BOTTOM :
++                                                    case presentation::FadeEffect_FADE_FROM_LOWERLEFT :
++                                                    case presentation::FadeEffect_MOVE_FROM_LOWERLEFT :
++                                                    case presentation::FadeEffect_FADE_FROM_BOTTOM :
++                                                    case presentation::FadeEffect_MOVE_FROM_BOTTOM : eType = vcl::PDFWriter::WipeBottomToTop; break;
++
++                                                    case presentation::FadeEffect_OPEN_VERTICAL : eType = vcl::PDFWriter::SplitHorizontalInward; break;
++                                                    case presentation::FadeEffect_CLOSE_HORIZONTAL : eType = vcl::PDFWriter::SplitHorizontalOutward; break;
++
++                                                    case presentation::FadeEffect_OPEN_HORIZONTAL : eType = vcl::PDFWriter::SplitVerticalInward; break;
++                                                    case presentation::FadeEffect_CLOSE_VERTICAL : eType = vcl::PDFWriter::SplitVerticalOutward; break;
++
++                                                    case presentation::FadeEffect_FADE_TO_CENTER : eType = vcl::PDFWriter::BoxInward; break;
++                                                    case presentation::FadeEffect_FADE_FROM_CENTER : eType = vcl::PDFWriter::BoxOutward; break;
++
++                                                    case presentation::FadeEffect_NONE : eType = vcl::PDFWriter::Regular; break;
++
++                                                    case presentation::FadeEffect_RANDOM :
++                                                    case presentation::FadeEffect_DISSOLVE :
++                                                    default: eType = vcl::PDFWriter::Dissolve; break;
++                                                }
+                                             }
+                                         }
+-                                        pPDFExtOutDevData->SetPageTransition( eType, nTime, -1 );
++                                        
++                                        if ( xPagePropSet->getPropertySetInfo( )->hasPropertyByName( sEffect ) ||
++                                             xPagePropSet->getPropertySetInfo( )->hasPropertyByName( sSpeed ) )
++                                        {
++                                             pPDFExtOutDevData->SetPageTransition( eType, nTime, -1 );
++                                        }
+                                     }
+                                 }
+                             }
+@@ -2108,7 +2121,7 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r
+                             }
+                             //<--- i56629, i40318
+                         }
+-                        catch( uno::Exception& )
++                        catch( uno::Exception& e )
+                         {
+                         }
+ 
diff --git a/patches/dev300/skip-empty-links-in-pdf.diff b/patches/dev300/skip-empty-links-in-pdf.diff
deleted file mode 100644
index 70c873a..0000000
--- a/patches/dev300/skip-empty-links-in-pdf.diff
+++ /dev/null
@@ -1,11 +0,0 @@
---- vcl/source/gdi/pdfwriter_impl.cxx
-+++ vcl/source/gdi/pdfwriter_impl.cxx
-@@ -4144,6 +4144,8 @@ bool PDFWriterImpl::emitLinkAnnotations()
-     for( int i = 0; i < nAnnots; i++ )
-     {
-         const PDFLink& rLink			= m_aLinks[i];
-+        if( rLink.m_aURL.getLength() == 0 )
-+            continue;
-         if( ! updateObject( rLink.m_nObject ) )
-             continue;
- 
commit 8520cab9e7d0ef667f707f2b84dba690cc6fb8c4
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Fri Sep 17 10:07:48 2010 +0200

    Select the whole field when double clicking in it
    
    * patches/dev300/fields-double-click.diff:
        Fix for n#639288

diff --git a/patches/dev300/fields-double-click.diff b/patches/dev300/fields-double-click.diff
new file mode 100644
index 0000000..4cb9af4
--- /dev/null
+++ b/patches/dev300/fields-double-click.diff
@@ -0,0 +1,61 @@
+diff --git sw/source/core/crsr/swcrsr.cxx sw/source/core/crsr/swcrsr.cxx
+index bcf2b0c..5272571 100644
+--- sw/source/core/crsr/swcrsr.cxx
++++ sw/source/core/crsr/swcrsr.cxx
+@@ -1372,22 +1372,44 @@ BOOL SwCursor::SelectWordWT( sal_Int16 nWordType, const Point* pPt )
+     const SwTxtNode* pTxtNd = GetNode()->GetTxtNode();
+     if( pTxtNd && pBreakIt->GetBreakIter().is() )
+     {
+-        xub_StrLen nPtPos = GetPoint()->nContent.GetIndex();
+-        Boundary aBndry( pBreakIt->GetBreakIter()->getWordBoundary(
+-                            pTxtNd->GetTxt(), nPtPos,
+-                            pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos ) ),
+-                            nWordType,
+-                            bForward ));
+-
+-        if( aBndry.startPos != aBndry.endPos )
++        // Should we select the whole fieldmark?
++        const IDocumentMarkAccess* pMarksAccess = GetDoc()->getIDocumentMarkAccess( );
++        sw::mark::IMark* pMark = GetPoint() ? pMarksAccess->getFieldmarkFor( *GetPoint( ) ) : NULL;
++        if ( pMark )
+         {
+-            GetPoint()->nContent = (xub_StrLen)aBndry.endPos;
+-            if( !IsSelOvr() )
++            SwPosition& rStart = pMark->GetMarkStart();
++            GetPoint()->nNode = rStart.nNode;
++            GetPoint()->nContent = rStart.nContent;
++
++            SwPosition& rEnd = pMark->GetMarkEnd();
++
++            if ( rStart != rEnd )
+             {
+                 SetMark();
+-                GetMark()->nContent = (xub_StrLen)aBndry.startPos;
++                GetMark()->nNode = rEnd.nNode;
++                GetMark()->nContent = rEnd.nContent;
++            }
++            bRet = TRUE;
++        }
++        else
++        {
++            xub_StrLen nPtPos = GetPoint()->nContent.GetIndex();
++            Boundary aBndry( pBreakIt->GetBreakIter()->getWordBoundary(
++                                pTxtNd->GetTxt(), nPtPos,
++                                pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos ) ),
++                                nWordType,
++                                bForward ));
++
++            if( aBndry.startPos != aBndry.endPos )
++            {
++                GetPoint()->nContent = (xub_StrLen)aBndry.endPos;
+                 if( !IsSelOvr() )
+-                    bRet = TRUE;
++                {
++                    SetMark();
++                    GetMark()->nContent = (xub_StrLen)aBndry.startPos;
++                    if( !IsSelOvr() )
++                        bRet = TRUE;
++                }
+             }
+         }
+     }
commit 9fa17ae03241908761cc4d4b3fc6252149b6a6b8
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Fri Sep 17 10:06:49 2010 +0200

    Better import for SET / FILLIN nested fields.
    
    * patches/dev300/fields-nested-set.diff:
        Fix for n#634478

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 24a660684e3e41f9fa9440b57f66668dc053f8ff
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Fri Sep 17 10:05:44 2010 +0200

    Don't loose the DDE links in word files.
    
    * patches/dev300/dummy-fields-ole-links.diff:
        Fix for n#628098

diff --git a/patches/dev300/dummy-fields-ole-links.diff b/patches/dev300/dummy-fields-ole-links.diff
new file mode 100644
index 0000000..ac8554d
--- /dev/null
+++ b/patches/dev300/dummy-fields-ole-links.diff
@@ -0,0 +1,78 @@
+Don't create an OLE obect inside OLE Links
+
+From: Cédric Bosdonnat <cedricbosdo at openoffice.org>
+
+
+---
+
+ sw/source/filter/ww8/ww8par.hxx  |    1 +
+ sw/source/filter/ww8/ww8par5.cxx |    8 ++++----
+ sw/source/filter/ww8/ww8par6.cxx |    9 ++++++++-
+ 3 files changed, 13 insertions(+), 5 deletions(-)
+
+
+diff --git sw/source/filter/ww8/ww8par.hxx sw/source/filter/ww8/ww8par.hxx
+index cb96374..f038bb6 100644
+--- sw/source/filter/ww8/ww8par.hxx
++++ sw/source/filter/ww8/ww8par.hxx
+@@ -381,6 +381,7 @@ private:
+ 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 f22d1b5..5034625 100644
+--- sw/source/filter/ww8/ww8par5.cxx
++++ sw/source/filter/ww8/ww8par5.cxx
+@@ -761,11 +761,11 @@ sal_uInt16 SwWW8ImplReader::End_Field()
+                             rtl::OUString::createFromAscii( FIELD_CODE_PARAM ),
+                             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 );
+@@ -828,12 +828,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 98c5ee9..9ff32af 100644
+--- sw/source/filter/ww8/ww8par6.cxx
++++ sw/source/filter/ww8/ww8par6.cxx
+@@ -2820,7 +2820,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