incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject svn commit: r1172117 - /incubator/ooo/trunk/main/sw/source/core/table/swtable.cxx
Date Sat, 17 Sep 2011 22:40:14 GMT
Author: mst
Date: Sat Sep 17 22:40:14 2011
New Revision: 1172117

URL: http://svn.apache.org/viewvc?rev=1172117&view=rev
Log:
sw34bf06: #i117825#: try to reduce collateral damage from #i104949# fix:
 only ignore text:variable-set fields that are hidden and at start of para.

# HG changeset patch
# User Michael Stahl <mst@openoffice.org>
# Date 1304511729 0
# Node ID 3b8bef840a50f19ff04ffb92bc6906ac2b6828ad
# Parent  f573e7e8e68c3741b01779dbba749ab85ee90d1c

Modified:
    incubator/ooo/trunk/main/sw/source/core/table/swtable.cxx

Modified: incubator/ooo/trunk/main/sw/source/core/table/swtable.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/core/table/swtable.cxx?rev=1172117&r1=1172116&r2=1172117&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/core/table/swtable.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/core/table/swtable.cxx Sat Sep 17 22:40:14 2011
@@ -2582,6 +2582,7 @@ sal_uLong SwTableBox::IsValidNumTxtNd( s
                 // Flys/Felder/..
                 if( pHts )
                 {
+                    xub_StrLen nNextSetField = 0;
                     for( sal_uInt16 n = 0; n < pHts->Count(); ++n )
                     {
                         const SwTxtAttr* pAttr = (*pHts)[ n ];
@@ -2589,11 +2590,21 @@ sal_uLong SwTableBox::IsValidNumTxtNd( s
                             *pAttr->GetStart() ||
                             *pAttr->GetAnyEnd() < rTxt.Len() )
                         {
-                            if ( pAttr->Which() == RES_TXTATR_FIELD )
+                            if ((*pAttr->GetStart() == nNextSetField) &&
+                                (pAttr->Which() == RES_TXTATR_FIELD))
                             {
+                                // #i104949# hideous hack for report builder:
+                                // it inserts hidden variable-set fields at
+                                // the beginning of para in cell, but they
+                                // should not turn cell into text cell
                                 const SwField* pField = pAttr->GetFld().GetFld();
-                                if ( pField && pField->GetTypeId() == TYP_SETFLD
)
+                                if (pField &&
+                                    (pField->GetTypeId() == TYP_SETFLD) &&
+                                    (0 != (static_cast<SwSetExpField const*>
+                                           (pField)->GetSubType() &
+                                        nsSwExtendedSubType::SUB_INVISIBLE)))
                                 {
+                                    nNextSetField = *pAttr->GetStart() + 1;
                                     continue;
                                 }
                             }



Mime
View raw message