#85279# insert correct next set field

This commit is contained in:
Oliver Specht
2001-03-28 13:23:55 +00:00
parent d95b40e157
commit f5db8db1d6
2 changed files with 15 additions and 11 deletions

View File

@@ -2,9 +2,9 @@
*
* $RCSfile: appenv.cxx,v $
*
* $Revision: 1.4 $
* $Revision: 1.5 $
*
* last change: $Author: os $ $Date: 2001-02-23 12:45:28 $
* last change: $Author: os $ $Date: 2001-03-28 14:23:55 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -157,9 +157,9 @@
// Funktion wird fuer Etiketten und Briefumschlaege benutzt!
// im applab.cxx und appenv.cxx
BOOL InsertLabEnvText( SwWrtShell& rSh, SwFldMgr& rFldMgr, const String& rText )
String InsertLabEnvText( SwWrtShell& rSh, SwFldMgr& rFldMgr, const String& rText )
{
BOOL bRet = FALSE;
String sRet;
String aText(rText);
aText.EraseAllChars( '\r' );
@@ -202,7 +202,7 @@ BOOL InsertLabEnvText( SwWrtShell& rSh, SwFldMgr& rFldMgr, const String& rText )
{
::ReplacePoint(sDBName);
rFldMgr.InsertFld( TYP_DBFLD, 0, sDBName, aEmptyStr, 0, &rSh );
bRet = TRUE;
sRet = sDBName;
bField = TRUE;
}
}
@@ -214,7 +214,7 @@ BOOL InsertLabEnvText( SwWrtShell& rSh, SwFldMgr& rFldMgr, const String& rText )
}
rSh.DelLeft(); // Letzten Linebreak wieder l<>schen
return bRet;
return sRet;
}
// ----------------------------------------------------------------------------

View File

@@ -2,9 +2,9 @@
*
* $RCSfile: applab.cxx,v $
*
* $Revision: 1.8 $
* $Revision: 1.9 $
*
* last change: $Author: os $ $Date: 2001-02-23 12:45:28 $
* last change: $Author: os $ $Date: 2001-03-28 14:23:55 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -217,7 +217,7 @@ using namespace ::com::sun::star;
using namespace ::rtl;
// steht im appenv.cxx
extern sal_Bool InsertLabEnvText( SwWrtShell& , SwFldMgr& , const String& );
extern String InsertLabEnvText( SwWrtShell& , SwFldMgr& , const String& );
const char __FAR_DATA MASTER_LABEL[] = "MasterLabel";
@@ -284,8 +284,12 @@ const SwFrmFmt *lcl_InsertLabText( SwWrtShell& rSh, const SwLabItem& rItem,
rSh.SetTxtFmtColl( rSh.GetTxtCollFromPool( RES_POOLCOLL_STANDARD ) );
// Ggf. "Naechster Datensatz"
if( (!rItem.bSynchron || !(nCol|nRow)) && InsertLabEnvText( rSh, rFldMgr, rItem.aWriting ) && !bLast )
rFldMgr.InsertFld( TYP_DBNEXTSETFLD, 0, String::CreateFromAscii("sal_True"), aEmptyStr, 0, &rSh );
String sDBName;
if( (!rItem.bSynchron || !(nCol|nRow)) && (sDBName = InsertLabEnvText( rSh, rFldMgr, rItem.aWriting )).Len() && !bLast )
{
sDBName.SetToken( 2, DB_DELIM, String::CreateFromAscii("True"));
rFldMgr.InsertFld( TYP_DBNEXTSETFLD, 0, sDBName, aEmptyStr, 0, &rSh );
}
return pFmt;
}