summaryrefslogtreecommitdiff
path: root/sw/source/ui
diff options
context:
space:
mode:
authorOliver Specht <os@openoffice.org>2001-03-28 13:23:55 +0000
committerOliver Specht <os@openoffice.org>2001-03-28 13:23:55 +0000
commitf5db8db1d66e732c95682f44a071158049d69206 (patch)
tree8a7e7b5735edef46363b44c14fe7de2bbe672718 /sw/source/ui
parentd95b40e157b5dc767436fbccce7b85e46c5aface (diff)
#85279# insert correct next set field
Diffstat (limited to 'sw/source/ui')
-rw-r--r--sw/source/ui/app/appenv.cxx12
-rw-r--r--sw/source/ui/app/applab.cxx14
2 files changed, 15 insertions, 11 deletions
diff --git a/sw/source/ui/app/appenv.cxx b/sw/source/ui/app/appenv.cxx
index 0600a36a5a76..7b30f25e5e42 100644
--- a/sw/source/ui/app/appenv.cxx
+++ b/sw/source/ui/app/appenv.cxx
@@ -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 lschen
- return bRet;
+ return sRet;
}
// ----------------------------------------------------------------------------
diff --git a/sw/source/ui/app/applab.cxx b/sw/source/ui/app/applab.cxx
index cb2238daad24..815da3aa5ea6 100644
--- a/sw/source/ui/app/applab.cxx
+++ b/sw/source/ui/app/applab.cxx
@@ -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;
}