Commits

Anonymous committed f08022d

INTEGRATION: CWS swenhancedfields2 (1.189.40); FILE MERGED
2008/08/04 14:15:17 b_michaelsen 1.189.40.4: RESYNC: (1.189-1.196); FILE MERGED
2008/04/24 13:41:54 ama 1.189.40.3: #33737#: Enhanced fields
2008/04/24 12:22:05 ama 1.189.40.2: #33737#: Enhanced fields
2008/04/23 14:29:21 ama 1.189.40.1: #i33737#: Enhanced fields

  • Participants
  • Parent commits abda6fb

Comments (0)

Files changed (1)

sw/source/filter/ww8/ww8par.cxx

  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: ww8par.cxx,v $
- * $Revision: 1.198 $
+ * $Revision: 1.199 $
  *
  * This file is part of OpenOffice.org.
  *
 }
 
 void SwWW8FltControlStack::SetAttr(const SwPosition& rPos, USHORT nAttrId,
-    BOOL bTstEnde, long nHand)
+    BOOL bTstEnde, long nHand, BOOL )
 {
     //Doing a textbox, and using the control stack only as a temporary
     //collection point for properties which will are not to be set into
             }
         }
     }
+    const SvtFilterOptions* pOpt = SvtFilterOptions::Get();
+    sal_Bool bUseEnhFields=(pOpt && pOpt->IsUseEnhancedFields());
+    if (bUseEnhFields) {
+	rDoc.set(IDocumentSettingAccess::PROTECT_FORM, pWDop->fProtEnabled );
+    }
 
     maTracer.LeaveEnvironment(sw::log::eDocumentProperties);
 }
 
 //-----------------------------------------
 //      Fuss- und Endnoten
+
 //-----------------------------------------
 
 WW8ReaderSave::WW8ReaderSave(SwWW8ImplReader* pRdr ,WW8_CP nStartCp) :
     maOldApos.push_back(false);
     maOldApos.swap(pRdr->maApos);
     maOldFieldStack.swap(pRdr->maFieldStack);
+	maFieldCtxStack.swap(pRdr->maNewFieldCtxStack);
 }
 
 void WW8ReaderSave::Restore( SwWW8ImplReader* pRdr )
         pRdr->pPlcxMan->RestoreAllPLCFx(maPLCFxSave);
     pRdr->maApos.swap(maOldApos);
     pRdr->maFieldStack.swap(maOldFieldStack);
+	pRdr->maNewFieldCtxStack.swap(maFieldCtxStack);
 }
 
 void SwWW8ImplReader::Read_HdFtFtnText( const SwNodeIndex* pSttIdx,
         case 0x15:
             if( !bSpec )        // Juristenparagraph
                 cInsert = '\xa7';
+			else { //0x15 is special --> so it's our field end mark...; hmmm what about field marks not handled by us??, maybe a problem with nested fields; probably an area of bugs... [well release quick and release often....]
+				if (!maNewFieldCtxStack.empty() && pPaM!=NULL && pPaM->GetPoint()!=NULL) {
+					WW8NewFieldCtx *pFieldCtx=maNewFieldCtxStack.back();
+					maNewFieldCtxStack.pop_back();
+					SwPosition aEndPos = *pPaM->GetPoint();
+					SwPaM aFldPam( pFieldCtx->GetPtNode(), pFieldCtx->GetPtCntnt(), aEndPos.nNode, aEndPos.nContent.GetIndex());
+					SwFieldBookmark *pFieldmark=(SwFieldBookmark*)rDoc.makeBookmark(aFldPam, KeyCode(), pFieldCtx->GetBookmarkName(), String(), IDocumentBookmarkAccess::FORM_FIELDMARK_TEXT);
+					ASSERT(pFieldmark!=NULL, "hmmm; why was the bookmark not created?");
+					if (pFieldmark!=NULL) {
+						pFieldmark->SetFieldType(0); // 0==Text
+						// set field data here...
+						pFieldCtx->SetCurrentFieldParamsTo(*pFieldmark);
+					}
+					delete pFieldCtx;
+				}
+			}
             break;
         case 0x9:
             cInsert = '\x9';    // Tab
 
 void wwSectionManager::InsertSegments()
 {
+    const SvtFilterOptions* pOpt = SvtFilterOptions::Get();
+    sal_Bool bUseEnhFields=(pOpt && pOpt->IsUseEnhancedFields());
     mySegIter aEnd = maSegments.end();
     mySegIter aStart = maSegments.begin();
     for (mySegIter aIter = aStart; aIter != aEnd; ++aIter)
 
         bool bInsertSection = aIter != aStart ? aIter->IsContinous() : false;
         bool bInsertPageDesc = !bInsertSection;
-        bool bProtected = SectionIsProtected(*aIter);
-
+        bool bProtected = !bUseEnhFields && SectionIsProtected(*aIter); // do we really  need this ?? I guess I have a different logic in editshell which disales this...
         if (bInsertPageDesc)
         {
             /*