fldmgr.cxx (69a74367) | fldmgr.cxx (3b32dd21) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 840 unchanged lines hidden (view full) --- 849 return pCurFld ? pCurFld->GetTypeId() : USHRT_MAX; 850} 851 852/*-------------------------------------------------------------------- 853 Beschreibung: Ueber String Feld einfuegen oder Update 854 --------------------------------------------------------------------*/ 855 856 | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 840 unchanged lines hidden (view full) --- 849 return pCurFld ? pCurFld->GetTypeId() : USHRT_MAX; 850} 851 852/*-------------------------------------------------------------------- 853 Beschreibung: Ueber String Feld einfuegen oder Update 854 --------------------------------------------------------------------*/ 855 856 |
857sal_Bool SwFldMgr::InsertFld( const SwInsertFld_Data& rData ) | 857sal_Bool SwFldMgr::InsertFld( 858 const SwInsertFld_Data& rData, 859 const SwPaM *pPam ) |
858{ 859 SwField* pFld = 0; | 860{ 861 SwField* pFld = 0; |
860 sal_Bool bExp = sal_False; 861 sal_Bool bTbl = sal_False; 862 sal_Bool bPageVar = sal_False; | 862 sal_Bool bExp = sal_False; 863 sal_Bool bTbl = sal_False; 864 sal_Bool bPageVar = sal_False; |
863 sal_uLong nFormatId = rData.nFormatId; 864 sal_uInt16 nSubType = rData.nSubType; 865 sal_Unicode cSeparator = rData.cSeparator; 866 SwWrtShell* pCurShell = rData.pSh; 867 if(!pCurShell) 868 pCurShell = pWrtShell ? pWrtShell : ::lcl_GetShell(); 869 DBG_ASSERT(pCurShell, "no SwWrtShell found"); 870 if(!pCurShell) 871 return sal_False; 872 873 switch(rData.nTypeId) | 865 sal_uLong nFormatId = rData.nFormatId; 866 sal_uInt16 nSubType = rData.nSubType; 867 sal_Unicode cSeparator = rData.cSeparator; 868 SwWrtShell* pCurShell = rData.pSh; 869 if(!pCurShell) 870 pCurShell = pWrtShell ? pWrtShell : ::lcl_GetShell(); 871 DBG_ASSERT(pCurShell, "no SwWrtShell found"); 872 if(!pCurShell) 873 return sal_False; 874 875 switch(rData.nTypeId) |
874 { // ACHTUNG dieses Feld wird ueber einen gesonderten Dialog eingefuegt 875 case TYP_POSTITFLD: 876 { 877 SwPostItFieldType* pType = (SwPostItFieldType*)pCurShell->GetFldType(0, RES_POSTITFLD); 878 pFld = new SwPostItField(pType, rData.sPar1, rData.sPar2, DateTime()); 879 break; 880 } | 876 { 877 case TYP_POSTITFLD: 878 { 879 SwPostItFieldType* pType = (SwPostItFieldType*)pCurShell->GetFldType(0, RES_POSTITFLD); 880 pFld = new SwPostItField( 881 pType, 882 rData.sPar2, // content 883 rData.sPar1, // author 884 aEmptyStr, // author's initials 885 aEmptyStr, // name 886 DateTime() ); 887 break; 888 } 889 |
881 case TYP_SCRIPTFLD: 882 { 883 SwScriptFieldType* pType = 884 (SwScriptFieldType*)pCurShell->GetFldType(0, RES_SCRIPTFLD); 885 pFld = new SwScriptField(pType, rData.sPar1, rData.sPar2, (sal_Bool)nFormatId); 886 break; 887 } 888 case TYP_COMBINED_CHARS: --- 495 unchanged lines hidden (view full) --- 1384 //the auto language flag has to be set prior to the language! 1385 pFld->SetAutomaticLanguage(rData.bIsAutomaticLanguage); 1386 sal_uInt16 nLang = GetCurrLanguage(); 1387 pFld->SetLanguage(nLang); 1388 1389 // Einfuegen 1390 pCurShell->StartAllAction(); 1391 | 890 case TYP_SCRIPTFLD: 891 { 892 SwScriptFieldType* pType = 893 (SwScriptFieldType*)pCurShell->GetFldType(0, RES_SCRIPTFLD); 894 pFld = new SwScriptField(pType, rData.sPar1, rData.sPar2, (sal_Bool)nFormatId); 895 break; 896 } 897 case TYP_COMBINED_CHARS: --- 495 unchanged lines hidden (view full) --- 1393 //the auto language flag has to be set prior to the language! 1394 pFld->SetAutomaticLanguage(rData.bIsAutomaticLanguage); 1395 sal_uInt16 nLang = GetCurrLanguage(); 1396 pFld->SetLanguage(nLang); 1397 1398 // Einfuegen 1399 pCurShell->StartAllAction(); 1400 |
1392 pCurShell->Insert(*pFld); | 1401 const SwPaM* pCommentRange = NULL; 1402 if (pPam && *pPam->GetPoint() != *pPam->GetMark() && rData.nTypeId == TYP_POSTITFLD) 1403 { 1404 pCommentRange = pPam; 1405 } |
1393 | 1406 |
1407 pCurShell->Insert( *pFld, pCommentRange ); 1408 |
|
1394 if(bExp && bEvalExp) 1395 pCurShell->UpdateExpFlds(sal_True); 1396 1397 if(bTbl) 1398 { 1399 pCurShell->Left(CRSR_SKIP_CHARS, sal_False, 1, sal_False ); 1400 pCurShell->UpdateFlds(*pFld); 1401 pCurShell->Right(CRSR_SKIP_CHARS, sal_False, 1, sal_False ); --- 391 unchanged lines hidden --- | 1409 if(bExp && bEvalExp) 1410 pCurShell->UpdateExpFlds(sal_True); 1411 1412 if(bTbl) 1413 { 1414 pCurShell->Left(CRSR_SKIP_CHARS, sal_False, 1, sal_False ); 1415 pCurShell->UpdateFlds(*pFld); 1416 pCurShell->Right(CRSR_SKIP_CHARS, sal_False, 1, sal_False ); --- 391 unchanged lines hidden --- |