diff options
author | Oliver Specht <os@openoffice.org> | 2000-10-27 10:26:20 +0000 |
---|---|---|
committer | Oliver Specht <os@openoffice.org> | 2000-10-27 10:26:20 +0000 |
commit | a41b2c1f4b2de6d8db78978a70ee4c90aad017b9 (patch) | |
tree | add34140527c291dd8dcd8be1a5da256b82cfa84 | |
parent | c76770721cf7bcc9c37bb6c3a68bfbb265550bc8 (diff) |
old database API removed
-rw-r--r-- | sw/inc/dbmgr.hxx | 67 | ||||
-rw-r--r-- | sw/source/core/bastyp/calc.cxx | 31 | ||||
-rw-r--r-- | sw/source/core/doc/docfld.cxx | 143 | ||||
-rw-r--r-- | sw/source/core/fields/dbfld.cxx | 55 | ||||
-rw-r--r-- | sw/source/core/fields/docufld.cxx | 19 | ||||
-rw-r--r-- | sw/source/ui/app/swmodul1.cxx | 31 | ||||
-rw-r--r-- | sw/source/ui/dbui/dbinsdlg.cxx | 316 | ||||
-rw-r--r-- | sw/source/ui/dbui/dbmgr.cxx | 665 | ||||
-rw-r--r-- | sw/source/ui/dbui/dbtree.cxx | 302 | ||||
-rw-r--r-- | sw/source/ui/envelp/envlop1.cxx | 177 | ||||
-rw-r--r-- | sw/source/ui/envelp/label1.cxx | 58 | ||||
-rw-r--r-- | sw/source/ui/envelp/mailmrge.cxx | 174 | ||||
-rw-r--r-- | sw/source/ui/fldui/changedb.cxx | 288 | ||||
-rw-r--r-- | sw/source/ui/fldui/flddb.cxx | 172 | ||||
-rw-r--r-- | sw/source/ui/fldui/flddb.hxx | 6 | ||||
-rw-r--r-- | sw/source/ui/fldui/fldmgr.cxx | 445 | ||||
-rw-r--r-- | sw/source/ui/inc/dbinsdlg.hxx | 24 | ||||
-rw-r--r-- | sw/source/ui/inc/dbtree.hxx | 13 | ||||
-rw-r--r-- | sw/source/ui/inc/fldmgr.hxx | 14 | ||||
-rw-r--r-- | sw/source/ui/inc/mailmrge.hxx | 11 | ||||
-rw-r--r-- | sw/source/ui/shells/textsh2.cxx | 309 | ||||
-rw-r--r-- | sw/source/ui/uiview/viewprt.cxx | 149 |
22 files changed, 97 insertions, 3372 deletions
diff --git a/sw/inc/dbmgr.hxx b/sw/inc/dbmgr.hxx index 07ddffd79730..85c34e8236b2 100644 --- a/sw/inc/dbmgr.hxx +++ b/sw/inc/dbmgr.hxx @@ -2,9 +2,9 @@ * * $RCSfile: dbmgr.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:14:25 $ + * last change: $Author: os $ $Date: 2000-10-27 11:26:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -66,7 +66,6 @@ #include <tools/string.hxx> #endif -#ifdef REPLACE_OFADBMGR #ifndef _SBAITEMS_HXX #include "offmgr/sbaitems.hxx" #endif @@ -74,16 +73,8 @@ #include <com/sun/star/util/Date.hpp> #endif -#else - -#ifndef _OFF_OFADBMGR_HXX //autogen -#include <offmgr/ofadbmgr.hxx> -#endif -#endif - #include "swtypes.hxx" // fuer aEmptyStr -#ifdef REPLACE_OFADBMGR #ifndef _COM_SUN_STAR_UNO_REFERENCE_H_ #include <com/sun/star/uno/Reference.h> #endif @@ -118,7 +109,6 @@ struct SwDBFormatData com::sun::star::uno::Reference< com::sun::star::util::XNumberFormatter> xFormatter; com::sun::star::lang::Locale aLocale; }; -#endif //REPLACE_OFADBMGR class SwView; class SwWrtShell; @@ -144,7 +134,6 @@ enum DBMgrOptions /*-------------------------------------------------------------------- Beschreibung: (neue) Logische Datenbanken verwalten --------------------------------------------------------------------*/ -#ifdef REPLACE_OFADBMGR #define SW_DB_SELECT_UNKNOWN 0 #define SW_DB_SELECT_TABLE 1 #define SW_DB_SELECT_QUERY 2 @@ -182,13 +171,8 @@ struct SwDSParam typedef SwDSParam* SwDSParamPtr; SV_DECL_PTRARR_DEL(SwDSParamArr, SwDSParamPtr, 0, 5) -#endif //REPLACE_OFADBMGR -#ifdef REPLACE_OFADBMGR class SwNewDBMgr -#else -class SwNewDBMgr : public OfaDBMgr -#endif { SbaSelectionListRef pMergeList; // Liste der fr Serienbrief selektierten Eintrge String sEMailAddrFld; // Mailing: Spaltenname der E-Mail Adresse @@ -199,7 +183,6 @@ class SwNewDBMgr : public OfaDBMgr BOOL bSingleJobs : 1; // Einzelne Druckjobs bei Aufruf aus Basic BOOL bCancel : 1; // Serienbrief-Save abgebrochen -#ifdef REPLACE_OFADBMGR BOOL bInMerge : 1; //merge process active SwDSParamArr aDataSourceParams; @@ -210,26 +193,15 @@ class SwNewDBMgr : public OfaDBMgr const String& rStatement, const SbaSelectionListRef xSelectionList); SwDSParam* FindDSData(const String& rDBName, BOOL bCreate); -#endif DECL_LINK( PrtCancelHdl, Button * ); // Datensaetze als Text ins Dokument einfuegen -#ifdef REPLACE_OFADBMGR void ImportFromConnection( SwWrtShell* pSh); -#else - void ImportFromConnection( SwWrtShell* pSh, - const SbaSelectionList* pSelList = 0 ); -#endif // Einzelnen Datensatz als Text ins Dokument einfuegen -#ifdef REPLACE_OFADBMGR void ImportDBEntry(SwWrtShell* pSh); -#else - void ImportDBEntry(SbaDBDataDef* pDef, SwWrtShell* pSh); - BOOL GotoNextSelectedRecord( BOOL bSyncronized ); -#endif // Mischen von Datensaetzen in Felder, dann per email versenden BOOL MergeMailing(SwWrtShell* pSh); @@ -237,17 +209,11 @@ class SwNewDBMgr : public OfaDBMgr BOOL MergeMailFiles(SwWrtShell* pSh); public: SwNewDBMgr(); -#ifdef REPLACE_OFADBMGR ~SwNewDBMgr(); -#endif // Am Dokument Datenbank- Tabellenname und SQL-Select-Statement setzen void ChgDBName( SwWrtShell* pSh, -#ifdef REPLACE_OFADBMGR const String& rDataSource, const String& rTableOrQuery, -#else - const String& rDBName, -#endif const String& rStatement ); // Art des aktellen Mergens. Siehe DBMgrOptions-enum @@ -257,12 +223,8 @@ public: // Mischen von Datensaetzen in Felder BOOL Merge(USHORT nOpt, SwWrtShell* pSh, const String& rStatement, const SbaSelectionListRef pSelectionList, -#ifdef REPLACE_OFADBMGR const String& rDataSource, const String& rTableOrQuery, -#else - const String& rDBName, -#endif const String *pPrinter = NULL); BOOL Merge(SwWrtShell* pSh); // Mischen von Datensaetzen in Felder, dann drucken @@ -285,7 +247,6 @@ public: inline void SetAttachment(const String& sAtt) { sAttached = sAtt; } -#ifdef REPLACE_OFADBMGR // Listbox mit allen Tabellennamen einer Datenbank fuellen BOOL GetTableNames(ListBox* pListBox, const String& rDBName ); // Listbox mit allen Spaltennamen einer Datenbanktabelle fuellen @@ -300,26 +261,6 @@ public: const String& rTableName, const String& rColNm ); -#else - // Listbox mit allen Tabellennamen einer Datenbank fuellen - BOOL GetTableNames(ListBox* pListBox, String sDBName); - // Listbox mit allen Spaltennamen einer Datenbanktabelle fuellen - BOOL GetColumnNames(ListBox* pListBox, String sDBName, BOOL bAppend = FALSE); - // DB-Cursor auf einen bestimmten Datensatz stellen - // (Ist im OfaDBMgr protected, daher hier nochmals als public fuer dbinsdlg.cxx) - inline void GotoRecord( ULONG nIndex ) - { OfaDBMgr::GotoRecord( FALSE, nIndex ); } - - ULONG GetColumnFmt( const String& rDBName, const String& rColNm, - SvNumberFormatter* pNFmtr ); - // Numberformat der Spalte ermitteln und ggfs. in den uebergebenen - // Formatter uebertragen - ULONG GetRealColumnFmt( const String& rColNm, ULONG nFmt, - SvNumberFormatter& rNFmtr ); - BOOL IsDBCaseSensitive( const String& rName ) const; -#endif - -#ifdef REPLACE_OFADBMGR inline BOOL IsInMerge() const { return bInMerge; } void EndMerge(); @@ -373,10 +314,6 @@ public: static ::com::sun::star::uno::Sequence<rtl::OUString> GetExistingDatabaseNames(); -#else - -#endif //REPLACE_OFADBMGR - }; #endif diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx index 7d9b940c919d..42393f74555d 100644 --- a/sw/source/core/bastyp/calc.cxx +++ b/sw/source/core/bastyp/calc.cxx @@ -2,9 +2,9 @@ * * $RCSfile: calc.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: jp $ $Date: 2000-10-06 13:05:18 $ + * last change: $Author: os $ $Date: 2000-10-27 11:23:40 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -897,17 +897,11 @@ SwCalcExp* SwCalc::VarLook( const String& rStr, USHORT ins ) // Name(p)=Adress.PLZ oder Adress.DATENSATZNUMMER // DBSETNUMBERFLD = DatenSATZ-nummernfeld (NICHT "setze Datensatznummer!!!") -#ifdef REPLACE_OFADBMGR String sDBName(GetDBName( sTmpName )); String sSourceName(sDBName.GetToken(0, DB_DELIM)); String sTableName(sDBName.GetToken(0).GetToken(1, DB_DELIM)); if( pMgr && sSourceName.Len() && sTableName.Len() && pMgr->OpenDataSource(sSourceName, sTableName)) -#else - String sDBName; - if( pMgr && ( sDBName = GetDBName( sTmpName )).Len() && - pMgr->OpenDB( DBMGR_STD, sDBName, FALSE )) -#endif { String sColumnName( GetColumnName( sTmpName )); ASSERT (sColumnName.Len(), "DB-Spaltenname fehlt!"); @@ -918,19 +912,11 @@ SwCalcExp* SwCalc::VarLook( const String& rStr, USHORT ins ) // Hier nochmal initialisieren, da das nicht mehr in docfld // fuer Felder != RES_DBFLD geschieht. Z.B. wenn ein Expressionfield // vor einem DB_Field in einem Dok vorkommt. -#ifdef REPLACE_OFADBMGR VarChange( sDBNum, pMgr->GetSelectedRecordId(sSourceName, sTableName)); -#else - VarChange( sDBNum, pMgr->GetCurSelectedRecordId(DBMGR_STD)); -#endif if( sDBNum.EqualsIgnoreCaseAscii(sColumnName) ) { -#ifdef REPLACE_OFADBMGR aErrExpr.nValue.PutLong(long(pMgr->GetSelectedRecordId(sSourceName, sTableName))); -#else - aErrExpr.nValue.PutLong(long(pMgr->GetCurSelectedRecordId(DBMGR_STD))); -#endif return &aErrExpr; } @@ -941,17 +927,12 @@ SwCalcExp* SwCalc::VarLook( const String& rStr, USHORT ins ) String sResult; double nNumber = DBL_MAX; -#ifdef REPLACE_OFADBMGR const SfxPoolItem& rItem = rDoc.GetDefault(RES_CHRATR_LANGUAGE); LanguageType eLang = ((SvxLanguageItem&)rDoc.GetDefault( RES_CHRATR_LANGUAGE )).GetLanguage(); if(LANGUAGE_SYSTEM == eLang) eLang = ::GetSystemLanguage(); if(pMgr->GetColumnCnt(sSourceName, sTableName, sColumnName, nTmpRec, (long)eLang, sResult, &nNumber)) -#else - if (pMgr->GetColumnCnt(DBMGR_STD, sColumnName, - pMgr->AbsToRel(DBMGR_STD, nTmpRec), sResult, &nNumber)) -#endif { if (nNumber != DBL_MAX) aErrExpr.nValue.PutDouble( nNumber ); @@ -976,7 +957,6 @@ SwCalcExp* SwCalc::VarLook( const String& rStr, USHORT ins ) SwFieldType::GetTypeStr( TYP_DBSETNUMBERFLD ) )) { SwNewDBMgr *pMgr = rDoc.GetNewDBMgr(); -#ifdef REPLACE_OFADBMGR String sDBName(GetDBName( sTmpName )); String sSourceName(sDBName.GetToken(0, DB_DELIM)); String sTableName(sDBName.GetToken(0).GetToken(1, DB_DELIM)); @@ -984,13 +964,6 @@ SwCalcExp* SwCalc::VarLook( const String& rStr, USHORT ins ) pMgr->OpenDataSource(sSourceName, sTableName) && !pMgr->IsInMerge()) pNewExp->nValue.PutULong( pMgr->GetSelectedRecordId(sSourceName, sTableName)); -#else - - if( pMgr && (sTmpName = GetDBName( sTmpName )).Len() && - pMgr->OpenDB( DBMGR_STD, sTmpName, FALSE ) && - !pMgr->IsInMerge() ) - pNewExp->nValue.PutULong( pMgr->GetCurSelectedRecordId(DBMGR_STD) ); -#endif } return pNewExp; diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index a592d0f6f141..893659df6a8b 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -2,9 +2,9 @@ * * $RCSfile: docfld.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-19 00:08:15 $ + * last change: $Author: os $ $Date: 2000-10-27 11:23:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1132,17 +1132,12 @@ void lcl_CalcFld( SwDoc& rDoc, SwCalc& rCalc, const _SetGetExpFld& rSGEFld, { SwDBNumSetField* pDBFld = (SwDBNumSetField*)pFld; -#ifdef REPLACE_OFADBMGR String sDBName(pDBFld->GetDBName(&rDoc)); String sSourceName(sDBName.GetToken(0, DB_DELIM)); String sTableName(sDBName.GetToken(0).GetToken(1, DB_DELIM)); if( pDBFld->IsCondValid() && pMgr->OpenDataSource( sSourceName, sTableName )) -#else - if( pMgr->OpenDB( DBMGR_STD, pDBFld->GetDBName(&rDoc)) && - pDBFld->IsCondValid() ) -#endif rCalc.VarChange( lcl_GetDBVarName( rDoc, *pDBFld), pDBFld->GetFormat() ); } @@ -1150,16 +1145,11 @@ void lcl_CalcFld( SwDoc& rDoc, SwCalc& rCalc, const _SetGetExpFld& rSGEFld, case RES_DBNEXTSETFLD: { SwDBNextSetField* pDBFld = (SwDBNextSetField*)pFld; -#ifdef REPLACE_OFADBMGR String sDBName(pDBFld->GetDBName(&rDoc)); String sSourceName(sDBName.GetToken(0, DB_DELIM)); String sTableName(sDBName.GetToken(0).GetToken(1, DB_DELIM)); if( !pDBFld->IsCondValid() || !pMgr->OpenDataSource( sSourceName, sTableName )) -#else - if( !pMgr->OpenDB( DBMGR_STD, pDBFld->GetDBName(&rDoc)) || - !pDBFld->IsCondValid() ) -#endif break; String sDBNumNm(lcl_GetDBVarName( rDoc, *pDBFld)); @@ -1180,11 +1170,7 @@ void SwDoc::FldsToCalc( SwCalc& rCalc, const _SetGetExpFld& rToThisFld ) bNewFldLst = FALSE; SwNewDBMgr* pMgr = GetNewDBMgr(); -#ifdef REPLACE_OFADBMGR pMgr->CloseAll(FALSE); -#else - pMgr->SetAllDirty(DBMGR_STD); -#endif if( pUpdtFlds->GetSortLst()->Count() ) { @@ -1198,11 +1184,7 @@ void SwDoc::FldsToCalc( SwCalc& rCalc, const _SetGetExpFld& rToThisFld ) lcl_CalcFld( *this, rCalc, **ppSortLst, pMgr ); } -#ifdef REPLACE_OFADBMGR pMgr->CloseAll(FALSE); -#else - pMgr->SetAllDirty(DBMGR_STD, FALSE); -#endif } void SwDoc::FldsToCalc( SwCalc& rCalc, ULONG nLastNd, USHORT nLastCnt ) @@ -1212,11 +1194,7 @@ void SwDoc::FldsToCalc( SwCalc& rCalc, ULONG nLastNd, USHORT nLastCnt ) bNewFldLst = FALSE; SwNewDBMgr* pMgr = GetNewDBMgr(); -#ifdef REPLACE_OFADBMGR pMgr->CloseAll(FALSE); -#else - pMgr->SetAllDirty(DBMGR_STD); -#endif const _SetGetExpFldPtr* ppSortLst = pUpdtFlds->GetSortLst()->GetData(); for( USHORT n = pUpdtFlds->GetSortLst()->Count(); @@ -1225,11 +1203,7 @@ void SwDoc::FldsToCalc( SwCalc& rCalc, ULONG nLastNd, USHORT nLastCnt ) --n, ++ppSortLst ) lcl_CalcFld( *this, rCalc, **ppSortLst, pMgr ); -#ifdef REPLACE_OFADBMGR pMgr->CloseAll(FALSE); -#else - pMgr->SetAllDirty(DBMGR_STD, FALSE); -#endif } void SwDoc::FldsToExpand( SwHash**& ppHashTbl, USHORT& rTblSize, @@ -1374,11 +1348,7 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, BOOL bUpdRefFlds ) // aktuelle Datensatznummer schon vorher einstellen SwNewDBMgr* pMgr = GetNewDBMgr(); -#ifdef REPLACE_OFADBMGR pMgr->CloseAll(FALSE); -#else - pMgr->SetAllDirty(DBMGR_STD); -#endif /* if(pMgr && pMgr->OpenDB(DBMGR_STD, GetDBDesc(), FALSE)) { @@ -1445,17 +1415,12 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, BOOL bUpdRefFlds ) // Feld Evaluieren ((SwDBField*)pFld)->Evaluate(); -#ifdef REPLACE_OFADBMGR String sDBName(((SwDBField*)pFld)->GetDBName()); String sSourceName(sDBName.GetToken(0, DB_DELIM)); String sTableName(sDBName.GetToken(0).GetToken(1, DB_DELIM)); if( pMgr->OpenDataSource( sSourceName, sTableName )) aCalc.VarChange( sDBNumNm, pMgr->GetSelectedRecordId(sSourceName, sTableName)); -#else - if(pMgr->OpenDB(DBMGR_STD, ((SwDBField*)pFld)->GetDBName())) - aCalc.VarChange( sDBNumNm, pMgr->GetCurSelectedRecordId(DBMGR_STD) ); -#endif const String& rName = pFld->GetTyp()->GetName(); @@ -1597,11 +1562,7 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, BOOL bUpdRefFlds ) } } -#ifdef REPLACE_OFADBMGR pMgr->CloseAll(FALSE); -#else - pMgr->SetAllDirty(DBMGR_STD, FALSE); -#endif // HashTabelle wieder loeschen ::DeleteHashTable( pHashStrTbl, nStrFmtCnt ); @@ -1640,47 +1601,16 @@ void SwDoc::UpdateDBNumFlds( SwDBNameInfField& rDBFld, SwCalc& rCalc ) String sDBName( rDBFld.GetDBName(this) ); -#ifdef REPLACE_OFADBMGR String sSourceName(sDBName.GetToken(0, DB_DELIM)); String sTableName(sDBName.GetToken(0).GetToken(1, DB_DELIM)); if( pMgr->OpenDataSource( sSourceName, sTableName )) rCalc.VarChange( lcl_GetDBVarName( *this, rDBFld), pMgr->GetSelectedRecordId(sSourceName, sTableName) ); -#else - if( pMgr->OpenDB( DBMGR_STD, sDBName )) - rCalc.VarChange( lcl_GetDBVarName( *this, rDBFld), - pMgr->GetCurSelectedRecordId( DBMGR_STD ) ); -#endif } else { -#ifdef REPLACE_OFADBMGR DBG_ERROR("TODO: what should happen with unnamed DBFields?") -#else - // Alle Datenbanken bearbeiten - OfaDBParam* pParam = pMgr->GetFirstDBData(DBMGR_STD); -// why that? - the name must be empty -// String sOldFldName( rDBFld.GetRealDBName() ); - - while (pParam) - { - if (pParam->HasConnection()) - { - rDBFld.SetDBName( pParam->GetSymDBName() ); - - if( RES_DBNEXTSETFLD == nFldType ) - ((SwDBNextSetField&)rDBFld).Evaluate(this); - else - ((SwDBNumSetField&)rDBFld).Evaluate(this); - - rCalc.VarChange( lcl_GetDBVarName( *this, rDBFld ), - pMgr->GetCurSelectedRecordId( DBMGR_STD ) ); - } - pParam = pMgr->GetNextDBData(); - } - rDBFld.SetDBName(aEmptyStr); -#endif } } @@ -1743,11 +1673,7 @@ void SwDoc::InsDelFldInFldLst( BOOL bIns, const SwTxtFld& rFld ) String SwDoc::GetDBName() { -#ifdef REPLACE_OFADBMGR return GetDBDesc(); -#else - return GetNewDBMgr()->ExtractDBName( GetDBDesc() ); -#endif } const String& SwDoc::GetDBDesc() @@ -1851,7 +1777,6 @@ void SwDoc::GetAllDBNames( SvStringsDtor& rAllDBNames ) { SwNewDBMgr* pMgr = GetNewDBMgr(); -#ifdef REPLACE_OFADBMGR const SwDSParamArr& rArr = pMgr->GetDSParamArray(); for(USHORT i = 0; i < rArr.Count(); i++) { @@ -1861,22 +1786,6 @@ void SwDoc::GetAllDBNames( SvStringsDtor& rAllDBNames ) (*pStr) += pParam->sTableOrQuery; rAllDBNames.Insert( pStr, rAllDBNames.Count() ); } -#else - OfaDBParam* pParam = pMgr->GetFirstDBData(DBMGR_STD); - - while( pParam ) - { - if( pParam->GetSymDBName().Len() ) - { - String* pStr = new String( pParam->GetSymDBName() ); -#ifndef UNX - GetAppCharClass().toUpper( *pStr ); -#endif - rAllDBNames.Insert( pStr, rAllDBNames.Count() ); - } - pParam = pMgr->GetNextDBData(); - } -#endif } /*-------------------------------------------------------------------- @@ -1940,7 +1849,6 @@ void SwDoc::AddUsedDBToList( SvStringsDtor& rDBNameList, const String& rDBName) const CharClass& rCC = GetAppCharClass(); String sLowerDBName( DBNAME_LOWER( rDBName )); -#ifdef REPLACE_OFADBMGR for (USHORT i = 0; i < rDBNameList.Count(); i++) if( sLowerDBName.Equals( DBNAME_LOWER( rDBNameList.GetObject(i)->GetToken(0) ))) @@ -1949,17 +1857,6 @@ void SwDoc::AddUsedDBToList( SvStringsDtor& rDBNameList, const String& rDBName) const SwDSParam* pParam = GetNewDBMgr()->CreateDSData(rDBName); String* pNew = new String( rDBName ); rDBNameList.Insert( pNew, rDBNameList.Count() ); -#else - for (USHORT i = 0; i < rDBNameList.Count(); i++) - if( sLowerDBName.Equals( DBNAME_LOWER( - GetNewDBMgr()->ExtractDBName( *rDBNameList.GetObject(i) ) ))) - return; - OfaDBParam& rParam = GetNewDBMgr()->GetDBData( DBMGR_STD, &rDBName ); - String* pNew = new String( rParam.GetDBName() ); - if( !pNew->Len() ) - *pNew = rParam.GetSymDBName(); - rDBNameList.Insert( pNew, rDBNameList.Count() ); -#endif } /*-------------------------------------------------------------------- @@ -2210,26 +2107,12 @@ void SwDoc::ReplaceUsedDBs( const SvStringsDtor& rUsedDBNames, String sNewName( rNewName ); sNewName.SearchAndReplace( DB_DELIM, '.'); String sUpperNewNm( sNewName ); -#ifdef REPLACE_OFADBMGR -#else -#ifndef UNX - rCC.toUpper( sFormel ); - rCC.toUpper( sUpperNewNm ); -#endif -#endif for( USHORT i = 0; i < rUsedDBNames.Count(); ++i ) { String sDBName( *rUsedDBNames.GetObject( i ) ); -#ifdef REPLACE_OFADBMGR -#else -#ifndef UNX - rCC.toUpper( sDBName ); -#endif -#endif - sDBName.SearchAndReplace( DB_DELIM, '.'); if( sDBName.Equals( sUpperNewNm )) { @@ -2243,12 +2126,6 @@ void SwDoc::ReplaceUsedDBs( const SvStringsDtor& rUsedDBNames, rFormel.Erase( nPos, sDBName.Len() ); rFormel.Insert( sNewName, nPos ); sFormel = rFormel; -#ifdef REPLACE_OFADBMGR -#else -#ifndef UNX - rCC.toUpper( sFormel ); -#endif -#endif } } } @@ -2620,7 +2497,6 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode ) case RES_DBNUMSETFLD: { -#ifdef REPLACE_OFADBMGR String sDBName(((SwDBNumSetField*)pFld)->GetDBName(&rDoc)); String sSourceName(sDBName.GetToken(0, DB_DELIM)); String sTableName(sDBName.GetToken(0).GetToken(1, DB_DELIM)); @@ -2630,19 +2506,11 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode ) GETFLD_ALL == eGetMode || ( GETFLD_CALC & eGetMode && ((SwDBNumSetField*)pFld)->IsCondValid())) -#else - if( bIsDBMgr && rDoc.GetNewDBMgr()->OpenDB(DBMGR_STD, - ((SwDBNumSetField*)pFld)->GetDBName(&rDoc)) && - GETFLD_ALL == eGetMode || - ( GETFLD_CALC & eGetMode && - ((SwDBNumSetField*)pFld)->IsCondValid() )) -#endif pFormel = &pFld->GetPar1(); } break; case RES_DBNEXTSETFLD: { -#ifdef REPLACE_OFADBMGR String sDBName(((SwDBNextSetField*)pFld)->GetDBName(&rDoc)); String sSourceName(sDBName.GetToken(0, DB_DELIM)); String sTableName(sDBName.GetToken(0).GetToken(1, DB_DELIM)); @@ -2652,13 +2520,6 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode ) GETFLD_ALL == eGetMode || ( GETFLD_CALC & eGetMode && ((SwDBNextSetField*)pFld)->IsCondValid() )) -#else - if( bIsDBMgr && rDoc.GetNewDBMgr()->OpenDB(DBMGR_STD, - ((SwDBNextSetField*)pFld)->GetDBName(&rDoc)) && - GETFLD_ALL == eGetMode || - ( GETFLD_CALC & eGetMode && - ((SwDBNextSetField*)pFld)->IsCondValid() )) -#endif pFormel = &pFld->GetPar1(); } break; diff --git a/sw/source/core/fields/dbfld.cxx b/sw/source/core/fields/dbfld.cxx index fe65ce0e423e..c5729f469d41 100644 --- a/sw/source/core/fields/dbfld.cxx +++ b/sw/source/core/fields/dbfld.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dbfld.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-19 00:08:19 $ + * last change: $Author: os $ $Date: 2000-10-27 11:23:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -98,14 +98,11 @@ #include "expfld.hxx" #include "txtatr.hxx" -#ifdef REPLACE_OFADBMGR #ifndef _COM_SUN_STAR_SDBC_DATATYPE_HPP_ #include <com/sun/star/sdbc/DataType.hpp> #endif using namespace ::com::sun::star::sdbc; -#endif - using namespace ::com::sun::star; using namespace ::rtl; @@ -433,17 +430,10 @@ void SwDBField::Evaluate() double nValue = DBL_MAX; String sTmpName(GetDBName()); -#ifdef REPLACE_OFADBMGR String sDataSource(sTmpName.GetToken(0, DB_DELIM)); String sDataTableOrQuery(sTmpName.GetToken(1, DB_DELIM)); if(!pMgr || !pMgr->IsDataSourceOpen(sDataSource, sDataTableOrQuery)) return ; -#else - if(!pMgr || !pMgr->IsDBOpen(DBMGR_STD, sTmpName) || !pMgr->IsInMerge()) - { - return; - } -#endif ULONG nFmt; @@ -451,32 +441,17 @@ void SwDBField::Evaluate() String aColNm( ((SwDBFieldType*)GetTyp())->GetColumnName() ); SvNumberFormatter* pDocFormatter = GetDoc()->GetNumberFormatter(); -#ifdef REPLACE_OFADBMGR pMgr->GetMergeColumnCnt(aColNm, GetLanguage(), aContent, &nValue, &nFmt); if( !( nSubType & SUB_OWN_FMT ) ) SetFormat( nFmt = pMgr->GetColumnFmt( sDataSource, sDataTableOrQuery, aContent, pDocFormatter, GetLanguage() )); -#else - pMgr->GetColumnCnt( DBMGR_STD, aColNm, - pMgr->GetCurRecordId( DBMGR_STD ), aContent, - &nValue, &nFmt ); - if( !( nSubType & SUB_OWN_FMT ) ) - SetFormat( nFmt = pMgr->GetRealColumnFmt( aColNm, nFmt, - *pDocFormatter ) ); -#endif if( DBL_MAX != nValue ) { -#ifdef REPLACE_OFADBMGR sal_Int32 nColumnType = pMgr->GetColumnType(sDataSource, sDataTableOrQuery, aContent); if( DataType::DATE == nColumnType || DataType::TIME == nColumnType || DataType::TIMESTAMP ) -#else - int nColumnPos = pMgr->GetColumnPos(FALSE, aColNm); - String sColumnType = pMgr->GetColumnType(FALSE, nColumnPos, FALSE); - if(sColumnType.EqualsAscii("DATE/TIME") || sColumnType.EqualsAscii("DATE")) -#endif { Date aStandard(1,1,1900); if (*pDocFormatter->GetNullDate() != aStandard) @@ -721,7 +696,6 @@ SwField* SwDBNextSetField::Copy() const void SwDBNextSetField::Evaluate(SwDoc* pDoc) { -#ifdef REPLACE_OFADBMGR SwNewDBMgr* pMgr = pDoc->GetNewDBMgr(); String sTmpName(GetDBName()); String sDataSource(sTmpName.GetToken(0, DB_DELIM)); @@ -730,14 +704,6 @@ void SwDBNextSetField::Evaluate(SwDoc* pDoc) !pMgr || !pMgr->IsDataSourceOpen(sDataSource, sDataTableOrQuery)) return ; pMgr->ToNextMergeRecord(); -#else - if( bCondValid && pDoc->GetNewDBMgr() && - pDoc->GetNewDBMgr()->IsDBOpen(DBMGR_STD, GetDBName()) ) - { - // Bedingung OK -> naechste selektierter Record ist der aktuelle - pDoc->GetNewDBMgr()->ToNextSelectedRecord(DBMGR_STD); - } -#endif } /*-------------------------------------------------------------------- @@ -846,7 +812,6 @@ SwField* SwDBNumSetField::Copy() const void SwDBNumSetField::Evaluate(SwDoc* pDoc) { SwNewDBMgr* pMgr = pDoc->GetNewDBMgr(); -#ifdef REPLACE_OFADBMGR String sTmpName(GetDBName()); String sDataSource(sTmpName.GetToken(0, DB_DELIM)); String sDataTableOrQuery(sTmpName.GetToken(1, DB_DELIM)); @@ -855,13 +820,6 @@ void SwDBNumSetField::Evaluate(SwDoc* pDoc) { // Bedingug OK -> aktuellen Set einstellen pMgr->ToRecordId(Max((USHORT)aPar2.ToInt32(), USHORT(1))-1); } -#else - if( bCondValid && pMgr && pMgr->IsDBOpen(DBMGR_STD, GetDBName()) - && pMgr->IsInMerge() ) - { // Bedingug OK -> aktuellen Set einstellen - pMgr->ToSelectedRecord(DBMGR_STD, Max((USHORT)aPar2.ToInt32(), USHORT(1))-1); - } -#endif } /*-------------------------------------------------------------------- @@ -1041,7 +999,6 @@ void SwDBSetNumberField::Evaluate(SwDoc* pDoc) if (!pMgr->IsInMerge()) return; -#ifdef REPLACE_OFADBMGR String sTmpName(GetDBName()); String sDataSource(sTmpName.GetToken(0, DB_DELIM)); String sDataTableOrQuery(sTmpName.GetToken(1, DB_DELIM)); @@ -1051,14 +1008,6 @@ void SwDBSetNumberField::Evaluate(SwDoc* pDoc) return ; } nNumber = pMgr->GetSelectedRecordId() + 1; -#else - if(!(pMgr && pMgr->IsDBOpen(DBMGR_STD, GetDBName()))) - { - nNumber = 0; - return; - } - nNumber = pMgr->GetCurSelectedRecordId(DBMGR_STD) + 1; -#endif } diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index 693da93dcdd0..1f9d95e56d0f 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -2,9 +2,9 @@ * * $RCSfile: docufld.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: jp $ $Date: 2000-10-20 13:44:15 $ + * last change: $Author: os $ $Date: 2000-10-27 11:23:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1416,7 +1416,6 @@ void SwHiddenTxtField::Evaluate(SwDoc* pDoc) if (pMgr->IsInMerge()) { String sDBName; -#ifdef REPLACE_OFADBMGR sDBName = GetDBName( sTmpName, pDoc ); if(sDBName.Len()) { @@ -1431,20 +1430,6 @@ void SwHiddenTxtField::Evaluate(SwDoc* pDoc) bValid = sal_True; } } -#else - if ((sDBName = GetDBName( sTmpName, pDoc )).Len() && - pMgr->OpenDB( DBMGR_STD, sDBName, sal_False )) - { - String sColumnName( GetColumnName( sTmpName )); - - if (sColumnName.Len()) - { - pMgr->GetColumnCnt(DBMGR_STD, sColumnName, - pMgr->GetCurRecordId(DBMGR_STD), aContent); - bValid = sal_True; - } - } -#endif } else bValid = sal_True; diff --git a/sw/source/ui/app/swmodul1.cxx b/sw/source/ui/app/swmodul1.cxx index 9ec4c33c75f5..e35a6037f1d0 100644 --- a/sw/source/ui/app/swmodul1.cxx +++ b/sw/source/ui/app/swmodul1.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swmodul1.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: jp $ $Date: 2000-10-20 13:03:03 $ + * last change: $Author: os $ $Date: 2000-10-27 11:24:03 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -619,13 +619,11 @@ void SwModule::ExecDB(SfxRequest &rReq) { SwWrtShell &rSh = GetView()->GetWrtShell(); sDBName = rSh.GetDBName(); -#ifdef REPLACE_OFADBMGR #ifdef DEBUG sDBName = String::CreateFromAscii("Address Book File"); sDBName += DB_DELIM; sDBName += String::CreateFromAscii("address"); #endif //DEBUG -#endif //REPLACE_OFADBMGR rSh.EnterStdMode(); // Wechsel in Textshell erzwingen; ist fuer // das Mischen von DB-Feldern notwendig. @@ -695,29 +693,8 @@ void SwModule::ShowDBObj(SwWrtShell& rSh, const String& rDBName, sal_Bool bShowE { String sDBName(rDBName.GetToken(0, DB_DELIM)); -#ifdef REPLACE_OFADBMGR - String sTable(rDBName.GetToken(1, DB_DELIM)); - rSh.GetNewDBMgr()->ShowInBeamer( sDBName, sTable, SW_DB_SELECT_UNKNOWN, aEmptyStr ); -#else - if (sDBName.Len()) - { - OfaDBMgr *pDBMgr = OFF_APP()->GetOfaDBMgr(); - SbaDatabaseRef pConnection = pDBMgr->GetSbaObject()-> - GetDatabase(sDBName, bShowError); - if ( pConnection ) - { - String sTable(rDBName.GetToken(1, DB_DELIM)); - DBObject eType; - if( !pConnection->HasObject( eType = dbTable, sTable ) && - !pConnection->HasObject( eType = dbQuery , sTable )) - eType = dbTable; - - //wenn keine Connection gefunden wurde, dann braucht man auch - //den Beamer nicht - pDBMgr->ShowInBeamer( sDBName, sTable, eType, aEmptyStr ); - } - } -#endif + String sTable(rDBName.GetToken(1, DB_DELIM)); + rSh.GetNewDBMgr()->ShowInBeamer( sDBName, sTable, SW_DB_SELECT_UNKNOWN, aEmptyStr ); } /*-------------------------------------------------------------------- diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index 49d4b4c1123c..d742c8402bb8 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dbinsdlg.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: os $ $Date: 2000-10-20 14:18:01 $ + * last change: $Author: os $ $Date: 2000-10-27 11:24:06 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -69,7 +69,6 @@ #include <hintids.hxx> #endif -#ifdef REPLACE_OFADBMGR #ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #endif @@ -131,10 +130,6 @@ #include <svtools/numuno.hxx> #endif -#else - -#endif //REPLACE_OFADBMGR - #include <sdb/tools.hxx> #ifndef _SDB_SDBCURS_HXX //autogen #include <sdb/sdbcurs.hxx> @@ -276,7 +271,6 @@ #endif -#ifdef REPLACE_OFADBMGR using namespace rtl; using namespace com::sun::star; using namespace com::sun::star::uno; @@ -287,11 +281,10 @@ using namespace com::sun::star::sdbc; using namespace com::sun::star::sdbcx; using namespace com::sun::star::beans; using namespace com::sun::star::util; -#define C2U(cChar) OUString::createFromAscii(cChar) -#endif const char cDBFldStart = '<'; const char cDBFldEnd = '>'; +#define C2U(cChar) OUString::createFromAscii(cChar) #define C2S(cChar) String::CreateFromAscii(cChar) // Hilfsstruktur fuers einfuegen von Datenbankspalten als Felder oder Text @@ -411,14 +404,10 @@ int SwInsDBColumn::operator<( const SwInsDBColumn& rCmp ) const /* --------------------------------------------------------------------------- ---------------------------------------------------------------------------*/ -#ifdef REPLACE_OFADBMGR SwInsertDBColAutoPilot::SwInsertDBColAutoPilot( SwView& rView, Reference<XDataSource> xDataSource, Reference<sdbcx::XColumnsSupplier> xColSupp, const SwInsDBData& rData ) -#else -SwInsertDBColAutoPilot::SwInsertDBColAutoPilot( SwView& rView ) -#endif //REPLACE_OFADBMGR : SfxModalDialog( rView.GetWindow(), SW_RES( DLG_AP_INSERT_DB_SEL )), aFtInsertData( this, SW_RES( FT_INSERT_DATA )), aRbAsTable( this, SW_RES( RB_AS_TABLE )), @@ -457,9 +446,7 @@ SwInsertDBColAutoPilot::SwInsertDBColAutoPilot( SwView& rView ) aPbTblAutofmt( this, SW_RES( PB_TBL_AUTOFMT )), sNoTmpl( SW_RES( STR_NOTEMPL )), -#ifdef REPLACE_OFADBMGR aDBData(rData), -#endif //REPLACE_OFADBMGR pView( &rView ), pTAutoFmt( 0 ), pTblSet( 0 ), @@ -471,7 +458,6 @@ SwInsertDBColAutoPilot::SwInsertDBColAutoPilot( SwView& rView ) nGBFmtLen = aGbDbFormat.GetText().Len(); -#ifdef REPLACE_OFADBMGR if(xColSupp.is()) { SwWrtShell& rSh = pView->GetWrtShell(); @@ -576,58 +562,6 @@ SwInsertDBColAutoPilot::SwInsertDBColAutoPilot( SwView& rView ) } } } -#else - // die ListBoxen mit den Spaltenkoepfen fuellen: - { - USHORT n; - SwNewDBMgr* pDBMgr = pView->GetWrtShell().GetNewDBMgr(); - const String& rDBName = pView->GetWrtShell().GetDBDesc(); - - if( pDBMgr->IsDBOpen( DBMGR_STD, rDBName) || - pDBMgr->OpenDB( DBMGR_STD, rDBName, TRUE ) ) - { - SbaDBDataDefRef xDBDef = pDBMgr->OpenColumnNames( DBMGR_STD ); - if( xDBDef.Is() ) - { - const SbaColumnList& rCols = xDBDef->GetOriginalColumns(); - for( n = 0; n < rCols.Count(); ++n ) - { - const SbaColumn* pCol = rCols.GetObject( n ); - const SbaNameItem& rNmItm = (SbaNameItem&)pCol->Get( - SBA_DEF_FLTNAME ); - const SbaDataFieldTypeItem& rType = (SbaDataFieldTypeItem&) - pCol->Get( SBA_DEF_FLTTYPE ); - - SwInsDBColumn* pNew = new SwInsDBColumn( - rNmItm.GetValue(), n ); - - switch( rType.GetValue() ) - { - case dbCurrency: - case dbCounter: - case dbNumeric: - case dbDateTime: - case dbDate: - case dbTime: - case dbBool: - case dbDecimal: - case dbBigInt: - pNew->bHasFmt = TRUE; - pNew->nDBNumFmt = ((SfxUInt32Item&)pCol->Get( - SBA_DEF_FMTVALUE)).GetValue(); - break; - } - - if( !aDBColumns.Insert( pNew )) - { - ASSERT( !this, "Spaltenname mehrfach vergeben?" ); - delete pNew; - } - } - } - } - } -#endif //REPLACE_OFADBMGR // Absatzvorlagen-ListBox fuellen { @@ -1224,16 +1158,11 @@ FASTBOOL SwInsertDBColAutoPilot::SplitTextToColArr( const String& rTxt, if( bInsField ) { SwWrtShell& rSh = pView->GetWrtShell(); -#ifdef REPLACE_OFADBMGR String sDBContent(aDBData.sDataBaseName); sDBContent += DB_DELIM; sDBContent += aDBData.sDataTableName; SwDBFieldType aFldType( rSh.GetDoc(), aSrch.sColumn, sDBContent ); -#else - SwDBFieldType aFldType( rSh.GetDoc(), aSrch.sColumn, - rSh.GetDBName() ); -#endif pNew = new _DB_Column( rFndCol, *new SwDBField( (SwDBFieldType*)rSh.InsertFldType( aFldType ), nFormat ) ); @@ -1257,17 +1186,12 @@ FASTBOOL SwInsertDBColAutoPilot::SplitTextToColArr( const String& rTxt, /* --------------------------------------------------------------------------- ---------------------------------------------------------------------------*/ -#ifdef REPLACE_OFADBMGR void SwInsertDBColAutoPilot::DataToDoc( const SbaSelectionList* pSelList, Reference< XDataSource> xSource, Reference< XConnection> xConnection ) -#else -void SwInsertDBColAutoPilot::DataToDoc( const SbaSelectionList* pSelList ) -#endif { SwWrtShell& rSh = pView->GetWrtShell(); -#ifdef REPLACE_OFADBMGR Reference< sdbc::XResultSet > xResultSet; Reference< sdbc::XRow > xRow; Reference< sdbc::XStatement > xStatement; @@ -1294,30 +1218,6 @@ void SwInsertDBColAutoPilot::DataToDoc( const SbaSelectionList* pSelList ) } if(!xResultSet.is() || !xRow.is()) return; -#else - - SwNewDBMgr* pDBMgr = rSh.GetNewDBMgr(); - if( ( aRbAsTable.IsChecked() ? !aLbTableCol.GetEntryCount() - : !aEdDbText.GetText().Len() ) || - !pDBMgr->ToFirstSelectedRecord( DBMGR_STD ) || - !pDBMgr->IsSuccessful( DBMGR_STD ) ) - return ; - - OfaDBParam& rParam = pDBMgr->GetDBData( DBMGR_STD ); - - rParam.pSelectionList->Clear(); - if( pSelList && -1L != (long)pSelList->GetObject( 0 ) ) - { - *rParam.pSelectionList = *pSelList; - if( !pSelList->Count() ) - pSelList = 0; - } - else - pSelList = 0; - - SbaDBDataDefRef xColDef = pDBMgr->OpenColumnNames( DBMGR_STD ); - -#endif rSh.StartAllAction(); rSh.StartUndo( 0 ); BOOL bGroupUndo = rSh.DoesGroupUndo(); @@ -1390,7 +1290,6 @@ void SwInsertDBColAutoPilot::DataToDoc( const SbaSelectionList* pSelList ) for( ULONG i = 0 ; ; ++i ) { -#ifdef REPLACE_OFADBMGR BOOL bBreak = FALSE; try { @@ -1422,12 +1321,6 @@ void SwInsertDBColAutoPilot::DataToDoc( const SbaSelectionList* pSelList ) } if(bBreak) break; -#else - if( pSelList ) - // naechsten zu lesenden Datensatz ansteuern - pDBMgr->GotoRecord( (ULONG)pSelList->GetObject( i )); - const ODbRowRef& xRow = rParam.GetCursor()->GetRow(); -#endif for( n = 0; n < nCols; ++n ) { // beim aller erstenmal KEIN GoNextCell, weil wir schon @@ -1437,7 +1330,6 @@ void SwInsertDBColAutoPilot::DataToDoc( const SbaSelectionList* pSelList ) rSh.GoNextCell(); const SwInsDBColumn* pEntry = aColFlds[ n ]; -#ifdef REPLACE_OFADBMGR Reference< XColumnsSupplier > xColsSupp( xResultSet, UNO_QUERY ); Reference <XNameAccess> xCols = xColsSupp->getColumns(); Any aCol = xCols->getByName(pEntry->sColumn); @@ -1445,9 +1337,6 @@ void SwInsertDBColAutoPilot::DataToDoc( const SbaSelectionList* pSelList ) if(aCol.hasValue()) xColumnProps = *(Reference< XPropertySet >*)aCol.getValue(); Reference< XColumn > xColumn(xColumnProps, UNO_QUERY); -#else - const ODbVariantRef& xVar = (*xRow)[pEntry->nCol+1]; -#endif try { if( pEntry->bHasFmt ) @@ -1456,21 +1345,13 @@ void SwInsertDBColAutoPilot::DataToDoc( const SbaSelectionList* pSelList ) pEntry->bIsDBFmt ? pEntry->nDBNumFmt : pEntry->nUsrNumFmt ); aTblSet.Put(aNumFmt); -#ifdef REPLACE_OFADBMGR if( xColumn.is() ) -#else - if( !xVar->isNull() ) -#endif { -#ifdef REPLACE_OFADBMGR double fVal = xColumn->getDouble(); if( xColumn->wasNull() ) aTblSet.ClearItem( RES_BOXATR_VALUE ); else { -#else - double fVal = xVar->toDouble(); -#endif if(rNumFmtr.GetType(aNumFmt.GetValue()) & NUMBERFORMAT_DATE) { ::Date aStandard(1,1,1900); @@ -1478,50 +1359,30 @@ void SwInsertDBColAutoPilot::DataToDoc( const SbaSelectionList* pSelList ) fVal += (aStandard - *rNumFmtr.GetNullDate()); } aTblSet.Put( SwTblBoxValue( fVal )); -#ifdef REPLACE_OFADBMGR } -#endif } else aTblSet.ClearItem( RES_BOXATR_VALUE ); rSh.SetTblBoxFormulaAttrs( aTblSet ); } -#ifdef REPLACE_OFADBMGR else { OUString sVal = xColumn->getString(); if(!xColumn->wasNull()) rSh.SwEditShell::Insert( sVal ); } -#else - else if( !xVar->isNull() ) - rSh.SwEditShell::Insert( xVar->toString() ); -#endif } -#ifdef REPLACE_OFADBMGR catch(Exception aExcept) { DBG_ERROR(ByteString(String(aExcept.Message), gsl_getSystemTextEncoding()).GetBuffer()) } -#else - catch(...) - { - } -#endif } if( !pSelList ) { -#ifdef REPLACE_OFADBMGR BOOL bNext = xResultSet->next(); if(!bNext) break; -#else - rParam.GetCursor()->Next(); - rParam.CurrentPos()++; - if( rParam.GetCursor()->IsOffRange() ) - break; -#endif } else if( i+1 >= pSelList->Count() ) break; @@ -1577,7 +1438,6 @@ void SwInsertDBColAutoPilot::DataToDoc( const SbaSelectionList* pSelList ) // fuers Einfuegen als Felder -> nach jedem Datensatz ein // "NextField" einfuegen -#ifdef REPLACE_OFADBMGR SwDBFormatData aDBFormatData; Reference< XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() ); if( xMgr.is() ) @@ -1636,17 +1496,11 @@ void SwInsertDBColAutoPilot::DataToDoc( const SbaSelectionList* pSelList ) GetFldType( 0, RES_DBNEXTSETFLD ), C2S("1"), aEmptyStr, sDBContent ); -#else - SwDBNextSetField aNxtDBFld( (SwDBNextSetFieldType*)rSh. - GetFldType( 0, RES_DBNEXTSETFLD ), - C2S("1"), aEmptyStr, rSh.GetDBName() ); -#endif BOOL bSetCrsr = TRUE; USHORT n, nCols = aColArr.Count(); for( ULONG i = 0 ; ; ++i ) { -#ifdef REPLACE_OFADBMGR BOOL bBreak = FALSE; try { @@ -1674,16 +1528,6 @@ void SwInsertDBColAutoPilot::DataToDoc( const SbaSelectionList* pSelList ) catch(...){ bBreak = TRUE; } if(bBreak) break; -#else - if( pSelList ) - { - ULONG nIndex = (ULONG)pSelList->GetObject( i ); - // naechsten zu lesenden Datensatz ansteuern - pDBMgr->GotoRecord( nIndex ); - } - - const ODbRowRef& xRow = rParam.GetCursor()->GetRow(); -#endif for( n = 0; n < nCols; ++n ) { _DB_Column* pDBCol = aColArr[ n ]; @@ -1707,7 +1551,6 @@ void SwInsertDBColAutoPilot::DataToDoc( const SbaSelectionList* pSelList ) SwDBField* pFld = (SwDBField*)pDBCol->DB_ColumnData. pField->Copy(); double nValue = DBL_MAX; -#ifdef REPLACE_OFADBMGR Reference< XColumnsSupplier > xColsSupp( xResultSet, UNO_QUERY ); Reference <XNameAccess> xCols = xColsSupp->getColumns(); Any aCol = xCols->getByName(pDBCol->pColInfo->sColumn); @@ -1718,11 +1561,6 @@ void SwInsertDBColAutoPilot::DataToDoc( const SbaSelectionList* pSelList ) xColumnProps, aDBFormatData, &nValue ) ); -#else - pFld->SetExpansion( pDBMgr->ImportDBField( - pDBCol->pColInfo->nCol+1, - &xColDef, xRow, &nValue ) ); -#endif if( DBL_MAX != nValue ) pFld->ChgValue( nValue, TRUE ); pFld->SetInitialized(); @@ -1735,7 +1573,6 @@ void SwInsertDBColAutoPilot::DataToDoc( const SbaSelectionList* pSelList ) case _DB_Column::DB_COL_TEXT: { double nValue = DBL_MAX; -#ifdef REPLACE_OFADBMGR Reference< XColumnsSupplier > xColsSupp( xResultSet, UNO_QUERY ); Reference <XNameAccess> xCols = xColsSupp->getColumns(); Any aCol = xCols->getByName(pDBCol->pColInfo->sColumn); @@ -1746,11 +1583,6 @@ void SwInsertDBColAutoPilot::DataToDoc( const SbaSelectionList* pSelList ) xColumnProps, aDBFormatData, &nValue ); -#else - sIns = pDBMgr->ImportDBField( - pDBCol->pColInfo->nCol+1, - &xColDef, xRow, &nValue ); -#endif if( pDBCol->DB_ColumnData.nFormat && DBL_MAX != nValue ) { @@ -1785,17 +1617,9 @@ void SwInsertDBColAutoPilot::DataToDoc( const SbaSelectionList* pSelList ) if( !pSelList ) { -#ifdef REPLACE_OFADBMGR BOOL bNext = xResultSet->next(); if(!bNext) break; -#else - rParam.GetCursor()->Next(); - rParam.CurrentPos()++; - - if( rParam.GetCursor()->IsOffRange() ) - break; -#endif } else if( i+1 >= pSelList->Count() ) break; @@ -2335,138 +2159,4 @@ void _DB_ColumnConfig::SetData( _DB_ColumnConfigData* pData ) } } -/*------------------------------------------------------------------------ - - $Log: not supported by cvs2svn $ - Revision 1.2 2000/10/06 13:32:56 jp - should changes: don't use IniManager - - Revision 1.1.1.1 2000/09/18 17:14:33 hr - initial import - - Revision 1.40 2000/09/18 16:05:18 willem.vandorp - OpenOffice header added. - - Revision 1.39 2000/07/27 21:15:40 jp - opt: get template names direct from the doc and don't load it from the resource - - Revision 1.38 2000/07/10 07:02:55 os - replace ofadbmgr - - Revision 1.37 2000/07/06 07:59:10 os - replace ofadbmgr - - Revision 1.36 2000/07/05 08:21:49 os - Replace ofadbmgr - - Revision 1.35 2000/05/26 07:21:28 os - old SW Basic API Slots removed - - Revision 1.34 2000/05/23 18:11:01 jp - Bugfixes for Unicode - - Revision 1.33 2000/04/20 12:54:38 os - GetName() returns String& - - Revision 1.32 2000/04/11 08:03:52 os - UNICODE - - Revision 1.31 2000/03/30 13:25:58 os - UNO III - - Revision 1.30 2000/02/11 14:44:18 hr - #70473# changes for unicode ( patched by automated patchtool ) - - Revision 1.29 1999/09/24 13:50:13 os - chg: ODbRow/ODbVariant - - Revision 1.28 1999/08/10 08:31:24 JP - Bug #67040#: data to text - set double to defined value - - - Rev 1.27 10 Aug 1999 10:31:24 JP - Bug #67040#: data to text - set double to defined value - - Rev 1.26 08 Jul 1999 16:07:52 MA - Use internal object to toggle wait cursor - - Rev 1.25 08 Jul 1999 09:13:50 MA - limit wait cursor to document window - - Rev 1.24 18 Jun 1999 14:03:36 JP - Bug #67040#: DataToDoc - clear ValueItem in TableSet - - Rev 1.23 16 Jun 1999 22:05:08 JP - Bug #66996##66995#: DataToDoc - set userformat flag at field, use userformat for text - - Rev 1.22 09 Jun 1999 16:25:46 JP - Bug #66735#: TblFmtHdl: no 0 pointer access - - Rev 1.21 11 May 1999 21:48:20 JP - Task #66127#: Methoden rund ums Lineal verbessert und Schnittstellen veraendert/erweitert - - Rev 1.20 29 Apr 1999 09:59:04 JP - Bug #65544#: Spalten ggfs. auch vom Bereich besorgen - - Rev 1.19 22 Feb 1999 11:50:02 JP - fuer Bug #61545#: Code optimiert - - Rev 1.18 17 Feb 1999 08:39:24 OS - #58158# Einfuegen TabPage auch in HTML-Docs - - Rev 1.17 30 Nov 1998 17:31:02 OM - #59770# Tabellenoptionen: Ueberschrift nur auf erster Seite - - Rev 1.16 27 Nov 1998 14:49:56 AMA - Fix #59951#59825#: Unterscheiden zwischen Rahmen-,Seiten- und Bereichsspalten - - Rev 1.15 11 Nov 1998 16:49:36 OM - #58158# Einfuegeoptionen fuer Tabellen - - Rev 1.14 10 Nov 1998 19:18:34 JP - Task #58158#: InsertTable/TextToTable - Flags fuer HdlRepeat/LayoutSplit mitgeben - - Rev 1.13 08 Sep 1998 16:51:16 OS - #56134# Metric fuer Text und HTML getrennt - - Rev 1.12 15 Jul 1998 09:52:26 JP - Bug #52951#: TabellenEigenschaftenButton nur enablen wenn Spalten ausgewaehlt sind - - Rev 1.11 21 Jun 1998 14:23:30 JP - Feld in FormatGroupBox anzeigen, Format richtig zuweisen - - Rev 1.10 19 Jun 1998 16:19:24 TJ - include - - Rev 1.9 17 Jun 1998 13:50:56 JP - Bug #50989#: DataToDoc - Absatztvorlagen mit anderem Follow beachten; GPF bei Eigenschaften ohne Eintraege - - Rev 1.8 15 Jun 1998 12:27:18 OM - #51009# Numberformatter-Listbox ViewPtr reinreichen - - Rev 1.7 09 Jun 1998 13:05:34 JP - Bug #50993# ReadIniToUI - bei disabled'ten InTable wird jetzt auch InFelder gecheckt - - Rev 1.6 09 Jun 1998 12:18:16 JP - Bug #50989# DataToDoc - Vorlagen setzen ist nicht so einfach moeglich - - Rev 1.5 02 Jun 1998 10:39:20 JP - TabellenAutoFormat aus der Konf. erzeugen - - Rev 1.4 29 May 1998 19:08:58 JP - Tabellen Eigenschaften koennen jetzt eingestellt werden - - Rev 1.3 28 May 1998 17:05:58 JP - Handling zum einstellen der Nummernformate geaendert - - Rev 1.2 27 May 1998 19:48:42 JP - kleinere Verbesserungen - - Rev 1.1 25 May 1998 09:49:32 JP - Tabelle formatieren erstmal abgeklemmt, bis der Dialog auch ohne Tabelle benutzbar ist - - Rev 1.0 20 May 1998 21:35:22 JP - Autopilot fuers Datenbankspalten einfuegen als Text/Felder/Tabelle - -------------------------------------------------------------------------*/ diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx index a41b77267436..31cdc3cada76 100644 --- a/sw/source/ui/dbui/dbmgr.cxx +++ b/sw/source/ui/dbui/dbmgr.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dbmgr.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: os $ $Date: 2000-10-20 14:18:01 $ + * last change: $Author: os $ $Date: 2000-10-27 11:24:06 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -84,6 +84,12 @@ #ifndef _COM_SUN_STAR_UCB_NAMECLASH_HPP_ #include <com/sun/star/ucb/NameClash.hpp> #endif +#ifndef _COM_SUN_STAR_FRAME_XCOMPONENTLOADER_HPP_ +#include <com/sun/star/frame/XComponentLoader.hpp> +#endif +#ifndef _SFXVIEWFRM_HXX +#include <sfx2/viewfrm.hxx> +#endif #ifndef _LSTBOX_HXX //autogen #include <vcl/lstbox.hxx> #endif @@ -214,7 +220,6 @@ #include <statstr.hrc> #endif -#ifdef REPLACE_OFADBMGR #ifndef _SFXREQUEST_HXX #include <sfx2/request.hxx> #endif @@ -254,9 +259,6 @@ #ifndef _COM_SUN_STAR_SDBC_RESULTSETTYPE_HPP_ #include <com/sun/star/sdbc/ResultSetType.hpp> #endif -//#ifndef _COM_SUN_STAR_SDB_XDATABASEACCESS_HPP_ -//#include <com/sun/star/sdb/XDatabaseAccess.hpp> -//#endif #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ #include <com/sun/star/beans/XPropertySet.hpp> #endif @@ -281,26 +283,21 @@ #ifndef _NUMUNO_HXX #include <svtools/numuno.hxx> #endif -#else -#endif //REPLACE_OFADBMGR - -#ifdef REPLACE_OFADBMGR using namespace rtl; +using namespace ::com::sun::star; +using namespace com::sun::star::uno; using namespace com::sun::star::container; +using namespace com::sun::star::frame; using namespace com::sun::star::lang; using namespace com::sun::star::sdb; using namespace com::sun::star::sdbc; using namespace com::sun::star::sdbcx; using namespace com::sun::star::beans; using namespace com::sun::star::util; -#define C2S(cChar) String::CreateFromAscii(cChar) -#endif - -using namespace ::com::sun::star; -using namespace ::com::sun::star::uno; using namespace ::com::sun::star::ucb; +#define C2S(cChar) String::CreateFromAscii(cChar) #define C2U(char) rtl::OUString::createFromAscii(char) #define DB_SEP_SPACE 0 @@ -308,7 +305,6 @@ using namespace ::com::sun::star::ucb; #define DB_SEP_RETURN 2 #define DB_SEP_NEWLINE 3 -#ifdef REPLACE_OFADBMGR SV_IMPL_PTRARR(SwDSParamArr, SwDSParamPtr); /* -----------------------------17.07.00 17:04-------------------------------- @@ -371,7 +367,6 @@ BOOL lcl_GetColumnCnt(SwDSParam* pParam, rResult = SwNewDBMgr::GetDBField( xColumnProps, aFormatData, pNumber); return TRUE; }; -#endif /*-------------------------------------------------------------------- Beschreibung: Daten importieren --------------------------------------------------------------------*/ @@ -379,28 +374,15 @@ BOOL lcl_GetColumnCnt(SwDSParam* pParam, BOOL SwNewDBMgr::Merge( USHORT nOpt, SwWrtShell* pSh, const String& rStatement, const SbaSelectionListRef xSelectionList, -#ifdef REPLACE_OFADBMGR const String& rDataSource, const String& rTableOrQuery, -#else - const String& rDBName, -#endif const String *pPrinter) { -#ifdef REPLACE_OFADBMGR ChgDBName(pSh, rDataSource, rTableOrQuery,rStatement); -#else - ChgDBName(pSh, rDBName, rStatement); -#endif // Falls noch nicht offen, spaetestens hier -#ifdef REPLACE_OFADBMGR if(!OpenMergeSource(rDataSource, rTableOrQuery, rStatement, xSelectionList)) return FALSE; -#else - if(!OpenDB(FALSE, pSh->GetDBDesc())) - return FALSE; -#endif if (IsInitDBFields()) { @@ -410,25 +392,12 @@ BOOL SwNewDBMgr::Merge( USHORT nOpt, SwWrtShell* pSh, pSh->ChangeDBFields( aDBNames, pSh->GetDBName()); SetInitDBFields(FALSE); } -#ifdef REPLACE_OFADBMGR const SbaSelectionList* pSelList = 0; if( xSelectionList.Is() && (long)xSelectionList->GetObject(0) != -1L ) { if( xSelectionList->Count() ) pSelList = &xSelectionList; } -#else - OfaDBParam& rParam = GetDBData(FALSE); - ChangeStatement(FALSE, rStatement); - const SbaSelectionList* pSelList = 0; - rParam.pSelectionList->Clear(); - if( xSelectionList.Is() && (long)xSelectionList->GetObject(0) != -1L ) - { - *rParam.pSelectionList = *xSelectionList; - if( xSelectionList->Count() ) - pSelList = &xSelectionList; - } -#endif BOOL bRet = TRUE; switch(nOpt) @@ -470,19 +439,11 @@ BOOL SwNewDBMgr::Merge( USHORT nOpt, SwWrtShell* pSh, default: // Einfuegen der selektierten Eintraege // (war: InsertRecord) -#ifdef REPLACE_OFADBMGR ImportFromConnection(pSh ); -#else - ImportFromConnection(pSh, pSelList ); -#endif break; } -#ifdef REPLACE_OFADBMGR EndMerge(); -#else - CloseAll(); -#endif return bRet; } /*-------------------------------------------------------------------- @@ -493,24 +454,6 @@ BOOL SwNewDBMgr::Merge( USHORT nOpt, SwWrtShell* pSh, BOOL SwNewDBMgr::Merge(SwWrtShell* pSh) { pSh->StartAllAction(); -#ifdef REPLACE_OFADBMGR -#else - bInMerge = TRUE; - - // 1. Satz positionieren, Evaluierung ueber die Felder - for (USHORT i = 0; i < aDBDataArr.Count(); i++) - { - OfaDBParam* pParam = aDBDataArr[i]; - - // Alle Im Dok enthaltenen Datenbanken oeffnen und Cursorpos initialisieren - if (OpenDB(FALSE, pParam->GetDBName())) - { - if (pParam->GetCursor()) - Flush(FALSE); // Cursor initialisieren - ToFirstSelectedRecord(FALSE); - } - } -#endif /* for (ULONG i = 0 ; i < GetDBData().pSelectionList->Count(); i++) { @@ -521,11 +464,6 @@ BOOL SwNewDBMgr::Merge(SwWrtShell* pSh) pSh->ViewShell::UpdateFlds(TRUE); pSh->SetModified(); -#ifdef REPLACE_OFADBMGR -#else - bInMerge = FALSE; -#endif - pSh->EndAllAction(); return TRUE; @@ -567,28 +505,10 @@ BOOL SwNewDBMgr::Merge(SwWrtShell* pSh) --------------------------------------------------------------------*/ -#ifdef REPLACE_OFADBMGR void SwNewDBMgr::ImportFromConnection( SwWrtShell* pSh ) -#else -void SwNewDBMgr::ImportFromConnection( SwWrtShell* pSh, - const SbaSelectionList* pSelList ) -#endif { -#ifdef REPLACE_OFADBMGR if(pMergeData && !pMergeData->bEndOfDB) -#else - OfaDBParam& rParam = GetDBData(FALSE); - ASSERT(rParam.GetCursor(), "Cursor"); - - if( ToFirstSelectedRecord( FALSE ) && IsSuccessful( FALSE ) ) -#endif { -#ifdef REPLACE_OFADBMGR -#else - // Spaltenkoepfe - SbaDBDataDefRef aDBDef = OpenColumnNames(FALSE); - if( aDBDef.Is() ) -#endif { pSh->StartAllAction(); pSh->StartUndo(0); @@ -600,47 +520,15 @@ void SwNewDBMgr::ImportFromConnection( SwWrtShell* pSh, SwWait *pWait = 0; -#ifdef REPLACE_OFADBMGR -#else - if( pSelList ) - { - for( ULONG i = 0; i < pSelList->Count(); ++i ) - { - - ULONG nIndex = (ULONG)pSelList->GetObject( i ); - - ASSERT(nIndex >= rParam.CurrentPos(), - "Zu lesender Datensatz < vorhergehender Datensatz!"); - - // Nchsten zu lesenden Datensatz ansteuern - GotoRecord( nIndex ); - ImportDBEntry(&aDBDef, pSh); - - if( i == 10 ) - pWait = new SwWait( *pSh->GetView().GetDocShell(), TRUE ); - } - } - else -#endif { ULONG i = 0; do { -#ifdef REPLACE_OFADBMGR ImportDBEntry(pSh); -#else - ImportDBEntry(&aDBDef, pSh); - rParam.GetCursor()->Next(); - rParam.CurrentPos()++; -#endif if( 10 == ++i ) pWait = new SwWait( *pSh->GetView().GetDocShell(), TRUE); -#ifdef REPLACE_OFADBMGR } while(ToNextMergeRecord()); -#else - } while( !rParam.GetCursor()->IsOffRange() ); -#endif } pSh->DoGroupUndo(bGroupUndo); @@ -649,10 +537,6 @@ void SwNewDBMgr::ImportFromConnection( SwWrtShell* pSh, delete pWait; } } -#ifdef REPLACE_OFADBMGR -#else - CloseAll(); -#endif } @@ -704,31 +588,16 @@ inline String lcl_GetDBInsertMode( String sDBName ) } -#ifdef REPLACE_OFADBMGR void SwNewDBMgr::ImportDBEntry(SwWrtShell* pSh) -#else -void SwNewDBMgr::ImportDBEntry(SbaDBDataDef* pDef, SwWrtShell* pSh) -#endif { -#ifdef REPLACE_OFADBMGR if(pMergeData && !pMergeData->bEndOfDB) -#else - OfaDBParam& rParam = GetDBData(FALSE); - if( !rParam.GetCursor()->IsOffRange() ) -#endif { -#ifdef REPLACE_OFADBMGR Reference< XColumnsSupplier > xColsSupp( pMergeData->xResultSet, UNO_QUERY ); Reference <XNameAccess> xCols = xColsSupp->getColumns(); String sSymDBName(pMergeData->sDataSource); sSymDBName += DB_DELIM; sSymDBName += pMergeData->sTableOrQuery; String sFormatStr( lcl_GetDBInsertMode( sSymDBName )); -#else - const ODbRowRef& xRow = rParam.GetCursor()->GetRow(); - ULONG nCount = (UINT16)xRow->size(); - String sFormatStr( lcl_GetDBInsertMode( rParam.GetSymDBName() )); -#endif USHORT nFmtLen = sFormatStr.Len(); if( nFmtLen ) { @@ -739,7 +608,6 @@ void SwNewDBMgr::ImportDBEntry(SbaDBDataDef* pDef, SwWrtShell* pSh) String sColumn = lcl_FindColumn(sFormatStr, nUsedPos, nSeparator); while( sColumn.Len() ) { -#ifdef REPLACE_OFADBMGR if(!xCols->hasByName(sColumn)) return; Any aCol = xCols->getByName(sColumn); @@ -748,12 +616,6 @@ void SwNewDBMgr::ImportDBEntry(SbaDBDataDef* pDef, SwWrtShell* pSh) { SwDBFormatData aDBFormat; String sInsert = GetDBField( xColumnProp, aDBFormat); -#else - int nColumn = GetColumnPos(DBMGR_STD, sColumn); - if(nColumn > 0) - { - String sInsert = ImportDBField(nColumn, pDef, xRow); -#endif if( DB_SEP_SPACE == nSeparator ) sInsert += cSpace; else if( DB_SEP_TAB == nSeparator) @@ -779,7 +641,6 @@ void SwNewDBMgr::ImportDBEntry(SbaDBDataDef* pDef, SwWrtShell* pSh) else { String sStr; -#ifdef REPLACE_OFADBMGR Sequence<OUString> aColNames = xCols->getElementNames(); const OUString* pColNames = aColNames.getConstArray(); long nLength = aColNames.getLength(); @@ -792,14 +653,6 @@ void SwNewDBMgr::ImportDBEntry(SbaDBDataDef* pDef, SwWrtShell* pSh) if (i < nLength - 1) sStr += '\t'; } -#else - for (ULONG i = 1; i < nCount; i++) // 0 = Bookmark - { - sStr += ImportDBField(i, pDef, xRow); - if (i < nCount - 1) - sStr += '\t'; - } -#endif pSh->SwEditShell::Insert(sStr); pSh->SwFEShell::SplitNode(); // Zeilenvorschub } @@ -812,23 +665,15 @@ void SwNewDBMgr::ImportDBEntry(SbaDBDataDef* pDef, SwWrtShell* pSh) void SwNewDBMgr::ChgDBName(SwWrtShell* pSh, -#ifdef REPLACE_OFADBMGR const String& rDataSource, const String& rTableOrQuery, -#else - const String& rDBName, -#endif const String& rStatement) { if (pSh) { -#ifdef REPLACE_OFADBMGR String sNewDBName(rDataSource); sNewDBName += DB_DELIM; sNewDBName += rTableOrQuery; -#else - String sNewDBName(ExtractDBName(rDBName)); -#endif sNewDBName += ';'; sNewDBName += rStatement; pSh->ChgDBName(sNewDBName); @@ -838,16 +683,11 @@ void SwNewDBMgr::ChgDBName(SwWrtShell* pSh, /*-------------------------------------------------------------------- Beschreibung: Listbox mit Tabellenliste fuellen --------------------------------------------------------------------*/ -#ifdef REPLACE_OFADBMGR BOOL SwNewDBMgr::GetTableNames(ListBox* pListBox, const String& rDBName) -#else -BOOL SwNewDBMgr::GetTableNames(ListBox* pListBox, String sDBName) -#endif { BOOL bRet = FALSE; String sOldTableName(pListBox->GetSelectEntry()); pListBox->Clear(); -#ifdef REPLACE_OFADBMGR Reference< XDataSource> xSource; Reference< XConnection> xConnection = SwNewDBMgr::GetConnection(rDBName, xSource); if(xConnection.is()) @@ -874,57 +714,17 @@ BOOL SwNewDBMgr::GetTableNames(ListBox* pListBox, String sDBName) pListBox->SelectEntry(sOldTableName); bRet = TRUE; } -#else - - sDBName = OFF_APP()->LocalizeDBName(NATIONAL2INI, sDBName); - if (sDBName.Len()) - { - SbaDatabaseRef pConnection = pSbaObject->GetDatabase(sDBName, TRUE); - - if (pConnection) - { - String sTableName; - - USHORT nCount = pConnection->GetObjectCount(dbTable); - - for (USHORT i = 0; i < nCount; i++) - { - sTableName = pConnection->GetObjectName(dbTable, i); - pListBox->InsertEntry(sTableName); - } - - nCount = pConnection->GetObjectCount(dbQuery); - - for (i = 0; i < nCount; i++) - { - sTableName = pConnection->GetObjectName(dbQuery, i); - pListBox->InsertEntry(sTableName); - } - - if (sOldTableName.Len()) - pListBox->SelectEntry(sOldTableName); - if (!pListBox->GetSelectEntryCount()) - pListBox->SelectEntryPos(0); - bRet = TRUE; - } - } -#endif return bRet; } /*-------------------------------------------------------------------- Beschreibung: Listbox mit Spaltennamen einer Datenbank fuellen --------------------------------------------------------------------*/ -#ifdef REPLACE_OFADBMGR BOOL SwNewDBMgr::GetColumnNames(ListBox* pListBox, const String& rDBName, const String& rTableName, BOOL bAppend) -#else -BOOL SwNewDBMgr::GetColumnNames(ListBox* pListBox, String sDBName, BOOL bAppend) -#endif { if (!bAppend) pListBox->Clear(); -#ifdef REPLACE_OFADBMGR Reference< XDataSource> xSource; Reference< XConnection> xConnection = SwNewDBMgr::GetConnection(rDBName, xSource); Reference< XColumnsSupplier> xColsSupp = SwNewDBMgr::GetColumnSupplier(xConnection, rTableName); @@ -938,25 +738,6 @@ BOOL SwNewDBMgr::GetColumnNames(ListBox* pListBox, String sDBName, BOOL bAppend) pListBox->InsertEntry(pColNames[nCol]); } } -#else - if (!sDBName.Len() || (!IsDBOpen(DBMGR_STD, sDBName) && !OpenDB(DBMGR_STD, sDBName, TRUE))) - return(FALSE); - - SbaDBDataDefRef aDBDef = OpenColumnNames(DBMGR_STD); - - if (aDBDef.Is()) - { - const SbaColumnList& rCols = aDBDef->GetOriginalColumns(); - - for (USHORT i = 1; i <= rCols.Count(); i++) - { - const SbaNameItem* pNameItem = (const SbaNameItem*)&rCols.GetObject(i-1)->Get(SBA_DEF_FLTNAME); - pListBox->InsertEntry(pNameItem->GetValue()); - } - - pListBox->SelectEntryPos(0); - } -#endif return(TRUE); } @@ -965,12 +746,8 @@ BOOL SwNewDBMgr::GetColumnNames(ListBox* pListBox, String sDBName, BOOL bAppend) --------------------------------------------------------------------*/ SwNewDBMgr::SwNewDBMgr() : -#ifdef REPLACE_OFADBMGR pMergeData(0), bInMerge(FALSE), -#else - OfaDBMgr(), -#endif nMergeType(DBMGR_INSERT), bInitDBFields(FALSE) { @@ -979,11 +756,9 @@ SwNewDBMgr::SwNewDBMgr() : /* -----------------------------18.07.00 08:56-------------------------------- ---------------------------------------------------------------------------*/ -#ifdef REPLACE_OFADBMGR SwNewDBMgr::~SwNewDBMgr() { } -#endif /*-------------------------------------------------------------------- Beschreibung: Serienbrief drucken --------------------------------------------------------------------*/ @@ -995,44 +770,9 @@ BOOL SwNewDBMgr::MergePrint( SwView& rView, SwWrtShell* pSh = &rView.GetWrtShell(); //check if the doc is synchronized and contains at least one linked section BOOL bSynchronizedDoc = pSh->IsLabelDoc() && pSh->GetSectionFmtCount() > 1; -#ifdef REPLACE_OFADBMGR //merge source is already open rOpt.nMergeCnt = pMergeData && pMergeData->xSelectionList.Is() ? pMergeData->xSelectionList->Count() : 0; -#else - OfaDBParam& rParam = GetDBData(FALSE); - - // 1. Satz positionieren, Evaluierung ueber die Felder - for (USHORT i = 0; i < aDBDataArr.Count(); i++) - { - OfaDBParam* pParam = aDBDataArr[i]; - - // Alle Im Dok enthaltenen Datenbanken oeffnen und Cursorpos initialisieren - if (OpenDB(FALSE, pParam->GetDBName())) - { - if (pParam->GetCursor()) - Flush(FALSE); // Cursor initialisieren - ToFirstSelectedRecord(FALSE); - } - } - - OpenDB(FALSE, rParam.GetDBName()); - if (!ToFirstSelectedRecord(FALSE)) - return(FALSE); - ODbRowRef xRow = GetCurSelectedRecord(FALSE); - // keine Arme keine Kekse - if(!xRow.is()) - return FALSE; - - bInMerge = TRUE; - - rOpt.nMergeCnt = GetDBData(FALSE).pSelectionList.Is() - ? GetDBData(FALSE).pSelectionList->Count() - : 0; - rOpt.nMergeAct = 0; - - Flush(FALSE); // Cursor initialisieren -#endif // if (IsPrintFromBasicDB()) // rOpt.bSinglePrtJobs = IsSingleJobs(); @@ -1052,13 +792,6 @@ BOOL SwNewDBMgr::MergePrint( SwView& rView, bRet = FALSE; do { -#ifdef REPLACE_OFADBMGR - -#else - xRow = GetCurSelectedRecord(FALSE); // Naechste Selektion holen - ULONG nOldRec = GetCurRecordId(FALSE); // Alte Position merken - if(xRow.Is()) -#endif { pSh->ViewShell::UpdateFlds(); ++rOpt.nMergeAct; @@ -1085,16 +818,7 @@ BOOL SwNewDBMgr::MergePrint( SwView& rView, rJNm.Erase(); } } -#ifdef REPLACE_OFADBMGR } while( bSynchronizedDoc ? ExistsNextRecord() : ToNextMergeRecord()); -#else - // Kontext fuer ToNextSelectedRecord auf richtige Datenbank stellen: - GetDBData(FALSE, &rParam.GetDBName()); - // Endlosschleifen durch "Erster Datensatz" verhindern: - if (GetCurRecordId(FALSE) < nOldRec) - ToSelectedRecord(FALSE, nOldRec); // Alte Position restaurieren - } while( xRow.is() && GotoNextSelectedRecord( bSynchronizedDoc) ); -#endif if( rOpt.bSinglePrtJobs ) { @@ -1121,10 +845,6 @@ BOOL SwNewDBMgr::MergePrint( SwView& rView, pTmpFrm = pTmpFrm->GetNext(*pTmpFrm, pDocSh); } -#ifdef REPLACE_OFADBMGR -#else - CloseAll(); -#endif return bRet; } @@ -1137,63 +857,15 @@ BOOL SwNewDBMgr::MergeMailing(SwWrtShell* pSh) { //check if the doc is synchronized and contains at least one linked section BOOL bSynchronizedDoc = pSh->IsLabelDoc() && pSh->GetSectionFmtCount() > 1; -#ifdef REPLACE_OFADBMGR -#else - - OfaDBParam& rParam = GetDBData(FALSE); - - // 1. Satz positionieren, Evaluierung ueber die Felder - for (USHORT i = 0; i < aDBDataArr.Count(); i++) - { - OfaDBParam* pParam = aDBDataArr[i]; - - // Alle Im Dok enthaltenen Datenbanken oeffnen und Cursorpos initialisieren - if (OpenDB(FALSE, pParam->GetDBName())) - { - if (pParam->GetCursor()) - Flush(FALSE); // Cursor initialisieren - ToFirstSelectedRecord(FALSE); - } - } - - OpenDB(FALSE, rParam.GetDBName()); - if (!ToFirstSelectedRecord(FALSE)) - return(FALSE); - - ODbRowRef xRow = GetCurSelectedRecord(FALSE); -#endif BOOL bLoop = TRUE; -#ifdef REPLACE_OFADBMGR -#else - // keine Arme keine Kekse - if(!xRow.is()) - return FALSE; - SbaDBDataDefRef aDBDef = OpenColumnNames(FALSE); - if (aDBDef.Is()) -#endif { -#ifdef REPLACE_OFADBMGR Reference< XColumnsSupplier > xColsSupp( pMergeData->xResultSet, UNO_QUERY ); Reference <XNameAccess> xCols = xColsSupp->getColumns(); if(!xCols->hasByName(sEMailAddrFld)) return FALSE; Any aCol = xCols->getByName(sEMailAddrFld); Reference< XPropertySet > xColumnProp = *(Reference< XPropertySet >*)aCol.getValue();; -#else - const SbaColumnList& rCols = aDBDef->GetOriginalColumns(); - USHORT nColPos = 0; - for (nColPos = 0; nColPos < rCols.Count(); nColPos++) - { - const SbaNameItem* pNameItem = (const SbaNameItem*)&rCols.GetObject(nColPos)->Get(SBA_DEF_FLTNAME); - if (pNameItem->GetValue() == sEMailAddrFld) - break; - } - - if (nColPos >= rCols.Count()) - return FALSE; - nColPos++; -#endif bInMerge = TRUE; SfxDispatcher* pSfxDispatcher = pSh->GetView().GetViewFrame()->GetDispatcher(); @@ -1207,10 +879,6 @@ BOOL SwNewDBMgr::MergeMailing(SwWrtShell* pSh) SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig(); BYTE nMailFmts = pModOpt->GetMailingFormats() | TXTFORMAT_ASCII; // Immer Ascii SfxByteItem aTextFormats(SID_MAIL_TXTFORMAT, nMailFmts); -#ifdef REPLACE_OFADBMGR -#else - Flush(FALSE); // Cursor initialisieren -#endif pSfxDispatcher->Execute( SID_SAVEDOC, SFX_CALLMODE_SYNCHRON|SFX_CALLMODE_RECORD); if( !pSh->IsModified() ) @@ -1313,13 +981,6 @@ BOOL SwNewDBMgr::MergeMailing(SwWrtShell* pSh) do { -#ifdef REPLACE_OFADBMGR -#else - // Naechste Selektion holen - xRow = GetCurSelectedRecord(FALSE); - ULONG nOldRec = GetCurRecordId(FALSE); // Alte Position merken - if( xRow.is() && xRow->size() > 0) -#endif { if(UIUNDO_DELETE_INVISIBLECNTNT == rSh.GetUndoIds()) @@ -1330,12 +991,8 @@ BOOL SwNewDBMgr::MergeMailing(SwWrtShell* pSh) rSh.RemoveInvisibleContent(); SfxFrameItem aFrame( SID_DOCFRAME, pVItem->GetFrame() ); -#ifdef REPLACE_OFADBMGR SwDBFormatData aDBFormat; sAddress = GetDBField( xColumnProp, aDBFormat); -#else - sAddress = ImportDBField(nColPos, &aDBDef, xRow); -#endif if (!sAddress.Len()) sAddress = '_'; @@ -1369,17 +1026,7 @@ BOOL SwNewDBMgr::MergeMailing(SwWrtShell* pSh) break; // das Verschicken wurde unterbrochen } -#ifdef REPLACE_OFADBMGR } while( !bCancel && bSynchronizedDoc ? ExistsNextRecord() : ToNextMergeRecord()); -#else - // Kontext fuer ToNextSelectedRecord auf richtige Datenbank stellen: - GetDBData(FALSE, &rParam.GetDBName()); - - // Endlosschleifen durch "Erster Datensatz" verhindern: - if (GetCurRecordId(FALSE) < nOldRec) - ToSelectedRecord(FALSE, nOldRec); // Alte Position restaurieren - } while(!bCancel && xRow.is() && GotoNextSelectedRecord( bSynchronizedDoc)); -#endif pDoc->SetNewDBMgr( pOldDBMgr ); pView->GetDocShell()->OwnerLock( FALSE ); @@ -1407,42 +1054,9 @@ BOOL SwNewDBMgr::MergeMailing(SwWrtShell* pSh) bInMerge = FALSE; nMergeType = DBMGR_INSERT; } - -#ifdef REPLACE_OFADBMGR -#else - CloseAll(); -#endif return bLoop; } -/* -----------------------------17.04.00 11:18-------------------------------- - - ---------------------------------------------------------------------------*/ -#ifdef REPLACE_OFADBMGR -#else -BOOL SwNewDBMgr::GotoNextSelectedRecord( BOOL bSyncronized ) -{ - BOOL bRet = FALSE; - if(!bSyncronized) - bRet = ToNextSelectedRecord( FALSE ); - else - { - OfaDBParam& rParam = GetDBData(FALSE); - if (rParam.GetCursor()) - { - if (rParam.pSelectionList.Is() && rParam.pSelectionList->Count()) - { - bRet = (rParam.CurrentSelPos() < rParam.pSelectionList->Count()); - } - else - { - bRet = !rParam.GetCursor()->IsOffRange(); - } - } - } - return(bRet); -} -#endif /*-------------------------------------------------------------------- Beschreibung: Serienbriefe als einzelne Dokumente speichern --------------------------------------------------------------------*/ @@ -1451,80 +1065,26 @@ BOOL SwNewDBMgr::MergeMailFiles(SwWrtShell* pSh) { //check if the doc is synchronized and contains at least one linked section BOOL bSynchronizedDoc = pSh->IsLabelDoc() && pSh->GetSectionFmtCount() > 1; -#ifdef REPLACE_OFADBMGR -#else - OfaDBParam& rParam = GetDBData(FALSE); - - // 1. Satz positionieren, Evaluierung ueber die Felder - for (USHORT i = 0; i < aDBDataArr.Count(); i++) - { - OfaDBParam* pParam = aDBDataArr[i]; - - // Alle im Dok enthaltenen Datenbanken oeffnen und Cursorpos initialisieren - if (OpenDB(FALSE, pParam->GetDBName())) - { - if (pParam->GetCursor()) - Flush(FALSE); // Cursor initialisieren - ToFirstSelectedRecord(FALSE); - } - } - - OpenDB(FALSE, rParam.GetDBName()); - if (!ToFirstSelectedRecord(FALSE)) - return(FALSE); - - ODbRowRef xRow = GetCurSelectedRecord(FALSE); - - // keine Arme keine Kekse - if(!xRow.is()) - return FALSE; -#endif BOOL bLoop = TRUE; -#ifdef REPLACE_OFADBMGR Reference< XPropertySet > xColumnProp; -#else - SbaDBDataDefRef aDBDef = OpenColumnNames(FALSE); - if (aDBDef.Is()) -#endif { USHORT nColPos = 0; BOOL bColumnName = sEMailAddrFld.Len() > 0; if (bColumnName) { -#ifdef REPLACE_OFADBMGR Reference< XColumnsSupplier > xColsSupp( pMergeData->xResultSet, UNO_QUERY ); Reference <XNameAccess> xCols = xColsSupp->getColumns(); if(!xCols->hasByName(sEMailAddrFld)) return FALSE; Any aCol = xCols->getByName(sEMailAddrFld); xColumnProp = *(Reference< XPropertySet >*)aCol.getValue();; -#else - const SbaColumnList& rCols = aDBDef->GetOriginalColumns(); - - for (nColPos = 0; nColPos < rCols.Count(); nColPos++) - { - const SbaNameItem* pNameItem = (const SbaNameItem*)&rCols.GetObject(nColPos)->Get(SBA_DEF_FLTNAME); - if (pNameItem->GetValue() == sEMailAddrFld) - break; - } - - if (nColPos >= rCols.Count()) - return FALSE; - - nColPos++; -#endif } bInMerge = TRUE; SfxDispatcher* pSfxDispatcher = pSh->GetView().GetViewFrame()->GetDispatcher(); -#ifdef REPLACE_OFADBMGR -#else - Flush(FALSE); // Cursor initialisieren -#endif - pSfxDispatcher->Execute( SID_SAVEDOC, SFX_CALLMODE_SYNCHRON|SFX_CALLMODE_RECORD); if( !pSh->IsModified() ) { @@ -1558,26 +1118,13 @@ BOOL SwNewDBMgr::MergeMailFiles(SwWrtShell* pSh) String sExt( INetURLObject( sOldName ).GetExtension() ); do { -#ifdef REPLACE_OFADBMGR -#else - // Naechste Selektion holen - xRow = GetCurSelectedRecord(FALSE); - ULONG nOldRec = GetCurRecordId(FALSE); // Alte Position merken - - if( xRow.is() && xRow->size() > 0 ) -#endif { String sPath(sSubject); if( bColumnName ) { -#ifdef REPLACE_OFADBMGR SwDBFormatData aDBFormat; sAddress = GetDBField( xColumnProp, aDBFormat); -#else - - sAddress = ImportDBField(nColPos, &aDBDef, xRow); -#endif if (!sAddress.Len()) sAddress = '_'; sPath += sAddress; @@ -1641,19 +1188,7 @@ BOOL SwNewDBMgr::MergeMailFiles(SwWrtShell* pSh) xDocSh->DoClose(); } } -#ifdef REPLACE_OFADBMGR } while( !bCancel && bSynchronizedDoc ? ExistsNextRecord() : ToNextMergeRecord()); -#else - // Kontext fuer ToNextSelectedRecord auf - // richtige Datenbank stellen: - GetDBData(FALSE, &rParam.GetDBName()); - - // Endlosschleifen durch "Erster Datensatz" verhindern: - if( !bCancel && GetCurRecordId(FALSE) < nOldRec ) - ToSelectedRecord(FALSE, nOldRec); // Alte Position restaurieren - } while( !bCancel && xRow.is() && - GotoNextSelectedRecord( bSynchronizedDoc) ); -#endif // Alle Dispatcher freigeben pViewFrm = SfxViewFrame::GetFirst(pDocSh); while (pViewFrm) @@ -1669,10 +1204,6 @@ BOOL SwNewDBMgr::MergeMailFiles(SwWrtShell* pSh) nMergeType = DBMGR_INSERT; } -#ifdef REPLACE_OFADBMGR -#else - CloseAll(); -#endif return bLoop; } @@ -1694,20 +1225,14 @@ IMPL_LINK_INLINE_END( SwNewDBMgr, PrtCancelHdl, Button *, pButton ) den uebergebenen Formatter uebertragen --------------------------------------------------------------------*/ -#ifdef REPLACE_OFADBMGR ULONG SwNewDBMgr::GetColumnFmt( const String& rDBName, const String& rTableName, const String& rColNm, SvNumberFormatter* pNFmtr, long nLanguage ) -#else -ULONG SwNewDBMgr::GetColumnFmt( const String& rDBName, const String& rColNm, - SvNumberFormatter* pNFmtr ) -#endif { //JP 12.01.99: ggfs. das NumberFormat im Doc setzen ULONG nRet = 0; -#ifdef REPLACE_OFADBMGR if(pNFmtr) { SvNumberFormatsSupplierObj* pNumFmt = new SvNumberFormatsSupplierObj( pNFmtr ); @@ -1779,24 +1304,11 @@ ULONG SwNewDBMgr::GetColumnFmt( const String& rDBName, const String& rColNm, else nRet = pNFmtr->GetFormatIndex( NF_NUMBER_STANDARD, LANGUAGE_SYSTEM ); } -#else - if( pNFmtr ) - { - int nCol; - if( OpenDB( DBMGR_STD, rDBName, FALSE ) && - 0 != ( nCol = GetColumnPos( DBMGR_STD, rColNm ))) - nRet = GetRealColumnFmt( rColNm, GetColumnFormat( DBMGR_STD, nCol ), - *pNFmtr ); - else - nRet = pNFmtr->GetFormatIndex( NF_NUMBER_STANDARD, LANGUAGE_SYSTEM ); - } -#endif return nRet; } /* -----------------------------17.07.00 09:47-------------------------------- ---------------------------------------------------------------------------*/ -#ifdef REPLACE_OFADBMGR sal_Int32 SwNewDBMgr::GetColumnType( const String& rDBName, const String& rTableName, const String& rColNm ) @@ -1818,51 +1330,7 @@ sal_Int32 SwNewDBMgr::GetColumnType( const String& rDBName, } return nRet; } -#else -#endif -#ifdef REPLACE_OFADBMGR -#else -ULONG SwNewDBMgr::GetRealColumnFmt( const String& rColNm, ULONG nFmt, - SvNumberFormatter& rNFmtr ) -{ - SvNumberFormatter* pDBNumFmtr; - const SvNumberformat* pNFmt; - SbaDBDataDefRef aDBDef = OpenColumnNames( DBMGR_STD ); - if( aDBDef.Is() && 0 != ( pDBNumFmtr = aDBDef->GetFormatter() ) && - 0 != (pNFmt = pDBNumFmtr->GetEntry( nFmt ) ) ) - { - nFmt = rNFmtr.GetEntryKey( pNFmt->GetFormatstring(), pNFmt->GetLanguage() ); - if( NUMBERFORMAT_ENTRY_NOT_FOUND == nFmt ) - { - xub_StrLen nCheckPos; - short nType; - XubString aTmp( pNFmt->GetFormatstring() ); - rNFmtr.PutEntry( aTmp, nCheckPos, nType, nFmt, pNFmt->GetLanguage() ); - } - } - else - nFmt = rNFmtr.GetFormatIndex( NF_NUMBER_STANDARD, LANGUAGE_SYSTEM ); - - return nFmt; -} -BOOL SwNewDBMgr::IsDBCaseSensitive( const String& rName ) const -{ - BOOL bRet = FALSE; - String sDBName = OFF_APP()->LocalizeDBName( NATIONAL2INI, rName ); - if( sDBName.Len() ) - { - SbaDatabaseRef xConnection = pSbaObject->GetDatabase(sDBName, TRUE); - if( xConnection.Is() ) - // JP 18.11.99: looked from - // \offmgr\source\sba\core\db\dbtabobj.cxx - bRet = SDB_IC_OBJECT == xConnection->GetIdentifierCase(); - } - return bRet; -} -#endif - -#ifdef REPLACE_OFADBMGR /* -----------------------------03.07.00 17:12-------------------------------- ---------------------------------------------------------------------------*/ @@ -2301,8 +1769,39 @@ sal_Bool SwNewDBMgr::ToRecordId(sal_Int32 nSet) BOOL SwNewDBMgr::ShowInBeamer(const String& rDBName, const String& rTableName, BYTE nType, const String& rStatement) { - DBG_ERROR("no beamer interface available!") - return FALSE; + SwView* pView = SW_MOD()->GetView(); + SfxViewFrame* pFrame = pView->GetViewFrame(); + Reference<XFrame> xFrame = pFrame->GetFrame()->GetFrameInterface(); +// Reference< XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() ); +// Reference<XInterface> xInstance; +// if( xMgr.is() ) +// { +// xInstance = xMgr->createInstance( C2U( "com.sun.star.frame.Desktop" )); +// } + Reference<XDispatchProvider> xDP(xFrame, UNO_QUERY); + util::URL aURL; + aURL.Complete = C2U(".component:DB/DataSourceBrowser"); + Reference<XDispatch> xD = xDP->queryDispatch(aURL, + C2U("_beamer"), + 0xff); + xD->dispatch(aURL, + Sequence<PropertyValue>()); +// Reference<XComponentLoader> xLoader(xInstance, UNO_QUERY); +// DBG_ASSERT(xLoader.is(), "no loader available?") +// if(!xLoader.is()) +// return FALSE; + +// Reference<XComponent> xRet; +// try +// { +// xRet = xLoader->loadComponentFromURL( +// C2U(".component:DB/DataSourceBrowser"), +// C2U("_beamer"), +// 0xff, +// Sequence<PropertyValue>() ); +// } +// catch(Exception&){DBG_ERROR("Exception: loadComponentFromURL()")} + return TRUE; } /* -----------------------------17.07.00 14:50-------------------------------- @@ -2528,77 +2027,3 @@ Sequence<OUString> SwNewDBMgr::GetExistingDatabaseNames() } return Sequence<OUString>(); } -#endif //REPLACE_OFADBMGR - -/*------------------------------------------------------------------------ - $Log: not supported by cvs2svn $ - Revision 1.2 2000/10/06 13:32:56 jp - should changes: don't use IniManager - - Revision 1.1.1.1 2000/09/18 17:14:33 hr - initial import - - Revision 1.372 2000/09/18 16:05:18 willem.vandorp - OpenOffice header added. - - Revision 1.371 2000/08/08 10:10:39 os - ucb transfer command used - - Revision 1.370 2000/07/18 12:50:07 os - replace ofadbmgr - - Revision 1.369 2000/07/07 15:25:43 os - replace ofadbmgr - - Revision 1.368 2000/07/06 07:59:10 os - replace ofadbmgr - - Revision 1.367 2000/07/05 08:23:06 os - Replace ofadbmgr - - Revision 1.366 2000/06/26 13:18:45 os - INetURLObject::SmartRelToAbs removed - - Revision 1.365 2000/06/13 09:57:36 os - using UCB - - Revision 1.364 2000/06/08 09:46:48 os - ContentBroker not in SwModule - - Revision 1.363 2000/06/07 13:26:07 os - using UCB - - Revision 1.362 2000/05/23 18:11:05 jp - Bugfixes for Unicode - - Revision 1.361 2000/04/17 10:01:56 os - #74698# detect synchronized documents with an additional DBNextSet - field - - Revision 1.360 2000/04/11 08:03:52 os - UNICODE - - Revision 1.359 2000/02/11 14:44:23 hr - #70473# changes for unicode ( patched by automated patchtool ) - - Revision 1.358 2000/01/06 18:20:27 jp - Bug #71413#: MergeMailFiles: HandleErrors, created filenames starts with 1 - - Revision 1.357 2000/01/06 07:31:29 os - #71436# mail merge dialog: execute via status method disposed - - Revision 1.356 1999/12/22 15:57:02 jp - Bug #71238#: MergePrint - behind the first call erase the JobName - - Revision 1.355 1999/12/14 14:35:04 jp - Bug #69595#: print can create single Jobs - - Revision 1.354 1999/11/23 11:20:55 os - comment - - Revision 1.353 1999/11/18 21:02:54 jp - for Bug #68744#: new: IsCaseSensitive - - - -------------------------------------------------------------------------*/ - diff --git a/sw/source/ui/dbui/dbtree.cxx b/sw/source/ui/dbui/dbtree.cxx index f87b9fb69416..3cf3a9ccb73f 100644 --- a/sw/source/ui/dbui/dbtree.cxx +++ b/sw/source/ui/dbui/dbtree.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dbtree.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: os $ $Date: 2000-10-20 14:18:01 $ + * last change: $Author: os $ $Date: 2000-10-27 11:24:06 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -71,7 +71,6 @@ #include <sot/formats.hxx> #endif -#ifdef REPLACE_OFADBMGR #ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #endif @@ -100,25 +99,6 @@ #include <comphelper/processfactory.hxx> #endif -#else - -#ifndef _OFF_APP_HXX //autogen -#include <offmgr/app.hxx> -#endif -#ifndef _SBAOBJ_HXX //autogen -#include <offmgr/sbaobj.hxx> -#endif -#ifndef _SBA_SBADB_HXX //autogen -#include <offmgr/sbadb.hxx> -#endif -#ifndef _SBAITEMS_HRC -#include <offmgr/sbaitems.hrc> -#endif -#ifndef _SBAITEMS_HXX -#include <offmgr/sbaitems.hxx> -#endif - -#endif //REPLACE_OFADBMGR #ifndef _DRAG_HXX //autogen #include <vcl/drag.hxx> @@ -133,7 +113,6 @@ #include "dbui.hrc" #include "dbtree.hxx" -#ifdef REPLACE_OFADBMGR using namespace rtl; using namespace com::sun::star::uno; using namespace com::sun::star::container; @@ -142,7 +121,6 @@ using namespace com::sun::star::sdb; using namespace com::sun::star::sdbc; using namespace com::sun::star::sdbcx; using namespace com::sun::star::beans; -#endif #define C2U(cChar) rtl::OUString::createFromAscii(cChar) // STATIC DATA ----------------------------------------------------------- @@ -167,7 +145,6 @@ SwDBTreeList::SwDBTreeList(Window *pParent, const ResId& rResId, const String& r bShowColumns (bShowCol), bInitialized (FALSE) { -#ifdef REPLACE_OFADBMGR Reference< XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() ); if( xMgr.is() ) { @@ -175,7 +152,6 @@ SwDBTreeList::SwDBTreeList(Window *pParent, const ResId& rResId, const String& r xDBContext = Reference<XNameAccess>(xInstance, UNO_QUERY) ; } DBG_ASSERT(xDBContext.is(), "com.sun.star.sdb.DataBaseContext: service not available") -#endif SetHelpId(HID_DB_SELECTION_TLB); @@ -199,10 +175,8 @@ SwDBTreeList::SwDBTreeList(Window *pParent, const ResId& rResId, const String& r void SwDBTreeList::InitTreeList() { -#ifdef REPLACE_OFADBMGR if(!xDBContext.is()) return; -#endif SetSelectionMode(SINGLE_SELECTION); SetWindowBits(WB_HASLINES|WB_CLIPCHILDREN|WB_SORT|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL); // Font nicht setzen, damit der Font des Controls uebernommen wird! @@ -214,7 +188,6 @@ void SwDBTreeList::InitTreeList() GetModel()->SetCompareHdl(LINK(this, SwDBTreeList, DBCompare)); -#ifdef REPLACE_OFADBMGR Sequence<OUString> aDBNames = xDBContext->getElementNames(); const OUString* pDBNames = aDBNames.getConstArray(); long nCount = aDBNames.getLength(); @@ -229,19 +202,6 @@ void SwDBTreeList::InitTreeList() String sColumnName(sDefDBName.GetToken(2, DB_DELIM)); Select(sDBName, sTableName, sColumnName); -#else - OfficeApplication* pOffApp = OFF_APP(); - SbaObject* pSbaObject = pOffApp->GetSbaObject(); - String sDBNames = pSbaObject->GetDatabaseNames(); - USHORT nCount = sDBNames.GetTokenCount(); - - for (USHORT i = 0; i < nCount; i++) - { - String sDBName(sDBNames.GetToken(i)); - InsertEntry(sDBName, aDBBMP, aDBBMP, NULL, TRUE); - } - Select(sDefDBName); -#endif bInitialized = TRUE; } @@ -255,12 +215,8 @@ void SwDBTreeList::ShowColumns(BOOL bShowCol) if (bShowCol != bShowColumns) { bShowColumns = bShowCol; -#ifdef REPLACE_OFADBMGR String sTableName, sColumnName; String sDBName(GetDBName(sTableName, sColumnName)); -#else - String sDBName(GetDBName()); -#endif SetUpdateMode(FALSE); @@ -280,11 +236,7 @@ void SwDBTreeList::ShowColumns(BOOL bShowCol) if (sDBName.Len()) { -#ifdef REPLACE_OFADBMGR Select(sDBName, sTableName, sColumnName); // force RequestingChilds -#else - Select(sDBName); // RequestingChilds erzwingen -#endif } SetUpdateMode(TRUE); } @@ -298,7 +250,6 @@ void SwDBTreeList::RequestingChilds(SvLBoxEntry* pParent) { if (!pParent->HasChilds()) { -#ifdef REPLACE_OFADBMGR if (GetParent(pParent)) // column names { @@ -419,61 +370,6 @@ void SwDBTreeList::RequestingChilds(SvLBoxEntry* pParent) } } } -#else - SbaObject* pSbaObject = OFF_APP()->GetSbaObject(); - if (GetParent(pParent)) // Spaltennamen - { - SwWrtShell *pSh = ::GetActiveView()->GetWrtShellPtr(); - SwNewDBMgr *pMgr = pSh->GetNewDBMgr(); - - String sDBName = GetEntryText(GetParent(pParent)); - sDBName += DB_DELIM; - sDBName += GetEntryText(pParent); - - if (!sDBName.Len() || (!pMgr->IsDBOpen(DBMGR_STD, sDBName) && !pMgr->OpenDB(DBMGR_STD, sDBName, TRUE))) - return; - - SbaDBDataDefRef aDBDef = pMgr->OpenColumnNames(DBMGR_STD); - - if (aDBDef.Is()) - { - const SbaColumnList& rCols = aDBDef->GetOriginalColumns(); - - for (USHORT i = 1; i <= rCols.Count(); i++) - { - const SbaNameItem* pNameItem = (const SbaNameItem*)&rCols.GetObject(i-1)->Get(SBA_DEF_FLTNAME); - InsertEntry(pNameItem->GetValue(), pParent); - } - } - pMgr->CloseAll(DBMGR_STD); - } - else // Tabellennamen - { - String sDBName = GetEntryText(pParent); - - SbaDatabaseRef pConnection = pSbaObject->GetDatabase(sDBName, TRUE); - if (pConnection.Is()) - { - String sTableName; - - USHORT nCount = pConnection->GetObjectCount(dbTable); - - for (USHORT i = 0; i < nCount; i++) - { - sTableName = pConnection->GetObjectName(dbTable, i); - InsertEntry(sTableName, aTableBMP, aTableBMP, pParent, bShowColumns); - } - - nCount = pConnection->GetObjectCount(dbQuery); - - for (i = 0; i < nCount; i++) - { - sTableName = pConnection->GetObjectName(dbQuery, i); - InsertEntry(sTableName, aQueryBMP, aQueryBMP, pParent, bShowColumns); - } - } - } -#endif } } @@ -495,47 +391,24 @@ IMPL_LINK( SwDBTreeList, DBCompare, SvSortData*, pData ) Beschreibung: ------------------------------------------------------------------------*/ -#ifdef REPLACE_OFADBMGR String SwDBTreeList::GetDBName(String& rTableName, String& rColumnName, BOOL* pbIsTable) -#else -String SwDBTreeList::GetDBName() const -#endif { String sDBName; -#ifdef REPLACE_OFADBMGR -#else - String sColumnName; -#endif SvLBoxEntry* pEntry = FirstSelected(); if (pEntry && GetParent(pEntry)) { if (GetParent(GetParent(pEntry))) { -#ifdef REPLACE_OFADBMGR rColumnName = GetEntryText(pEntry); -#else - sColumnName = GetEntryText(pEntry); -#endif pEntry = GetParent(pEntry); // Spaltenname war selektiert } sDBName = GetEntryText(GetParent(pEntry)); -#ifdef REPLACE_OFADBMGR if(pbIsTable) { *pbIsTable = pEntry->GetUserData() != 0; } rTableName = GetEntryText(pEntry); -#else - sDBName += DB_DELIM; - sDBName += GetEntryText(pEntry); - - if (sColumnName.Len()) - { - sDBName += DB_DELIM; - sDBName += sColumnName; - } -#endif } return sDBName; } @@ -545,18 +418,8 @@ String SwDBTreeList::GetDBName() const ------------------------------------------------------------------------*/ -#ifdef REPLACE_OFADBMGR void SwDBTreeList::Select(const String& rDBName, const String& rTableName, const String& rColumnName) -#else -void SwDBTreeList::Select(const String& rDataBaseName) -#endif { -#ifdef REPLACE_OFADBMGR -#else - String rDBName(rDataBaseName.GetToken(0, DB_DELIM)); - String rTableName(rDataBaseName.GetToken(1, DB_DELIM)); - String rColumnName(rDataBaseName.GetToken(2, DB_DELIM)); -#endif SvLBoxEntry* pParent; SvLBoxEntry* pChild; USHORT nParent = 0; @@ -634,7 +497,6 @@ void SwDBTreeList::Command( const CommandEvent& rCEvt ) void SwDBTreeList::StartExecuteDrag() { DragServer::Clear(); -#ifdef REPLACE_OFADBMGR String sTableName, sColumnName; String sDBName(GetDBName(sTableName, sColumnName)); if(sDBName.Len()) @@ -663,30 +525,6 @@ void SwDBTreeList::StartExecuteDrag() } DragServer::CopyString(sDBName); } -#else - String sDBName(GetDBName()); - if(sDBName.Len()) - { - if (sDBName.GetTokenCount(DB_DELIM) > 2) // Spaltenname ist enthalten - { - String aCopyData = sDBName.GetToken(0, DB_DELIM); - aCopyData += char(11); - aCopyData += sDBName.GetToken(1, DB_DELIM); - aCopyData += char(11); - aCopyData += String(String::CreateFromAscii("0")); - aCopyData += char(11); - aCopyData += sDBName.GetToken(2, DB_DELIM); - - // Datenbankfeld draggen - DragServer::CopyData(aCopyData.GetBuffer(), aCopyData.Len() + 1, - SOT_FORMATSTR_ID_SBA_FIELDDATAEXCHANGE); - } - - USHORT nPos; - while ((nPos = sDBName.SearchAndReplace(DB_DELIM, '.')) != STRING_NOTFOUND); - DragServer::CopyString(sDBName); - } -#endif } /*------------------------------------------------------------------------ @@ -698,139 +536,3 @@ BOOL SwDBTreeList::QueryDrop( DropEvent& rEvt) return FALSE; } -/*------------------------------------------------------------------------ - - $Log: not supported by cvs2svn $ - Revision 1.1.1.1 2000/09/18 17:14:34 hr - initial import - - Revision 1.41 2000/09/18 16:05:19 willem.vandorp - OpenOffice header added. - - Revision 1.40 2000/06/26 13:31:03 os - new DataBase API - - Revision 1.39 2000/04/11 08:03:52 os - UNICODE - - Revision 1.38 2000/02/11 14:44:29 hr - #70473# changes for unicode ( patched by automated patchtool ) - - Revision 1.37 1999/11/09 16:54:18 os - #69090# default in ::Command - - Revision 1.36 1999/01/20 16:00:04 AWO - #59398#FormatIds - - - Rev 1.35 20 Jan 1999 17:00:04 AWO - #59398#FormatIds - - Rev 1.34 21 Aug 1998 12:59:04 OM - #55373# D&D von DB-Feldern - - Rev 1.33 07 Mar 1998 13:30:14 OM - Alles bei Column-Umschaltung einklappen - - Rev 1.32 27 Feb 1998 18:26:26 OM - Aufgeraeumt - - Rev 1.31 03 Feb 1998 12:21:12 OM - #46621# HelpIDs fuer Feldbefehl-Dlg - - Rev 1.30 06 Jan 1998 18:12:02 OM - Felbefehl-Dlg - - Rev 1.29 05 Jan 1998 17:44:54 OM - DB-Feldbefehl bearbeiten - - Rev 1.28 15 Dec 1997 11:32:08 OM - GetObjectName gefixt - - Rev 1.27 12 Dec 1997 10:37:44 OM - GetObjectName angepasst - - Rev 1.26 12 Dec 1997 10:11:02 OM - Spaltennamen nicht sortieren - - Rev 1.25 11 Dec 1997 17:01:10 OM - Feldumstellung - - Rev 1.24 19 Nov 1997 16:33:06 OM - Datenbank-TP Drag&Drop - - Rev 1.23 18 Nov 1997 14:34:02 OM - Sba-Umstellung 372 - - Rev 1.22 18 Nov 1997 10:35:42 OM - Neuer Feldbefehldialog - - Rev 1.21 17 Nov 1997 14:36:32 OM - Column-Darstellung an/abschaltbar - - Rev 1.20 10 Nov 1997 10:48:56 TJ - GetTableName und GetQueryName durch GetObjectName ersetzt - - Rev 1.19 06 Nov 1997 17:01:50 OM - #45188# Schriftgroesse in TreeListBox anders initialisieren - - Rev 1.18 06 Nov 1997 13:01:26 OM - Geaenderte Datenbankauswahl - - Rev 1.17 05 Nov 1997 17:02:12 OM - Spaltennamen anzeigen - - Rev 1.16 14 Oct 1997 14:10:34 OM - Feldumstellung - - Rev 1.15 02 Sep 1997 09:57:10 OM - SDB-Headeranpassung - - Rev 1.14 01 Sep 1997 13:16:04 OS - DLL-Umstellung - - Rev 1.13 25 Aug 1997 11:53:54 OS - 368-Changes SBA - - Rev 1.12 06 Aug 1997 11:36:00 TRI - GetpApp statt pApp - - Rev 1.11 14 Mar 1997 14:09:26 OM - Sortierte DB-Listboxen - - Rev 1.10 11 Nov 1996 09:25:38 MA - ResMgr - - Rev 1.9 14 Oct 1996 16:06:44 OM - Datenbankumstellung 341c - - Rev 1.8 25 Sep 1996 14:10:44 OM - Neue Datenbanktrenner - - Rev 1.7 03 Sep 1996 12:01:58 OM - #30967# Fehlendes SEXPORT - - Rev 1.6 28 Aug 1996 09:18:04 OS - includes - - Rev 1.5 14 Aug 1996 11:39:36 OM - RequestingChilds nur bei leerem Parent - - Rev 1.4 08 Aug 1996 16:15:54 OM - Neue Segs - - Rev 1.3 08 Aug 1996 16:15:14 OM - Tabellen nur on demand anfordern - - Rev 1.2 05 Aug 1996 15:48:38 OM - Neue Segs - - Rev 1.1 05 Aug 1996 15:47:52 OM - Datenbankumstellung - - Rev 1.0 25 Jul 1996 16:35:50 OM - Initial revision. - -------------------------------------------------------------------------*/ - - diff --git a/sw/source/ui/envelp/envlop1.cxx b/sw/source/ui/envelp/envlop1.cxx index f4176485d986..783dde9f1e7d 100644 --- a/sw/source/ui/envelp/envlop1.cxx +++ b/sw/source/ui/envelp/envlop1.cxx @@ -2,9 +2,9 @@ * * $RCSfile: envlop1.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: os $ $Date: 2000-10-20 14:18:02 $ + * last change: $Author: os $ $Date: 2000-10-27 11:24:15 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -92,7 +92,6 @@ #include "envlop.hrc" -#ifdef REPLACE_OFADBMGR #ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #endif @@ -108,9 +107,6 @@ using namespace com::sun::star::uno; using namespace com::sun::star; using namespace rtl; #define C2U(char) rtl::OUString::createFromAscii(char) -#else - -#endif //REPLACE_OFADBMGR // -------------------------------------------------------------------------- @@ -312,21 +308,11 @@ SwEnvPage::~SwEnvPage() IMPL_LINK( SwEnvPage, DatabaseHdl, ListBox *, pListBox ) { -#ifdef REPLACE_OFADBMGR -#else - sActDBName = SFX_APP()->LocalizeDBName(NATIONAL2INI, aDatabaseLB.GetSelectEntry()); -#endif SwWait aWait( *pSh->GetView().GetDocShell(), TRUE ); if (pListBox == &aDatabaseLB) pSh->GetNewDBMgr()->GetTableNames(&aTableLB, sActDBName); -#ifdef REPLACE_OFADBMGR pSh->GetNewDBMgr()->GetColumnNames(&aDBFieldLB, sActDBName, aTableLB.GetSelectEntry()); -#else - sActDBName += DB_DELIM; - sActDBName += aTableLB.GetSelectEntry(); - pSh->GetNewDBMgr()->GetColumnNames(&aDBFieldLB, sActDBName); -#endif return 0; } @@ -376,7 +362,6 @@ void SwEnvPage::InitDatabaseBox() if (pSh->GetNewDBMgr()) { aDatabaseLB.Clear(); -#ifdef REPLACE_OFADBMGR Sequence<OUString> aDataNames = SwNewDBMgr::GetExistingDatabaseNames(); const OUString* pDataNames = aDataNames.getConstArray(); for (long i = 0; i < aDataNames.getLength(); i++) @@ -392,27 +377,6 @@ void SwEnvPage::InitDatabaseBox() } else aDBFieldLB.Clear(); -#else - SbaObject *pSbaObject = pSh->GetNewDBMgr()->GetSbaObject(); - if(!pSbaObject) - return; - String sDBNames = pSbaObject->GetDatabaseNames(); - sDBNames = SFX_APP()->LocalizeDBName(INI2NATIONAL, sDBNames); - USHORT nCount = sDBNames.GetTokenCount(); - - for (USHORT i = 0; i < nCount; i++) - aDatabaseLB.InsertEntry(sDBNames.GetToken(i)); - String sDBName = SFX_APP()->LocalizeDBName( INI2NATIONAL, - sActDBName.GetToken( 0, DB_DELIM )); - aDatabaseLB.SelectEntry(sDBName); - if (pSh->GetNewDBMgr()->GetTableNames(&aTableLB, sDBName)) - { - aTableLB.SelectEntry(sActDBName.GetToken(1, DB_DELIM)); - pSh->GetNewDBMgr()->GetColumnNames(&aDBFieldLB, sActDBName); - } - else - aDBFieldLB.Clear(); -#endif } } @@ -484,140 +448,3 @@ void SwEnvPage::Reset(const SfxItemSet& rSet) } - -// ---------------------------------------------------------------------------- - -/* -$Log: not supported by cvs2svn $ -Revision 1.2 2000/09/26 13:06:56 os -use of configuration service - -Revision 1.1.1.1 2000/09/18 17:14:35 hr -initial import - -Revision 1.91 2000/09/18 16:05:25 willem.vandorp -OpenOffice header added. - -Revision 1.90 2000/07/18 12:50:08 os -replace ofadbmgr - -Revision 1.89 2000/03/03 15:17:00 os -StarView remainders removed - -Revision 1.88 2000/02/11 14:45:12 hr -#70473# changes for unicode ( patched by automated patchtool ) - -Revision 1.87 1999/10/08 10:00:09 jp -no cast from GetpApp to SfxApp - -Revision 1.86 1999/10/05 10:18:49 os -#67889# some printer problems solved - -Revision 1.85 1999/09/28 13:21:24 os -survive without database - -Revision 1.84 1999/09/24 13:53:09 os -chg: ODbRow/ODbVariant - includes moved - -Revision 1.83 1999/08/26 17:36:02 JP -no cast from GetpApp to SfxApp - - - Rev 1.82 26 Aug 1999 19:36:02 JP - no cast from GetpApp to SfxApp - - Rev 1.81 13 Jul 1999 14:28:34 HR - #65293#: include <swwait.hxx> and <view.hxx> - - Rev 1.80 08 Jul 1999 18:25:00 MA - Use internal object to toggle wait cursor - - Rev 1.79 09 Jun 1999 19:34:42 JP - have to change: no cast from GetpApp to SfxApp/OffApp, SfxShell only subclass of SfxApp - - Rev 1.78 01 Mar 1999 16:21:52 MA - #62490# Altlast entfernt (Drucken und Briefumschlaege/Etiketten und Datenbank) - - Rev 1.77 09 Jul 1998 09:52:30 JP - EmptyStr benutzen - - Rev 1.76 09 Apr 1998 14:23:46 OM - #47097# Undo von Vorlagenaenderungen ermoeglichen - - Rev 1.75 24 Nov 1997 11:52:12 MA - includes - - Rev 1.74 03 Nov 1997 13:17:16 MA - precomp entfernt - - Rev 1.73 03 Sep 1997 13:59:12 OM - #36627# Sinnvolle Fehlermeldungen liefern - - Rev 1.72 02 Sep 1997 09:58:24 OM - SDB-Headeranpassung - - Rev 1.71 05 May 1997 11:16:30 OM - Hilfetext fuer OK loeschen - - Rev 1.70 24 Apr 1997 11:06:30 OM - HelpID fuer Briefumschlag aendern - - Rev 1.69 04 Apr 1997 14:04:52 OM - HelpIDs fuer DruckButton - - Rev 1.68 05 Feb 1997 10:19:06 OM - FillItemSet in DeactivatePage rufen - - Rev 1.67 04 Dec 1996 13:54:02 OM - Kein konstanter AdressDBName mehr - - Rev 1.66 11 Nov 1996 09:44:16 MA - ResMgr - - Rev 1.65 07 Oct 1996 09:33:18 MA - Umstellung Enable/Disable - - Rev 1.64 25 Sep 1996 14:11:12 OM - Neue Datenbanktrenner - - Rev 1.63 06 Aug 1996 16:46:38 OM - Neue Segs - - Rev 1.62 06 Aug 1996 16:45:36 OM - Datenbankumstellung - - Rev 1.61 26 Jul 1996 20:36:38 MA - includes - - Rev 1.60 17 Jul 1996 13:47:04 OM - Datenbankumstellung 327 - - Rev 1.59 02 Jul 1996 18:47:06 MA - Wait-Umstellung 325 - - Rev 1.58 31 May 1996 16:01:20 OM - Datenbankumstellung - - Rev 1.57 29 May 1996 12:29:28 OM - Umstellung auf 320 - - Rev 1.56 18 Apr 1996 16:32:16 OM - Datenbankumstellung: Basic-Entkopplung - - Rev 1.55 15 Apr 1996 09:59:44 OM - #26838# DefWin fuer DatenbankDlg setzen - - Rev 1.54 12 Apr 1996 14:07:50 OM - #26838# Richtiges Window-Parent disabled - - Rev 1.53 11 Apr 1996 12:27:16 OM - #26838# Mehrfachoeffnung vom Datenbank-Dlg unterbunden - - Rev 1.52 04 Apr 1996 12:09:00 OM - patches legalisiert - - Rev 1.51 20 Mar 1996 15:36:34 OM - DB-Namensumstellung auf ODBC - -*/ - diff --git a/sw/source/ui/envelp/label1.cxx b/sw/source/ui/envelp/label1.cxx index 6663051314c6..49f24e01b60c 100644 --- a/sw/source/ui/envelp/label1.cxx +++ b/sw/source/ui/envelp/label1.cxx @@ -2,9 +2,9 @@ * * $RCSfile: label1.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: os $ $Date: 2000-10-20 14:18:02 $ + * last change: $Author: os $ $Date: 2000-10-27 11:24:15 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -159,7 +159,6 @@ #include <comphelper/processfactory.hxx> #endif -#ifdef REPLACE_OFADBMGR #ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #endif @@ -167,18 +166,15 @@ #include <com/sun/star/container/XNameAccess.hpp> #endif +using namespace ::com::sun::star; using namespace com::sun::star::lang; using namespace com::sun::star::container; using namespace com::sun::star::uno; +using namespace ::comphelper; +using namespace ::rtl; #define C2U(char) rtl::OUString::createFromAscii(char) -#else - -#endif //REPLACE_OFADBMGR -using namespace ::com::sun::star; -using namespace ::comphelper; -using namespace ::rtl; // dont use RTL_CONSTASCII_STRINGPARAM for UNO_NAME ... // #define CL2S(cChar) UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM(cChar)) @@ -754,13 +750,7 @@ IMPL_LINK( SwLabPage, DatabaseHdl, ListBox *, pListBox ) if (pListBox == &aDatabaseLB) GetNewDBMgr()->GetTableNames(&aTableLB, sActDBName); -#ifdef REPLACE_OFADBMGR GetNewDBMgr()->GetColumnNames(&aDBFieldLB, sActDBName, aTableLB.GetSelectEntry()); -#else - sActDBName += DB_DELIM; - sActDBName += aTableLB.GetSelectEntry(); - GetNewDBMgr()->GetColumnNames(&aDBFieldLB, sActDBName); -#endif return 0; } @@ -899,7 +889,6 @@ void SwLabPage::InitDatabaseBox() if(GetNewDBMgr()) { aDatabaseLB.Clear(); -#ifdef REPLACE_OFADBMGR Sequence<OUString> aDataNames = SwNewDBMgr::GetExistingDatabaseNames(); const OUString* pDataNames = aDataNames.getConstArray(); for (long i = 0; i < aDataNames.getLength(); i++) @@ -914,58 +903,21 @@ void SwLabPage::InitDatabaseBox() } else aDBFieldLB.Clear(); -#else - SbaObject *pSbaObject = GetNewDBMgr()->GetSbaObject(); - if(!pSbaObject) - return; - String sDBNames = pSbaObject->GetDatabaseNames(); - sActDBName = aItem.sDBName; - if ( !sActDBName.Len() ) - sActDBName = GetNewDBMgr()->GetAddressDBName(); - - sDBNames = SFX_APP()->LocalizeDBName(INI2NATIONAL, sDBNames); - - sal_uInt16 nCount = sDBNames.GetTokenCount(); - - for (sal_uInt16 i = 0; i < nCount; i++) - aDatabaseLB.InsertEntry(sDBNames.GetToken(i)); - - String sDBName = SFX_APP()->LocalizeDBName( INI2NATIONAL, - sActDBName.GetToken( 0, DB_DELIM )); - aDatabaseLB.SelectEntry(sDBName); - if (GetNewDBMgr()->GetTableNames(&aTableLB, sDBName)) - { - aTableLB.SelectEntry(sActDBName.GetToken(1, DB_DELIM)); - GetNewDBMgr()->GetColumnNames(&aDBFieldLB, sActDBName); - } - else - aDBFieldLB.Clear(); -#endif } } // -------------------------------------------------------------------------- - - - SfxTabPage* SwLabPage::Create(Window* pParent, const SfxItemSet& rSet) { return new SwLabPage(pParent, rSet); } // -------------------------------------------------------------------------- - - - void SwLabPage::ActivatePage(const SfxItemSet& rSet) { Reset( rSet ); } - // -------------------------------------------------------------------------- - - - int SwLabPage::DeactivatePage(SfxItemSet* pSet) { if (pSet) diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx index e18e6d470416..f5cd19dedf91 100644 --- a/sw/source/ui/envelp/mailmrge.cxx +++ b/sw/source/ui/envelp/mailmrge.cxx @@ -2,9 +2,9 @@ * * $RCSfile: mailmrge.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: jp $ $Date: 2000-10-06 13:33:58 $ + * last change: $Author: os $ $Date: 2000-10-27 11:24:15 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -122,7 +122,6 @@ #endif -#ifdef REPLACE_OFADBMGR #ifndef _COM_SUN_STAR_SDBCX_XCOLUMNSSUPPLIER_HPP_ #include <com/sun/star/sdbcx/XColumnsSupplier.hpp> #endif @@ -139,7 +138,6 @@ using namespace com::sun::star::beans; using namespace com::sun::star::util; using namespace com::sun::star::uno; -#endif #define C2S(cChar) UniString::CreateFromAscii(cChar) @@ -149,9 +147,7 @@ using namespace com::sun::star::uno; SwMailMergeDlg::SwMailMergeDlg(Window *pParent, SwWrtShell *pShell, const String& rName, -#ifdef REPLACE_OFADBMGR - const String& rTblName, -#endif + const String& rTblName, const String& rStat, SbaSelectionListRef& pSelList): @@ -199,9 +195,7 @@ SwMailMergeDlg::SwMailMergeDlg(Window *pParent, SwWrtShell *pShell, pSh (pShell), rDBName (rName), -#ifdef REPLACE_OFADBMGR rTableName (rTblName), -#endif rStatement (rStat), rSelectionList (pSelList), nMergeType (DBMGR_MERGE_MAILING) @@ -211,10 +205,6 @@ SwMailMergeDlg::SwMailMergeDlg(Window *pParent, SwWrtShell *pShell, DBG_ASSERT(pSh, "Shell fehlt" ); -#ifdef REPLACE_OFADBMGR -#else - pSbaObject = pSh->GetNewDBMgr()->GetSbaObject(); -#endif pModOpt = SW_MOD()->GetModuleConfig(); aSingleJobsCB.Check(pModOpt->IsSinglePrintJob()); @@ -224,10 +214,6 @@ SwMailMergeDlg::SwMailMergeDlg(Window *pParent, SwWrtShell *pShell, aFormatHtmlCB.Check((nMailingMode & TXTFORMAT_HTML) != 0); aFormatRtfCB.Check((nMailingMode & TXTFORMAT_RTF) != 0); -#ifdef REPLACE_OFADBMGR -#else - DBG_ASSERT(pSbaObject, "SbaObject nicht gefunden!"); -#endif aAllRB.Check(TRUE); // Handler installieren @@ -257,11 +243,7 @@ SwMailMergeDlg::SwMailMergeDlg(Window *pParent, SwWrtShell *pShell, aFromNF.SetModifyHdl(aLk); aToNF.SetModifyHdl(aLk); -#ifdef REPLACE_OFADBMGR pSh->GetNewDBMgr()->GetColumnNames(&aAddressFldLB, rDBName, rTableName); -#else - pSh->GetNewDBMgr()->GetColumnNames(&aAddressFldLB, rDBName); -#endif for(USHORT nEntry = 0; nEntry < aAddressFldLB.GetEntryCount(); nEntry++) aColumnLB.InsertEntry(aAddressFldLB.GetEntry(nEntry)); aAddressFldLB.SelectEntry(C2S("EMAIL")); @@ -556,154 +538,4 @@ IMPL_LINK( SwMailMergeDlg, AttachFileHdl, PushButton *, pBtn ) return 0; } -/*------------------------------------------------------------------------ - - $Log: not supported by cvs2svn $ - Revision 1.1.1.1 2000/09/18 17:14:35 hr - initial import - - Revision 1.75 2000/09/18 16:05:27 willem.vandorp - OpenOffice header added. - - Revision 1.74 2000/07/18 12:50:08 os - replace ofadbmgr - - Revision 1.73 2000/06/07 13:26:46 os - using UCB - - Revision 1.72 2000/04/19 12:56:34 os - include sfx2/filedlg.hxx removed - - Revision 1.71 2000/04/18 15:31:35 os - UNICODE - - Revision 1.70 2000/03/03 15:17:00 os - StarView remainders removed - - Revision 1.69 2000/02/11 14:45:27 hr - #70473# changes for unicode ( patched by automated patchtool ) - - Revision 1.68 2000/01/24 12:48:37 os - #72153# call SfxFileDialog::DisableSaveLastDirectory - - Revision 1.67 1998/09/02 12:11:56 OM - #45378# HelpIDs fuer Dateidialoge - - - Rev 1.66 02 Sep 1998 14:11:56 OM - #45378# HelpIDs fuer Dateidialoge - - Rev 1.65 23 Jul 1998 13:26:52 OM - #52257# Mail Attachments - - Rev 1.64 17 Jul 1998 17:19:52 TJ - include - - Rev 1.63 09 Jul 1998 09:52:32 JP - EmptyStr benutzen - - Rev 1.62 09 Dec 1997 12:31:28 OM - #45200# Serienbrief: Speichern-Monitor - - Rev 1.61 02 Dec 1997 19:39:12 MA - #45900#, SelectionList muss fuer Dialog existieren - - Rev 1.60 24 Nov 1997 11:52:12 MA - includes - - Rev 1.59 03 Nov 1997 13:17:14 MA - precomp entfernt - - Rev 1.58 30 Sep 1997 14:22:06 MH - chg: header - - Rev 1.57 02 Sep 1997 09:58:22 OM - SDB-Headeranpassung - - Rev 1.56 26 Aug 1997 15:34:46 TRI - VCL Includes - - Rev 1.55 05 Aug 1997 12:31:44 MH - chg: header - - Rev 1.54 08 Jul 1997 14:12:44 OS - ConfigItems von der App ans Module - - Rev 1.53 09 Jun 1997 17:22:32 OM - Serienbriefe als Dateien speichern - - Rev 1.52 04 Jun 1997 11:43:02 OM - Korrektes Mailformat RTF - - Rev 1.51 20 Mar 1997 12:44:42 OM - Mailing: Format RTF - - Rev 1.50 11 Mar 1997 11:27:18 OM - Serienbrief-eMail in waehlbaren Formaten versenden - - Rev 1.49 14 Feb 1997 11:36:24 OM - #36178# GPF im Serienbriefdruck behoben - - Rev 1.48 29 Jan 1997 18:13:04 MA - unbenutzes entfernt - - Rev 1.47 06 Dec 1996 14:39:36 OM - OpenDB-Fehlercode korrigiert - - Rev 1.46 05 Dec 1996 13:36:58 OM - Serienbrief reanimiert - - Rev 1.45 11 Nov 1996 09:44:18 MA - ResMgr - - Rev 1.44 07 Oct 1996 09:33:18 MA - Umstellung Enable/Disable - - Rev 1.43 18 Sep 1996 10:38:54 OM - Serienbriefe wieder angebunden - - Rev 1.42 13 Sep 1996 15:46:48 OM - Serienbrief - - Rev 1.41 22 Aug 1996 12:30:32 OM - Serienbrief Dlg umgestellt - - Rev 1.40 06 Aug 1996 16:45:38 OM - Datenbankumstellung - - Rev 1.39 26 Jul 1996 20:36:38 MA - includes - - Rev 1.38 25 Jul 1996 16:39:52 OM - DB-Auswahldialog eingebaut - - Rev 1.37 23 Jul 1996 13:26:32 OM - Datenbank und Tabelle auswaehlen - - Rev 1.36 22 Jul 1996 11:03:00 OM - Datenbankauswahldialog - - Rev 1.35 19 Jul 1996 16:10:02 OM - SBA-Umstellung - - Rev 1.34 17 Jul 1996 13:47:06 OM - Datenbankumstellung 327 - - Rev 1.33 05 Jul 1996 15:57:50 OM - #28464# Serienbrief mit markierten Datensaetzen - - Rev 1.32 28 Jun 1996 10:21:50 OM - Neue Segs - - Rev 1.31 28 Jun 1996 10:20:54 OM - #29103# Radiobutton bei Eingabe selektieren - - Rev 1.30 04 Jun 1996 14:10:28 OM - Neue Segs - - Rev 1.29 04 Jun 1996 14:09:40 OM - Serienbrief Mailing - -------------------------------------------------------------------------*/ - diff --git a/sw/source/ui/fldui/changedb.cxx b/sw/source/ui/fldui/changedb.cxx index 5b52c07283e3..9f1fdc8ed745 100644 --- a/sw/source/ui/fldui/changedb.cxx +++ b/sw/source/ui/fldui/changedb.cxx @@ -2,9 +2,9 @@ * * $RCSfile: changedb.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: os $ $Date: 2000-10-20 14:18:03 $ + * last change: $Author: os $ $Date: 2000-10-27 11:24:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -72,7 +72,6 @@ #include <vcl/msgbox.hxx> #endif -#ifdef REPLACE_OFADBMGR #ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #endif @@ -86,17 +85,6 @@ #include <comphelper/processfactory.hxx> #endif -#else - -#ifndef _SFXAPP_HXX //autogen -#include <sfx2/app.hxx> -#endif -#ifndef _SBA_SBAOBJ_HXX //autogen -#include <offmgr/sbaobj.hxx> -#endif - -#endif - #ifndef _SFXVIEWFRM_HXX //autogen #include <sfx2/viewfrm.hxx> #endif @@ -139,17 +127,11 @@ #include <changedb.hrc> #endif -#ifdef REPLACE_OFADBMGR using namespace rtl; using namespace com::sun::star::uno; using namespace com::sun::star::container; using namespace com::sun::star::lang; -//using namespace com::sun::star::sdb; -//using namespace com::sun::star::sdbc; -//using namespace com::sun::star::sdbcx; -//using namespace com::sun::star::beans; #define C2U(cChar) OUString::createFromAscii(cChar) -#endif /*-------------------------------------------------------------------- Beschreibung: Feldeinfuegen bearbeiten @@ -209,7 +191,6 @@ SwChangeDBDlg::SwChangeDBDlg(SwView& rVw) : void SwChangeDBDlg::FillDBPopup() { -#ifdef REPLACE_OFADBMGR Reference<XNameAccess> xDBContext; Reference< XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() ); if( xMgr.is() ) @@ -218,20 +199,12 @@ void SwChangeDBDlg::FillDBPopup() xDBContext = Reference<XNameAccess>(xInstance, UNO_QUERY) ; } DBG_ASSERT(xDBContext.is(), "com.sun.star.sdb.DataBaseContext: service not available") -// SwNewDBMgr* pNewDBMgr = pSh->GetNewDBMgr(); - -// String sDBNames = pNewDBMgr->GetSbaObject()->GetDatabaseNames(); -// SfxApplication* pSfxApp = SFX_APP(); -// sDBNames = pSfxApp->LocalizeDBName(INI2NATIONAL, sDBNames); - -// USHORT nDBNamesCount = sDBNames.GetTokenCount(); String sDataBaseName(pSh->GetDBName()); String sDBName(sDataBaseName.GetToken(0, DB_DELIM)); String sTableName(sDataBaseName.GetToken(1, DB_DELIM)); aAvailDBTLB.Select(sDBName, sTableName, aEmptyStr); -// sDBNames = pNewDBMgr->GetSbaObject()->GetDatabaseNames(); SvStringsDtor aAllDBNames(5, 5); Sequence<OUString> aDBNames = xDBContext->getElementNames(); @@ -267,69 +240,6 @@ void SwChangeDBDlg::FillDBPopup() aUsedDBTLB.Select(pFirst); } -#else - - SwNewDBMgr* pNewDBMgr = pSh->GetNewDBMgr(); - - String sDBNames = pNewDBMgr->GetSbaObject()->GetDatabaseNames(); - SfxApplication* pSfxApp = SFX_APP(); - sDBNames = pSfxApp->LocalizeDBName(INI2NATIONAL, sDBNames); - - USHORT nDBNamesCount = sDBNames.GetTokenCount(); - - - -// if (rDBName.Len()) -// sDBName = pSfxApp->LocalizeDBName(INI2NATIONAL, rDBName); -// else - String sDBName = pSfxApp->LocalizeDBName(INI2NATIONAL, pSh->GetDBName()); - aAvailDBTLB.Select(sDBName); - - SvStringsDtor aDBNameList(5, 1); - - sDBNames = pNewDBMgr->GetSbaObject()->GetDatabaseNames(); - SvStringsDtor aAllDBNames(5, 5); - for (USHORT i = 0; i < nDBNamesCount; i++) -#ifdef UNX - aAllDBNames.Insert(new String(sDBNames.GetToken(i)), aAllDBNames.Count()); -#else - aAllDBNames.Insert(new String(sDBNames.GetToken(i).ToUpperAscii()), aAllDBNames.Count()); -#endif - - - pSh->GetAllUsedDB( aDBNameList, &aAllDBNames ); - - USHORT nCount = aDBNameList.Count(); - aUsedDBTLB.Clear(); - SvLBoxEntry *pFirst = 0; - SvLBoxEntry *pLast = 0; - - for (i = 0; i < nCount; i++) - { - sDBName = pNewDBMgr->ExtractDBName(*aDBNameList.GetObject(i)); - -#ifndef UNX - // Richtige Schreibweise ermitteln (upper/lower-case) - for (USHORT i2 = 0; i2 < nDBNamesCount; i2++) - { - if (sDBName.GetToken(0, DB_DELIM).ToUpperAscii() == sDBNames.GetToken(i2).ToUpperAscii()) - { - sDBName = sDBNames.GetToken(i2); - break; - } - } -#endif - pLast = Insert(sDBName); - if (!pFirst) - pFirst = pLast; - } - - if (pFirst) - { - aUsedDBTLB.MakeVisible(pFirst); - aUsedDBTLB.Select(pFirst); - } -#endif //REPLACE_OFADBMGR } /*-------------------------------------------------------------------- @@ -344,15 +254,9 @@ SvLBoxEntry* SwChangeDBDlg::Insert(const String& rDBName) SvLBoxEntry* pParent; SvLBoxEntry* pChild; -#ifdef REPLACE_OFADBMGR -#else - sDBName = SFX_APP()->LocalizeDBName(INI2NATIONAL, sDBName); -#endif //REPLACE_OFADBMGR - USHORT nParent = 0; USHORT nChild = 0; -#ifdef REPLACE_OFADBMGR while ((pParent = aUsedDBTLB.GetEntry(nParent++)) != NULL) { if (sDBName == aUsedDBTLB.GetEntryText(pParent)) @@ -365,28 +269,6 @@ SvLBoxEntry* SwChangeDBDlg::Insert(const String& rDBName) return aUsedDBTLB.InsertEntry(sTableName, aTableBMP, aTableBMP, pParent); } } -#else - while ((pParent = aUsedDBTLB.GetEntry(nParent++)) != NULL) - { -#ifdef UNX - if (sDBName == aUsedDBTLB.GetEntryText(pParent)) -#else - if (sDBName.ToUpperAscii() == aUsedDBTLB.GetEntryText(pParent).ToUpperAscii()) -#endif - { - while ((pChild = aUsedDBTLB.GetEntry(pParent, nChild++)) != NULL) - { -#ifdef UNX - if (sTableName == aUsedDBTLB.GetEntryText(pChild)) -#else - if (sTableName.ToUpperAscii() == aUsedDBTLB.GetEntryText(pChild).ToUpperAscii()) -#endif - return pChild; - } - return aUsedDBTLB.InsertEntry(sTableName, aTableBMP, aTableBMP, pParent); - } - } -#endif pParent = aUsedDBTLB.InsertEntry(sDBName, aDBBMP, aDBBMP); return aUsedDBTLB.InsertEntry(sTableName, aTableBMP, aTableBMP, pParent); } @@ -394,8 +276,6 @@ SvLBoxEntry* SwChangeDBDlg::Insert(const String& rDBName) /*-------------------------------------------------------------------- Beschreibung: Dialog zerstoeren --------------------------------------------------------------------*/ - - __EXPORT SwChangeDBDlg::~SwChangeDBDlg() { delete pMgr; @@ -404,18 +284,13 @@ __EXPORT SwChangeDBDlg::~SwChangeDBDlg() /*-------------------------------------------------------------------- Beschreibung: Schliessen --------------------------------------------------------------------*/ - - void __EXPORT SwChangeDBDlg::Apply() { UpdateFlds(); } - /*-------------------------------------------------------------------- Beschreibung: --------------------------------------------------------------------*/ - - void SwChangeDBDlg::UpdateFlds() { SvStringsDtor aDBNames( (BYTE)aUsedDBTLB.GetSelectionCount(), 1 ); @@ -427,10 +302,6 @@ void SwChangeDBDlg::UpdateFlds() { String* pTmp = new String( aUsedDBTLB.GetEntryText( aUsedDBTLB.GetParent( pEntry ))); -#ifdef REPLACE_OFADBMGR -#else - *pTmp = SFX_APP()->LocalizeDBName( NATIONAL2INI, *pTmp); -#endif *pTmp += DB_DELIM; *pTmp += aUsedDBTLB.GetEntryText( pEntry ); aDBNames.Insert(pTmp, aDBNames.Count() ); @@ -439,15 +310,11 @@ void SwChangeDBDlg::UpdateFlds() } pSh->StartAllAction(); -#ifdef REPLACE_OFADBMGR String sTableName, sColumnName; String sTemp(aAvailDBTLB.GetDBName(sTableName, sColumnName)); sTemp += DB_DELIM; sTemp += sTableName; pSh->ChangeDBFields( aDBNames, sTemp); -#else - pSh->ChangeDBFields( aDBNames, aAvailDBTLB.GetDBName()); -#endif pSh->EndAllAction(); } @@ -458,7 +325,6 @@ void SwChangeDBDlg::UpdateFlds() IMPL_LINK( SwChangeDBDlg, ButtonHdl, Button *, pBtn ) { -#ifdef REPLACE_OFADBMGR String sTableName, sColumnName; String sTemp(aAvailDBTLB.GetDBName(sTableName, sColumnName)); sTemp += DB_DELIM; @@ -466,10 +332,6 @@ IMPL_LINK( SwChangeDBDlg, ButtonHdl, Button *, pBtn ) sTemp += DB_DELIM; sTemp += sColumnName; pSh->ChgDBName(sTemp); -#else - String sNewDBName(aAvailDBTLB.GetDBName()); - pSh->ChgDBName(sNewDBName); -#endif ShowDBName(pSh->GetDBName()); EndDialog(RET_OK); @@ -504,11 +366,6 @@ void SwChangeDBDlg::ShowDBName(const String& rDBName) { String sTmp(rDBName.GetToken(0, DB_DELIM)); String sName; - -#ifdef REPLACE_OFADBMGR -#else - sTmp = SFX_APP()->LocalizeDBName(INI2NATIONAL, sTmp); -#endif sTmp += '.'; sTmp += rDBName.GetToken(1, DB_DELIM); @@ -522,145 +379,4 @@ void SwChangeDBDlg::ShowDBName(const String& rDBName) aDocDBNameFT.SetText(sName); } -/************************************************************************* - - $Log: not supported by cvs2svn $ - Revision 1.1.1.1 2000/09/18 17:14:36 hr - initial import - - Revision 1.43 2000/09/18 16:05:27 willem.vandorp - OpenOffice header added. - - Revision 1.42 2000/07/07 15:25:43 os - replace ofadbmgr - - Revision 1.41 2000/06/26 13:35:59 os - new DataBase API - - Revision 1.40 2000/04/18 15:17:31 os - UNICODE - - Revision 1.39 2000/03/03 15:17:00 os - StarView remainders removed - - Revision 1.38 2000/02/11 14:46:04 hr - #70473# changes for unicode ( patched by automated patchtool ) - - Revision 1.37 2000/01/31 12:53:09 os - #72339# dialog needs one apply button only - - Revision 1.36 1999/09/29 06:49:52 mh - chg: header - - Revision 1.35 1999/06/09 17:34:28 JP - have to change: no cast from GetpApp to SfxApp/OffApp, SfxShell only subclass of SfxApp - - - Rev 1.34 09 Jun 1999 19:34:28 JP - have to change: no cast from GetpApp to SfxApp/OffApp, SfxShell only subclass of SfxApp - - Rev 1.33 04 Feb 1999 21:18:30 JP - Bug #61404#/#61014#: Optimierung der Schnittstellen - - Rev 1.32 19 Nov 1998 13:18:44 OM - #59660# Eintrag vorselektieren - - Rev 1.31 06 Nov 1997 17:03:22 OM - Geaenderte DB-Selektionsbox - - Rev 1.30 03 Nov 1997 13:18:10 MA - precomp entfernt - - Rev 1.29 30 Oct 1997 14:30:48 OM - Feldbefehl-Umstellung - - Rev 1.28 18 Sep 1997 14:34:04 OM - Feldumstellung - - Rev 1.27 02 Sep 1997 09:55:54 OM - SDB-Headeranpassung - - Rev 1.26 15 Aug 1997 12:11:20 OS - chartar/frmatr/txtatr aufgeteilt - - Rev 1.25 06 Aug 1997 13:39:54 TRI - VCL: GetpApp() statt pApp - - Rev 1.24 23 Jul 1997 20:25:52 HJS - includes - - Rev 1.23 14 May 1997 19:01:46 OM - Datenbank auch in ExpressionFields austauschen - - Rev 1.22 13 May 1997 13:11:06 OM - #39586# Datenbank festlegen beendet Dialog - - Rev 1.21 08 Apr 1997 12:44:38 MA - includes - - Rev 1.20 07 Apr 1997 18:23:06 MH - chg: header - - Rev 1.19 18 Mar 1997 15:24:14 OM - Sortierte Treelistbox - - Rev 1.18 11 Nov 1996 09:56:04 MA - ResMgr - - Rev 1.17 28 Oct 1996 11:29:52 OM - #32799#Namen der aktuellen Datenbank korrekt anzeigen - - Rev 1.16 02 Oct 1996 16:50:26 MA - Umstellung Enable/Disable - - Rev 1.15 25 Sep 1996 14:11:42 OM - Neue Datenbanktrenner - - Rev 1.14 28 Aug 1996 12:13:32 OS - includes - - Rev 1.13 14 Aug 1996 11:45:54 OM - Neue Segs - - Rev 1.12 14 Aug 1996 11:44:34 OM - Datenbankumstellung - - Rev 1.11 23 Jul 1996 16:08:30 OM - Neue Segs - - Rev 1.10 23 Jul 1996 16:07:28 OM - Datenbank am Dok umsetzen - - Rev 1.9 17 Jul 1996 13:47:30 OM - Datenbankumstellung 327 - - Rev 1.8 23 May 1996 16:34:40 OM - DB-Namen in Expressionfields austauschen - - Rev 1.7 23 May 1996 15:29:02 OM - Schreibweise der DB-Namen restaurieren - - Rev 1.6 22 May 1996 12:04:38 OM - ChangeDBFields an Doc verlagert - - Rev 1.5 20 May 1996 16:33:28 OM - Nur verwendete Datenbanken zu Auswahl stellen - - Rev 1.4 20 May 1996 11:06:44 OM - ChangeDBFields in die EditShell verlagert - - Rev 1.3 15 May 1996 17:05:28 OM - Neue Segs - - Rev 1.2 15 May 1996 17:05:02 OM - Datenbanken austauschen - - Rev 1.1 15 May 1996 14:02:22 OM - Neue Segs - - Rev 1.0 15 May 1996 14:01:12 OM - Initial revision. - -*************************************************************************/ - diff --git a/sw/source/ui/fldui/flddb.cxx b/sw/source/ui/fldui/flddb.cxx index 3ef394ce56ff..c16c8dc176eb 100644 --- a/sw/source/ui/fldui/flddb.cxx +++ b/sw/source/ui/fldui/flddb.cxx @@ -2,9 +2,9 @@ * * $RCSfile: flddb.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:14:36 $ + * last change: $Author: os $ $Date: 2000-10-27 11:24:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -154,11 +154,7 @@ void __EXPORT SwFldDBPage::Reset(const SfxItemSet& rSet) aTypeLB.SetUpdateMode(FALSE); USHORT nOldPos = aTypeLB.GetSelectEntryPos(); -#ifdef REPLACE_OFADBMGR sOldDBName = aDatabaseTLB.GetDBName(sOldTableName, sOldColumnName); -#else - sOldDBName = aDatabaseTLB.GetDBName(); -#endif aTypeLB.Clear(); @@ -206,25 +202,17 @@ void __EXPORT SwFldDBPage::Reset(const SfxItemSet& rSet) if (sOldDBName.Len()) { -#ifdef REPLACE_OFADBMGR aDatabaseTLB.Select(sOldDBName, sOldTableName, sOldColumnName); -#else - aDatabaseTLB.Select(sOldDBName); -#endif } else { SwWrtShell *pSh = ::GetActiveView()->GetWrtShellPtr(); -#ifdef REPLACE_OFADBMGR String sTmp(pSh->GetDBName()); aDatabaseTLB.Select( - sTmp.GetToken(0, DB_DELIM), - sTmp.GetToken(1, DB_DELIM), - sTmp.GetToken(2, DB_DELIM)); -#else - aDatabaseTLB.Select(pSh->GetDBName()); -#endif + sTmp.GetToken(0, DB_DELIM), + sTmp.GetToken(1, DB_DELIM), + sTmp.GetToken(2, DB_DELIM)); } } @@ -256,11 +244,7 @@ void __EXPORT SwFldDBPage::Reset(const SfxItemSet& rSet) { aConditionED.SaveValue(); aValueED.SaveValue(); -#ifdef REPLACE_OFADBMGR sOldDBName = aDatabaseTLB.GetDBName(sOldTableName, sOldColumnName); -#else - sOldDBName = aDatabaseTLB.GetDBName(); -#endif nOldFormat = GetCurField()->GetFormat(); nOldSubType = GetCurField()->GetSubType(); } @@ -272,38 +256,22 @@ void __EXPORT SwFldDBPage::Reset(const SfxItemSet& rSet) BOOL __EXPORT SwFldDBPage::FillItemSet(SfxItemSet& rSet) { -#ifdef REPLACE_OFADBMGR String sTableName, sColumnName; String sDBName = aDatabaseTLB.GetDBName(sTableName, sColumnName); -#else - String sDBName = aDatabaseTLB.GetDBName(); -#endif SwWrtShell *pSh = ::GetActiveView()->GetWrtShellPtr(); if (!sDBName.Len()) { -#ifdef REPLACE_OFADBMGR String sTmp = pSh->GetDBName(); sDBName = sTmp.GetToken(0, DB_DELIM); sTableName = sTmp.GetToken(1, DB_DELIM); -#else - sDBName = pSh->GetDBName(); -#endif } else { -#ifdef REPLACE_OFADBMGR String sNewDBName = sDBName; sNewDBName += DB_DELIM; sNewDBName += sTableName; pSh->ChgDBName(sNewDBName); -#else - // keine Spaltennamen an ChgDBName uebergeben - String sNewDBName = sDBName.GetToken(0, DB_DELIM); - sNewDBName += DB_DELIM; - sNewDBName += sDBName.GetToken(1, DB_DELIM); - pSh->ChgDBName(sNewDBName); -#endif } if (sDBName.Len()) // Ohne Datenbank kein neuer Feldbefehl @@ -315,7 +283,6 @@ BOOL __EXPORT SwFldDBPage::FillItemSet(SfxItemSet& rSet) USHORT nSubType = 0; sDBName += DB_DELIM; -#ifdef REPLACE_OFADBMGR sDBName += sTableName; sDBName += DB_DELIM; if(sColumnName.Len()) @@ -323,7 +290,6 @@ BOOL __EXPORT SwFldDBPage::FillItemSet(SfxItemSet& rSet) sDBName += sColumnName; sDBName += DB_DELIM; } -#endif aName.Insert(sDBName, 0); switch (nTypeId) @@ -342,14 +308,10 @@ BOOL __EXPORT SwFldDBPage::FillItemSet(SfxItemSet& rSet) } -#ifdef REPLACE_OFADBMGR String sTempDBName, sTempTableName, sTempColumnName; sTempDBName = aDatabaseTLB.GetDBName(sTempTableName, sTempColumnName); BOOL bDBListBoxChanged = sOldDBName != sTempDBName || sOldTableName != sTempTableName || sOldColumnName != sTempColumnName; -#else - BOOL bDBListBoxChanged = sOldDBName != aDatabaseTLB.GetDBName(); -#endif if (!IsFldEdit() || aConditionED.GetSavedValue() != aConditionED.GetText() || aValueED.GetSavedValue() != aValueED.GetText() || @@ -410,7 +372,6 @@ IMPL_LINK( SwFldDBPage, TypeHdl, ListBox *, pBox ) if (IsFldEdit()) { -#ifdef REPLACE_OFADBMGR String sDBName, sTableName, sColumnName; if (nTypeId == TYP_DBFLD) { @@ -425,19 +386,6 @@ IMPL_LINK( SwFldDBPage, TypeHdl, ListBox *, pBox ) sDBName = sDBName.GetToken(0, DB_DELIM); aDatabaseTLB.Select(sDBName, sTableName, sColumnName); -#else - String sDBName; - if (nTypeId == TYP_DBFLD) - { - sDBName = ((SwDBField*)GetCurField())->GetDBName(); - sDBName += DB_DELIM; - sDBName += ((SwDBFieldType*)GetCurField()->GetTyp())->GetColumnName(); - } - else - sDBName = ((SwDBNameInfField*)GetCurField())->GetDBName(pSh->GetDoc()); - - aDatabaseTLB.Select(sDBName); -#endif } switch (nTypeId) @@ -595,7 +543,6 @@ IMPL_LINK( SwFldDBPage, TreeSelectHdl, SvTreeListBox *, pBox ) if (pEntry != 0) { -#ifdef REPLACE_OFADBMGR String sTableName; String sColumnName; BOOL bIsTable; @@ -604,14 +551,6 @@ IMPL_LINK( SwFldDBPage, TreeSelectHdl, SvTreeListBox *, pBox ) sTableName, bIsTable, sColumnName); -#else - String sName(aDatabaseTLB.GetDBName()); - String sColumnName(sName.GetToken(2, DB_DELIM)); - String sDBName(sName.GetToken(0, DB_DELIM)); - sDBName += DB_DELIM; - sDBName += sName.GetToken(1, DB_DELIM); - bNumFormat = GetFldMgr().IsDBNumeric(sDBName, sColumnName); -#endif if (!IsFldEdit()) aDBFormatRB.Check(); } @@ -652,105 +591,4 @@ void SwFldDBPage::FillUserData() sData += String::CreateFromInt32( nTypeSel ); SetUserData(sData); } -/*------------------------------------------------------------------------ - - $Log: not supported by cvs2svn $ - Revision 1.31 2000/09/18 16:05:28 willem.vandorp - OpenOffice header added. - - Revision 1.30 2000/07/07 15:25:43 os - replace ofadbmgr - - Revision 1.29 2000/06/30 08:52:52 os - #76541# string assertions removed - - Revision 1.28 2000/06/26 13:35:59 os - new DataBase API - - Revision 1.27 2000/05/23 18:36:33 jp - Bugfixes for Unicode - - Revision 1.26 2000/04/18 15:17:31 os - UNICODE - - Revision 1.25 1999/02/25 16:24:50 JP - Bug #62438#: UserData nur auswerten, wenn kein Refresh ist - - - Rev 1.24 25 Feb 1999 17:24:50 JP - Bug #62438#: UserData nur auswerten, wenn kein Refresh ist - - Rev 1.23 21 Jan 1999 09:50:36 OS - #59900# Fussnoten im Dialog korrekt sortieren; keine prot. Member - - Rev 1.22 12 Jan 1999 11:42:26 OS - #60579# ausgewaehlten Typ in den UserData speichern - - Rev 1.21 11 Dec 1998 15:16:24 OM - #60051# Richtiges Format fuer Serienbrieffelder waehlen - - Rev 1.20 17 Nov 1998 10:50:38 OS - #58263# NumType durch SvxExtNumType ersetzt - - Rev 1.19 04 Nov 1998 13:27:56 OM - #58939# Bei Formataenderung RadioButton vorselektieren - - Rev 1.18 10 Aug 1998 16:39:58 JP - Bug #54796#: neue NumerierungsTypen (WW97 kompatibel) - - Rev 1.17 09 Jul 1998 09:52:58 JP - EmptyStr benutzen - - Rev 1.16 10 Jun 1998 13:26:08 OM - Alten Typ nach Reset restaurieren - - Rev 1.15 27 Mar 1998 15:23:54 OM - #48909# Insert-Btn korrekt enablen/disablen - - Rev 1.14 06 Mar 1998 13:07:48 OM - Nur bei Aenderung Feld aktualisieren - - Rev 1.13 04 Mar 1998 08:32:24 MH - chg: Syntax - - Rev 1.12 16 Feb 1998 09:39:00 OM - Fuer Solaris nicht direkt von void* auf ushort casten - - Rev 1.11 06 Jan 1998 18:12:54 OM - Felbefehl-Dlg - - Rev 1.10 05 Jan 1998 17:44:34 OM - DB-Feldbefehl bearbeiten - - Rev 1.9 12 Dec 1997 17:14:00 OM - Listbox bei numerischen Formaten enablen - - Rev 1.8 11 Dec 1997 16:58:00 OM - Feldumstellung - - Rev 1.7 20 Nov 1997 17:01:20 OM - Neuer Felddialog - - Rev 1.6 19 Nov 1997 16:30:42 OM - Datenbank-TP Drag&Drop - - Rev 1.5 18 Nov 1997 10:34:36 OM - Neuer Feldbefehldialog - - Rev 1.4 17 Nov 1997 09:06:36 OM - Basisklasse fuer Feldbefehl-TPs - - Rev 1.3 05 Nov 1997 17:02:46 OM - Spaltennamen anzeigen - - Rev 1.2 05 Nov 1997 15:35:38 OM - Neuer Feldbefehldialog - - Rev 1.1 30 Oct 1997 14:31:42 OM - Feldbefehl-Umstellung - - Rev 1.0 28 Oct 1997 15:05:06 OM - Initial revision. - -------------------------------------------------------------------------*/ diff --git a/sw/source/ui/fldui/flddb.hxx b/sw/source/ui/fldui/flddb.hxx index 5dc89b9b2ca9..5a0793c3aa4c 100644 --- a/sw/source/ui/fldui/flddb.hxx +++ b/sw/source/ui/fldui/flddb.hxx @@ -2,9 +2,9 @@ * * $RCSfile: flddb.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:14:36 $ + * last change: $Author: os $ $Date: 2000-10-27 11:24:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -101,10 +101,8 @@ class SwFldDBPage : public SwFldPage GroupBox aFormatGB; String sOldDBName; -#ifdef REPLACE_OFADBMGR String sOldTableName; String sOldColumnName; -#endif ULONG nOldFormat; USHORT nOldSubType; Link aOldNumSelectHdl; diff --git a/sw/source/ui/fldui/fldmgr.cxx b/sw/source/ui/fldui/fldmgr.cxx index b92e278aac6f..171d22adc261 100644 --- a/sw/source/ui/fldui/fldmgr.cxx +++ b/sw/source/ui/fldui/fldmgr.cxx @@ -2,9 +2,9 @@ * * $RCSfile: fldmgr.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: os $ $Date: 2000-10-20 14:18:03 $ + * last change: $Author: os $ $Date: 2000-10-27 11:24:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -74,7 +74,6 @@ #include "hintids.hxx" #include "charatr.hxx" -#ifdef REPLACE_OFADBMGR #ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #endif @@ -96,9 +95,6 @@ #ifndef _COM_SUN_STAR_SDB_XQUERIESSUPPLIER_HPP_ #include <com/sun/star/sdb/XQueriesSupplier.hpp> #endif -//#ifndef _COM_SUN_STAR_SDB_XDATABASEACCESS_HPP_ -//#include <com/sun/star/sdb/XDatabaseAccess.hpp> -//#endif #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ #include <com/sun/star/beans/XPropertySet.hpp> #endif @@ -106,11 +102,6 @@ #include <comphelper/processfactory.hxx> #endif -#else - - -#endif //REPLACE_OFADBMGR - #ifndef _SFXDISPATCH_HXX //autogen #include <sfx2/dispatch.hxx> #endif @@ -199,7 +190,6 @@ #include "fldui.hrc" -#ifdef REPLACE_OFADBMGR using namespace rtl; using namespace com::sun::star::uno; using namespace com::sun::star::container; @@ -210,8 +200,6 @@ using namespace com::sun::star::sdbcx; using namespace com::sun::star::beans; #define C2U(cChar) rtl::OUString::createFromAscii(cChar) -#endif - /*-------------------------------------------------------------------- Beschreibung: Gruppen der Felder --------------------------------------------------------------------*/ @@ -1192,15 +1180,10 @@ BOOL SwFldMgr::InsertFld(USHORT nType, if( !(nSubType & SUB_OWN_FMT) ) // Datenbankformat ermitteln { -#ifdef REPLACE_OFADBMGR String sSourceName(sDBName.GetToken(0, DB_DELIM)); String sTableName(sDBName.GetToken(1, DB_DELIM)); nFormat = pSh->GetNewDBMgr()->GetColumnFmt( sSourceName, sTableName, sPar1, pSh->GetNumberFormatter(), GetCurrLanguage() ); -#else - nFormat = pSh->GetNewDBMgr()->GetColumnFmt( sDBName, sPar1, - pSh->GetNumberFormatter() ); -#endif } pFld->ChangeFormat( nFormat ); @@ -1231,11 +1214,7 @@ BOOL SwFldMgr::InsertFld(USHORT nType, nPos = 0; sPar1 = rPar1.Copy(nPos); -#ifdef REPLACE_OFADBMGR if (sDBName.Len() && pSh->GetDBName() != sDBName) -#else - if (sDBName.Len() && pSh->GetDBName().ToUpperAscii() != sDBName.ToUpperAscii()) -#endif pSh->ChgDBName(sDBName); switch(nType) @@ -1655,7 +1634,6 @@ String SwFldMgr::GetDataBaseFieldValue(const String &rDBName, const String &rFie Anm: Im Fehlerfall wird TRUE returnt. --------------------------------------------------------------------*/ -#ifdef REPLACE_OFADBMGR BOOL SwFldMgr::IsDBNumeric(const String& rDBName, const String& rTblQryName, BOOL bIsTable, const String& rFldName) { @@ -1756,70 +1734,10 @@ BOOL SwFldMgr::IsDBNumeric(const String& rDBName, const String& rTblQryName, return bNumeric; } -#else -BOOL SwFldMgr::IsDBNumeric(const String& rDBName, USHORT nCol) -{ - SwWrtShell *pSh = ::GetActiveView()->GetWrtShellPtr(); - String sDBName; - if (!rDBName.Len()) - sDBName = pSh->GetDBDesc(); - else - sDBName = rDBName; - - SwNewDBMgr* pDBMgr = pSh->GetNewDBMgr(); - BOOL bRet = TRUE; - if(nCol > 0 && pDBMgr->OpenDB(DBMGR_STD, sDBName, FALSE)) - { - short nType = pDBMgr->GetColumnFormatType(DBMGR_STD, nCol); - - switch (nType) - { - case dbCurrency: - case dbCounter: - case dbNumeric: - case dbDateTime: - case dbDate: - case dbTime: - case dbBool: - case dbDecimal: - case dbBigInt: - bRet = TRUE; - break; - - default: - bRet = FALSE; - break; - } - } - return bRet; -} - -BOOL SwFldMgr::IsDBNumeric(const String& rDBName, const String& rFldName) -{ - SwWrtShell *pSh = ::GetActiveView()->GetWrtShellPtr(); - SwNewDBMgr* pDBMgr = pSh->GetNewDBMgr(); - - String sDBName; - if (!rDBName.Len()) - sDBName = pSh->GetDBDesc(); - else - sDBName = rDBName; - - if( pDBMgr->OpenDB(DBMGR_STD, sDBName, FALSE)) - { - int nCol = pDBMgr->GetColumnPos(DBMGR_STD, rFldName); - if (nCol > 0) - return IsDBNumeric(rDBName, nCol); - } - return TRUE; -} -#endif /*-------------------------------------------------------------------- Beschreibung: ExpressionFields explizit evaluieren --------------------------------------------------------------------*/ - - void SwFldMgr::EvalExpFlds(SwWrtShell* pSh) { if (pSh == NULL) @@ -1832,8 +1750,6 @@ void SwFldMgr::EvalExpFlds(SwWrtShell* pSh) pSh->EndAllAction(); } } - - USHORT SwFldMgr::GetCurrLanguage() const { SwWrtShell* pSh = pWrtShell ? pWrtShell : ::lcl_GetShell(); @@ -1849,7 +1765,6 @@ USHORT SwFldMgr::GetCurrLanguage() const return (USHORT)eCurLanguage; } - void SwFieldType::_GetFldName() { static const USHORT coFldCnt = STR_TYPE_END - STR_TYPE_BEGIN; @@ -2076,7 +1991,6 @@ ULONG SwFldMgr::GetDefaultFormat(USHORT nTypeId, BOOL bIsText, SvNumberFormatter return pFormatter->GetStandardFormat(nDefFormat, GetCurrLanguage()); } -#ifdef REPLACE_OFADBMGR /* -----------------------------23.06.00 17:32-------------------------------- ---------------------------------------------------------------------------*/ @@ -2094,360 +2008,5 @@ Reference<XNameAccess> SwFldMgr::GetDBContext() } return xDBContext; } -#endif - -/************************************************************************* - - $Log: not supported by cvs2svn $ - Revision 1.1.1.1 2000/09/18 17:14:36 hr - initial import - - Revision 1.285 2000/09/18 16:05:29 willem.vandorp - OpenOffice header added. - - Revision 1.284 2000/09/07 15:59:23 os - change: SFX_DISPATCHER/SFX_BINDINGS removed - - Revision 1.283 2000/09/04 11:43:16 tbe - basicide, isetbrw, si, vcdlged moved from svx to basctl - - Revision 1.282 2000/08/15 19:53:15 jp - Bug #76817#: DDE-Field - use the correct format Id's - - Revision 1.281 2000/07/18 12:50:08 os - replace ofadbmgr - - Revision 1.280 2000/06/30 08:52:52 os - #76541# string assertions removed - - Revision 1.279 2000/06/26 13:36:00 os - new DataBase API - - Revision 1.278 2000/05/26 07:21:29 os - old SW Basic API Slots removed - - Revision 1.277 2000/04/18 15:17:32 os - UNICODE - - Revision 1.276 2000/02/11 14:46:35 hr - #70473# changes for unicode ( patched by automated patchtool ) - - Revision 1.275 1999/10/21 10:50:48 os - SwAuthorityFieldType has SwDoc* member - - Revision 1.274 1999/10/11 09:00:11 os - AuthorityField(Type):Import/Export interfaces - - Revision 1.273 1999/09/20 09:46:33 os - second param at SwAuthorityField - - Revision 1.272 1999/09/15 14:04:02 os - AuthorityField(-Type), RES_AUTHORITY - - Revision 1.271 1999/01/12 20:16:08 JP - Bug #60431#: Datenbank Numberformate ggfs. ins Doc uebertragen - - - Rev 1.270 12 Jan 1999 21:16:08 JP - Bug #60431#: Datenbank Numberformate ggfs. ins Doc uebertragen - - Rev 1.269 27 Nov 1998 14:52:16 AMA - Fix #59951#59825#: Unterscheiden zwischen Rahmen-,Seiten- und Bereichsspalten - - Rev 1.268 17 Nov 1998 10:50:38 OS - #58263# NumType durch SvxExtNumType ersetzt - - Rev 1.267 04 Nov 1998 12:11:08 OM - #58851# Fixe Dateinamenfelder bearbeiten - - Rev 1.266 16 Oct 1998 12:55:46 OM - #57970# Zahlenformat Seitenvorlage fuer Statistikfeld - - Rev 1.265 15 Oct 1998 16:02:50 OM - #57965# Variablennamen fuer Eingabefeld verwenden - - Rev 1.264 15 Sep 1998 16:01:58 OM - #55149# In Dialogen Zahlenformat der Applikation verwenden - - Rev 1.263 10 Aug 1998 16:40:00 JP - Bug #54796#: neue NumerierungsTypen (WW97 kompatibel) - - Rev 1.262 24 Jul 1998 13:57:04 OM - #53246# Makros vorselektieren - - Rev 1.261 07 Jul 1998 17:04:58 OM - #52283# Ueber alle DB-Feldbefehle navigieren - - Rev 1.260 18 Jun 1998 11:16:42 OM - Kapitelebenen fuer Nummernkreise - - Rev 1.259 20 May 1998 13:24:24 OM - Offset fuer DateTimeFields - - Rev 1.258 15 Apr 1998 16:39:34 OM - #47244 SubType nich veraendern - - Rev 1.257 26 Mar 1998 17:00:22 OM - Feldbefehl: Seitenanzahl im Html-Mode - - Rev 1.256 26 Mar 1998 16:43:06 OM - Feldbefehl: Seitenanzahl im Html-Mode - - Rev 1.255 06 Mar 1998 15:31:20 OM - Neue numerische Datenbankformate - - Rev 1.254 13 Feb 1998 14:14:50 JP - UpdateFld: TYP_INETFLD gibt es nicht mehr! - - Rev 1.253 27 Jan 1998 22:43:52 JP - GetNumDepend durch GetDepends ersetzt - - Rev 1.252 13 Jan 1998 15:01:48 OM - Formula-Field wieder unterstuetzt - - Rev 1.251 12 Jan 1998 17:10:20 OM - Formelfelder wieder erlauben - - Rev 1.250 12 Jan 1998 12:42:58 OM - Nummernkreise nicht doppelt anlegen - - Rev 1.249 06 Jan 1998 18:12:56 OM - Felbefehl-Dlg - - Rev 1.248 19 Dec 1997 18:24:26 OM - Feldbefehl-bearbeiten Dlg - - Rev 1.247 17 Dec 1997 15:23:36 OM - #46218# Korrekte Sprache besorgen - - Rev 1.246 16 Dec 1997 17:01:42 OM - Feldbefehle bearbeiten - - Rev 1.245 11 Dec 1997 16:58:02 OM - Feldumstellung - - Rev 1.244 05 Dec 1997 13:16:38 OM - #45750# DDE-Field Delimiter fuer Basic wandeln - - Rev 1.243 28 Nov 1997 19:50:38 MA - includes - - Rev 1.242 27 Nov 1997 13:17:18 OM - Variablen-TP - - Rev 1.241 25 Nov 1997 12:38:44 OM - Funktionen-TP - - Rev 1.240 21 Nov 1997 17:19:44 OM - Feldbefehl-Umstellung: DocInfo - - Rev 1.239 18 Nov 1997 14:33:14 OM - Sba-Umstellung 372 - - Rev 1.238 18 Nov 1997 10:33:12 OM - Neuer Feldbefehldialog - - Rev 1.237 14 Nov 1997 11:42:36 OM - Aufgeraeumt - - Rev 1.236 30 Oct 1997 14:30:52 OM - Feldbefehl-Umstellung - - Rev 1.235 15 Oct 1997 11:57:24 OM - Feldumstellung - - Rev 1.234 13 Oct 1997 11:43:16 OM - Feldumstellung - - Rev 1.233 09 Oct 1997 16:13:44 OM - Feldumstellung - - Rev 1.232 07 Oct 1997 10:51:26 OM - Feldumstellung - - Rev 1.231 06 Oct 1997 15:40:44 OM - Feldumstellung - - Rev 1.230 02 Oct 1997 15:21:44 OM - Feldumstellung - - Rev 1.229 24 Sep 1997 15:18:56 OM - Feldumstellung - - Rev 1.228 18 Sep 1997 14:34:02 OM - Feldumstellung - - Rev 1.227 02 Sep 1997 09:55:56 OM - SDB-Headeranpassung - - Rev 1.226 01 Sep 1997 13:12:40 OS - DLL-Umstellung - - Rev 1.225 25 Aug 1997 11:54:20 OS - 368-Changes SBA - - Rev 1.224 15 Aug 1997 12:11:24 OS - chartar/frmatr/txtatr aufgeteilt - - Rev 1.223 09 Aug 1997 13:17:38 OS - paraitem/frmitems/textitem aufgeteilt - - Rev 1.222 05 Aug 1997 12:38:24 MH - chg: header - - Rev 1.221 09 Jul 1997 17:33:24 HJS - includes - - Rev 1.220 29 May 1997 16:16:00 OM - URL in ScriptDialog eingeben - - Rev 1.219 29 Apr 1997 16:10:22 OM - Unsichtbare Benutzerfelder - - Rev 1.218 28 Apr 1997 16:31:04 JP - SetFldValue: immer einen FldTypen anlegen. - - Rev 1.217 08 Apr 1997 10:32:42 MA - includes - - Rev 1.216 04 Apr 1997 10:32:28 OM - Datenbanken nach Gebrauch wieder schliessen - - Rev 1.215 14 Mar 1997 14:07:22 OM - #37666# GPF beim Bearbeiten alter 3.x DB-Feldbefehlen behoben - - Rev 1.214 11 Mar 1997 13:15:12 OM - Datenbank beim Feldeinfuegen am Dok setzen - - Rev 1.213 26 Feb 1997 02:22:20 OM - #37068# Feldbefhel-Dlg GPF gefixt - - Rev 1.212 25 Feb 1997 20:04:10 OM - GPF in Feldbefehlen behoben - - Rev 1.211 24 Feb 1997 20:29:30 OM - Offset-Fehler behoben - - Rev 1.210 23 Feb 1997 21:14:42 OM - Aufgeraeumt - - Rev 1.209 23 Feb 1997 15:05:54 OS - SetFieldValue liefert BOOL - - Rev 1.208 22 Feb 1997 21:22:58 OM - Aufgeraeumt - - Rev 1.207 22 Feb 1997 16:43:14 OM - Basic-Umstellung: OpenColumn - - Rev 1.206 17 Feb 1997 10:39:18 OM - Neue Feldbefehle im Webmode - - Rev 1.205 16 Feb 1997 10:48:20 OM - DBMGR an Ofa verschoben - - Rev 1.204 13 Feb 1997 17:37:42 OM - Neu: javaedit - - Rev 1.203 11 Feb 1997 16:52:04 OM - Eingabefeld ueber Basic ohne Dialog einfuegen - - Rev 1.202 09 Feb 1997 16:34:06 OM - Variable setzen: html_on/off - - Rev 1.201 07 Feb 1997 17:19:50 OM - Web-Mode fuer Feldbefehle-Dlg - - Rev 1.200 07 Feb 1997 11:34:14 OM - Web-Mode fuer FeldbefehlDlg - - Rev 1.199 05 Feb 1997 09:35:56 OM - Verschiebung in den Bereichen behoben - - Rev 1.198 03 Feb 1997 17:08:58 OM - InsertURL aus Feldbefehl-Dlg entfernt - - Rev 1.197 29 Jan 1997 13:14:18 MA - unbenutzes entfernt - - Rev 1.196 17 Dec 1996 15:37:46 OM - Macrofelder editieren - - Rev 1.195 11 Dec 1996 10:21:04 MA - Warnings - - Rev 1.194 26 Nov 1996 20:39:32 JP - RefFelder werden jetzt mit&nach den ExpFeldern aktualisiert - - Rev 1.193 13 Nov 1996 15:00:58 JP - neuer FeldTyp fuer Scripts (z.B. JavaScript) - - Rev 1.192 11 Nov 1996 09:55:52 MA - ResMgr - - Rev 1.191 08 Nov 1996 14:55:58 JP - ueberfluessiges Include entfernt - - Rev 1.190 07 Nov 1996 15:46:56 JP - Bug #33084#: Referenzen nach einfuegen updaten - - Rev 1.189 05 Nov 1996 22:45:06 JP - UpdateCurFld..() entfernt - ueberflussig; UpdateFld: GetRefFld sonderbehandelt - - Rev 1.188 05 Nov 1996 15:32:42 JP - Umstellungen fuer neue Referenz-Seite - - Rev 1.187 01 Nov 1996 03:55:46 MH - add: includes - - Rev 1.186 24 Oct 1996 13:36:20 JP - String Umstellung: [] -> GetChar() - - Rev 1.185 25 Sep 1996 14:11:48 OM - Neue Datenbanktrenner - - Rev 1.184 19 Sep 1996 14:32:30 OM - Datenbank Basicanbindung - - Rev 1.183 02 Sep 1996 18:43:00 JP - INetFeld entfernt - - Rev 1.182 30 Aug 1996 12:45:42 OS - UpdateGlosPath kann Blockliste aktualisieren - - Rev 1.181 28 Aug 1996 12:11:14 OS - includes - - Rev 1.180 21 Aug 1996 13:08:52 OS - Manager gfs. mit wrtshell konstruieren - - Rev 1.179 20 Aug 1996 17:22:18 JP - Bug #30489#: Mehrfachselektion bei SetRef-Feldern abklemmen - - Rev 1.178 16 Aug 1996 11:27:56 OM - Dokinfo aufgegliedert - - Rev 1.177 15 Aug 1996 09:56:44 AMA - Fix: Macros am INetFmt setzen. - - Rev 1.176 12 Aug 1996 10:50:04 AMA - Chg: SwFmtINetFmt jetzt mit TargetFrame im CTor. - - Rev 1.175 08 Aug 1996 15:33:34 AMA - New: Benutze InsertURL (als Textattribut) an der EditShell - - Rev 1.174 05 Aug 1996 15:18:24 OM - Datenbankumstellung - - Rev 1.173 25 Jul 1996 16:41:54 OM - Umstellung auf Tabellen - - Rev 1.172 23 Jul 1996 14:29:40 JP - PageNext/-Prev: mit Offset; InsertField: nach Left auch wieder ein Right rufen - - Rev 1.171 10 Jul 1996 17:47:56 OM - LocalizeDBName in Expfld verschoben - -*************************************************************************/ diff --git a/sw/source/ui/inc/dbinsdlg.hxx b/sw/source/ui/inc/dbinsdlg.hxx index 54ff61bfcff5..491340123a8a 100644 --- a/sw/source/ui/inc/dbinsdlg.hxx +++ b/sw/source/ui/inc/dbinsdlg.hxx @@ -2,9 +2,9 @@ * * $RCSfile: dbinsdlg.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:14:39 $ + * last change: $Author: os $ $Date: 2000-10-27 11:24:26 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -90,14 +90,12 @@ #ifndef _SWNUMFMTLB_HXX //autogen #include <numfmtlb.hxx> #endif -#ifdef REPLACE_OFADBMGR #ifndef _COM_SUN_STAR_UNO_REFERENCE_H_ #include <com/sun/star/uno/Reference.h> #endif namespace com{namespace sun{namespace star{namespace sdbcx{ class XColumnsSupplier; }}}} -#endif class SwTableAutoFmt; class SwView; @@ -126,14 +124,12 @@ struct SwInsDBColumn int operator<( const SwInsDBColumn& rCmp ) const; }; -#ifdef REPLACE_OFADBMGR struct SwInsDBData { String sDataBaseName; String sDataTableName; String sStatement; }; -#endif typedef SwInsDBColumn* SwInsDBColumnPtr; SV_DECL_PTRARR_SORT_DEL( SwInsDBColumns, SwInsDBColumnPtr, 32, 32 ) @@ -181,11 +177,7 @@ class SwInsertDBColAutoPilot : public SfxModalDialog HelpButton aBtHelp; SwInsDBColumns aDBColumns; -#ifdef REPLACE_OFADBMGR const SwInsDBData aDBData; -#else - -#endif //REPLACE_OFADBMGR Link aOldNumFmtLnk; String sNoTmpl; @@ -217,29 +209,17 @@ class SwInsertDBColAutoPilot : public SfxModalDialog void SetTabSet(); public: -#ifdef REPLACE_OFADBMGR SwInsertDBColAutoPilot( SwView& rView, ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource> rxSource, com::sun::star::uno::Reference<com::sun::star::sdbcx::XColumnsSupplier>, const SwInsDBData& rData ); -#else - SwInsertDBColAutoPilot( SwView& rView ); -#endif //REPLACE_OFADBMGR virtual ~SwInsertDBColAutoPilot(); -#ifdef REPLACE_OFADBMGR void DataToDoc( const SbaSelectionList*, ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource> rxSource, ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> xConnection); -#else - BOOL HasValidDB() const { return 0 != aDBColumns.Count(); } - void DataToDoc( const SbaSelectionList* ); -#endif //REPLACE_OFADBMGR }; - - - #endif diff --git a/sw/source/ui/inc/dbtree.hxx b/sw/source/ui/inc/dbtree.hxx index b8439bd911e7..92f488c08fac 100644 --- a/sw/source/ui/inc/dbtree.hxx +++ b/sw/source/ui/inc/dbtree.hxx @@ -2,9 +2,9 @@ * * $RCSfile: dbtree.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:14:39 $ + * last change: $Author: os $ $Date: 2000-10-27 11:24:26 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -65,14 +65,12 @@ #include <svtools/svtreebx.hxx> #endif -#ifdef REPLACE_OFADBMGR #ifndef _COM_SUN_STAR_UNO_REFERENCE_H_ #include <com/sun/star/uno/Reference.h> #endif namespace com{namespace sun{namespace star{namespace container{ class XNameAccess; }}}} -#endif #include "swtypes.hxx" @@ -88,9 +86,7 @@ class SwDBTreeList : public SvTreeListBox BOOL bInitialized; BOOL bShowColumns; -#ifdef REPLACE_OFADBMGR com::sun::star::uno::Reference<com::sun::star::container::XNameAccess> xDBContext; -#endif DECL_LINK( DBCompare, SvSortData* ); void InitTreeList(); @@ -105,13 +101,8 @@ public: SwDBTreeList(Window* pParent, const ResId& rResId, const String& rDefDBName = aEmptyStr, const BOOL bShowCol = FALSE ); ~SwDBTreeList(); -#ifdef REPLACE_OFADBMGR String GetDBName(String& rTableName, String& rColumnName, BOOL* pbIsTable = 0); void Select(const String& rDBName, const String& rTableName, const String& rColumnName); -#else - String GetDBName() const; - void Select(const String& rDBName); // Format: Datenbank.Tabelle -#endif void Show(); void ShowColumns(BOOL bShowCol); diff --git a/sw/source/ui/inc/fldmgr.hxx b/sw/source/ui/inc/fldmgr.hxx index 31d043dbe2a0..732dfa51a992 100644 --- a/sw/source/ui/inc/fldmgr.hxx +++ b/sw/source/ui/inc/fldmgr.hxx @@ -2,9 +2,9 @@ * * $RCSfile: fldmgr.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:14:39 $ + * last change: $Author: os $ $Date: 2000-10-27 11:24:26 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -72,15 +72,12 @@ #include "swtypes.hxx" -#ifdef REPLACE_OFADBMGR #ifndef _COM_SUN_STAR_UNO_REFERENCE_H_ #include <com/sun/star/uno/Reference.h> #endif namespace com{namespace sun{namespace star{namespace container{ class XNameAccess; }}}} -#else -#endif class SwWrtShell; class SwField; @@ -142,11 +139,9 @@ private: USHORT GetCurrLanguage() const; -#ifdef REPLACE_OFADBMGR com::sun::star::uno::Reference<com::sun::star::container::XNameAccess> xDBContext; com::sun::star::uno::Reference<com::sun::star::container::XNameAccess> GetDBContext(); -#endif public: SwFldMgr(SwWrtShell* pSh = 0); @@ -199,13 +194,8 @@ public: // Erfragen von Werten aus Datenbankfeldern (BASIC ) String GetDataBaseFieldValue(const String &rDBName, const String &rFieldName, SwWrtShell* pSh); -#ifdef REPLACE_OFADBMGR BOOL IsDBNumeric(const String& rDBName, const String& rTblQryName, BOOL bIsTable, const String& rFldName); -#else - BOOL IsDBNumeric(const String& rDBName, USHORT nColumn); - BOOL IsDBNumeric(const String& rDBName, const String& rFldName); -#endif // RefMark mit Namen organisieren BOOL CanInsertRefMark( const String& rStr ); diff --git a/sw/source/ui/inc/mailmrge.hxx b/sw/source/ui/inc/mailmrge.hxx index 1b6271e89a6b..9c718589fd99 100644 --- a/sw/source/ui/inc/mailmrge.hxx +++ b/sw/source/ui/inc/mailmrge.hxx @@ -2,9 +2,9 @@ * * $RCSfile: mailmrge.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:14:41 $ + * last change: $Author: os $ $Date: 2000-10-27 11:24:26 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -137,15 +137,10 @@ class SwMailMergeDlg : public SvxStandardDialog HelpButton aHelpBTN; SwWrtShell* pSh; -#ifdef REPLACE_OFADBMGR -#else SbaObject* pSbaObject; -#endif SwModuleOptions* pModOpt; const String& rDBName; -#ifdef REPLACE_OFADBMGR const String& rTableName; -#endif const String& rStatement; SbaSelectionListRef& rSelectionList; @@ -165,9 +160,7 @@ public: SwMailMergeDlg(Window* pParent, SwWrtShell* pSh, const String& rName, -#ifdef REPLACE_OFADBMGR const String& rTblName, -#endif const String& rStat, SbaSelectionListRef& pSelList); ~SwMailMergeDlg(); diff --git a/sw/source/ui/shells/textsh2.cxx b/sw/source/ui/shells/textsh2.cxx index 9d02cb92a692..3c6ef633a6f5 100644 --- a/sw/source/ui/shells/textsh2.cxx +++ b/sw/source/ui/shells/textsh2.cxx @@ -2,9 +2,9 @@ * * $RCSfile: textsh2.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: os $ $Date: 2000-10-20 14:18:06 $ + * last change: $Author: os $ $Date: 2000-10-27 11:24:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -97,7 +97,6 @@ #ifndef _OFF_APP_HXX //autogen #include <offmgr/app.hxx> #endif -#ifdef REPLACE_OFADBMGR #ifndef _SFXITEMSET_HXX #include <svtools/itemset.hxx> #endif @@ -132,10 +131,6 @@ #include <comphelper/processfactory.hxx> #endif -#else - -#endif //REPLACE_OFADBMGR - #include "dbmgr.hxx" @@ -149,7 +144,6 @@ #include "textsh.hxx" #include "dbinsdlg.hxx" -#ifdef REPLACE_OFADBMGR using namespace rtl; using namespace com::sun::star; using namespace com::sun::star::uno; @@ -161,13 +155,11 @@ using namespace com::sun::star::sdbcx; using namespace com::sun::star::beans; #define C2U(cChar) rtl::OUString::createFromAscii(cChar) -#endif #define C2S(cChar) UniString::CreateFromAscii(cChar) #define DB_DD_DELIM 0x0b #ifdef DEBUG // the addressbook doesn't support the new api yet (593) -#ifdef REPLACE_OFADBMGR void lcl_ReplaceDataSource(String& sDBName, String& sTblName, String& sStatmnt) { Reference<XNameAccess> xDBContext; @@ -219,7 +211,6 @@ void lcl_ReplaceDataSource(String& sDBName, String& sTblName, String& sStatmnt) } } } -#endif // REPLACE_OFADBMGR #endif // DEBUG inline void AddSelList( List& rLst, long nRow ) @@ -250,27 +241,12 @@ void lcl_QRY_UPDATE( const SfxItemSet *pArgs, SwNewDBMgr *pNewDBMgr, #ifdef DEBUG // the addressbook doesn't support the new api yet (593) -#ifdef REPLACE_OFADBMGR lcl_ReplaceDataSource(sDBName, sTableName, sStatement); -#endif #endif // DEBUG -#ifdef REPLACE_OFADBMGR -#else - if(sTableName.Len()) - { - sDBName += DB_DELIM; - sDBName += rTableNameItem.GetValue(); - } -#endif pNewDBMgr->SetMergeType( DBMGR_MERGE ); -#ifdef REPLACE_OFADBMGR pNewDBMgr->Merge(DBMGR_MERGE, &rSh, sStatement, pSelectionList, sDBName, sTableName); -#else - pNewDBMgr->Merge(DBMGR_MERGE, &rSh, - sStatement, pSelectionList, sDBName); -#endif } } @@ -301,7 +277,6 @@ void SwBaseShell::ExecDB(SfxRequest &rReq) const SbaSelectionItem &rSelectionItem = (const SbaSelectionItem&) pArgs->Get(SID_ATTR_SBA_SELECTION); xSelectionList = rSelectionItem.GetSelectionList(); } -#ifdef REPLACE_OFADBMGR #ifdef DEBUG { sDBName = C2S("Nordwind"); @@ -309,30 +284,13 @@ void SwBaseShell::ExecDB(SfxRequest &rReq) sStatement = C2S("select * from Artikel"); } #endif //DEBUG -#endif //REPLACE_OFADBMGR -#ifdef REPLACE_OFADBMGR -#else - else - break; -#endif if ( !xSelectionList.Is() ) xSelectionList = new SbaSelectionList; -#ifdef REPLACE_OFADBMGR -#else - if (sTableName.Len()) - { - sDBName += DB_DELIM; - sDBName += sTableName; - } -#endif - SwMailMergeDlg* pDlg = new SwMailMergeDlg( NULL, GetShellPtr(), sDBName, -#ifdef REPLACE_OFADBMGR sTableName, -#endif sStatement, xSelectionList ); if (pDlg->Execute() == RET_OK) @@ -341,17 +299,11 @@ void SwBaseShell::ExecDB(SfxRequest &rReq) OFF_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE, GetView().GetViewFrame()->GetObjectShell())); -#ifdef REPLACE_OFADBMGR pNewDBMgr->Merge(pNewDBMgr->GetMergeType(), GetShellPtr(), sStatement, xSelectionList, sDBName, sTableName); -#else - pNewDBMgr->Merge(pNewDBMgr->GetMergeType(), - GetShellPtr(), sStatement, - xSelectionList, sDBName); -#endif delete(pDlg); } } @@ -376,9 +328,7 @@ void SwBaseShell::ExecDB(SfxRequest &rReq) #ifdef DEBUG // the addressbook doesn't support the new api yet (593) -#ifdef REPLACE_OFADBMGR lcl_ReplaceDataSource(sDBName, sTblName, sStatmnt); -#endif #endif // DEBUG String* pDataStr = new String( sDBName ); @@ -428,12 +378,7 @@ void SwTextShell::ExecDB(SfxRequest &rReq) { String sSbaData = ((const SfxStringItem&)pArgs->Get(nSlot)).GetValue(); String sDBName = sSbaData.GetToken(0, DB_DD_DELIM); -#ifdef REPLACE_OFADBMGR String sTableName(sSbaData.GetToken(1, DB_DD_DELIM)); -#else - sDBName += DB_DELIM; - sDBName += sSbaData.GetToken(1, DB_DD_DELIM); -#endif BOOL bTable = sSbaData.GetToken(2, DB_DD_DELIM) == C2S("1"); String sStatement = sSbaData.GetToken(3, DB_DD_DELIM); @@ -447,15 +392,9 @@ void SwTextShell::ExecDB(SfxRequest &rReq) sSbaData.GetToken( i, DB_DD_DELIM).ToInt32() ); pNewDBMgr->SetMergeType( DBMGR_MERGE ); -#ifdef REPLACE_OFADBMGR pNewDBMgr->Merge(DBMGR_MERGE, GetShellPtr(), sStatement, pSelectionList, sDBName, sTableName); -#else - pNewDBMgr->Merge(DBMGR_MERGE, - GetShellPtr(), sStatement, - pSelectionList, sDBName); -#endif } break; @@ -491,7 +430,6 @@ IMPL_STATIC_LINK( SwBaseShell, InsertDBTextHdl, String*, pString ) if( pString ) { -#ifdef REPLACE_OFADBMGR USHORT nTokenPos = 0; String sSourceName( pString->GetToken( 0, DB_DD_DELIM, nTokenPos )); String sTblQryName( pString->GetToken( 0, DB_DD_DELIM, nTokenPos )); @@ -524,257 +462,14 @@ IMPL_STATIC_LINK( SwBaseShell, InsertDBTextHdl, String*, pString ) pString->GetToken( 0, DB_DD_DELIM, nTokenPos ).ToInt32() ); pDlg->DataToDoc( &aSelectionList , xSource, xConnection); } -// else -// rSh.ChgDBName( sOldDBName ); - delete pDlg; - } -// else -// rSh.ChgDBName( sOldDBName ); -#else - USHORT nTokenPos = 0; - String sDBName( pString->GetToken( 0, DB_DD_DELIM, nTokenPos )); - ( sDBName += DB_DELIM ) += - pString->GetToken( 0, DB_DD_DELIM, nTokenPos ); - String sStatmnt( pString->GetToken( 1, DB_DD_DELIM, nTokenPos )); - - SbaSelectionList aSelectionList; - while( nTokenPos < pString->Len() ) - AddSelList( aSelectionList, - pString->GetToken( 0, DB_DD_DELIM, nTokenPos ).ToInt32() ); - - SwWrtShell& rSh = pThis->GetShell(); - SwNewDBMgr* pNewDBMgr = rSh.GetNewDBMgr(); - String sOldDBName( rSh.GetDBName() ); - ( sDBName += ';' ) += sStatmnt; - rSh.ChgDBName( sDBName ); - - if( pNewDBMgr->OpenDB( DBMGR_STD, rSh.GetDBDesc() ) ) - { - pNewDBMgr->ChangeStatement( DBMGR_STD, sStatmnt ); - - SwInsertDBColAutoPilot *pDlg = new SwInsertDBColAutoPilot( - pThis->GetView() ); - if( pDlg->HasValidDB() && RET_OK == pDlg->Execute() ) - { - // dann jetzt ueber den DBManager die Selektierten - // Daten ins Dokument einfuegen. - pDlg->DataToDoc( &aSelectionList ); - } - else - rSh.ChgDBName( sOldDBName ); delete pDlg; - pNewDBMgr->CloseAll(); } - else - rSh.ChgDBName( sOldDBName ); -#endif } delete pString; return 0; } -/*------------------------------------------------------------------------ - - $Log: not supported by cvs2svn $ - Revision 1.1.1.1 2000/09/18 17:14:47 hr - initial import - - Revision 1.115 2000/09/18 16:06:06 willem.vandorp - OpenOffice header added. - - Revision 1.114 2000/07/18 12:50:09 os - replace ofadbmgr - - Revision 1.113 2000/07/07 15:25:43 os - replace ofadbmgr - - Revision 1.112 2000/07/06 07:59:11 os - replace ofadbmgr - - Revision 1.111 2000/07/05 08:22:09 os - Replace ofadbmgr - - Revision 1.110 2000/06/07 13:18:20 os - using UCB - - Revision 1.109 2000/05/26 07:21:33 os - old SW Basic API Slots removed - - Revision 1.108 2000/05/23 19:29:09 jp - Bugfixes for Unicode - - Revision 1.107 2000/05/10 11:53:02 os - Basic API removed - - Revision 1.106 2000/04/18 14:58:24 os - UNICODE - - Revision 1.105 2000/02/11 14:58:04 hr - #70473# changes for unicode ( patched by automated patchtool ) - - Revision 1.104 2000/01/06 07:32:58 os - #71436# mail merge dialog: execute via status method disposed - - Revision 1.103 1999/11/11 15:00:55 hr - #65293#: STLPORT 3.2.1 - - Revision 1.102 1999/09/29 07:00:54 mh - chg: header - - Revision 1.101 1999/03/01 15:22:38 MA - #62490# Altlast entfernt (Drucken und Briefumschlaege/Etiketten und Datenbank) - - - Rev 1.100 01 Mar 1999 16:22:38 MA - #62490# Altlast entfernt (Drucken und Briefumschlaege/Etiketten und Datenbank) - - Rev 1.99 26 Feb 1999 16:08:42 MA - #62490# Rest vom Drucken Etiketten entfernt - - Rev 1.98 12 Oct 1998 10:16:12 OM - #57790# Dialog nicht mehr AppModal - - Rev 1.97 28 May 1998 17:09:54 JP - Auch beim Droppen von Datensaetzen als Text den neuen DBInsertDialog starten - - Rev 1.96 20 May 1998 21:32:32 JP - InsertDBCols als Text: rufe den neuen Autopiloten - - Rev 1.95 09 Dec 1997 12:31:08 OM - #45200# Serienbrief: Speichern-Monitor - - Rev 1.94 02 Dec 1997 19:38:24 MA - #45900#, SelectionList muss fuer Dialog existieren - - Rev 1.93 24 Nov 1997 09:46:52 MA - includes - - Rev 1.92 18 Nov 1997 14:45:22 OM - Sba-Umstellung 372 - - Rev 1.91 03 Nov 1997 13:55:42 MA - precomp entfernt - - Rev 1.90 08 Sep 1997 11:12:38 OM - #43152# SingleJob-Parameter fuer DataUpdatePrint - - Rev 1.89 02 Sep 1997 14:58:36 OM - Neue Parameter fuer DataUpdatePrint - - Rev 1.88 02 Sep 1997 09:58:00 OM - SDB-Headeranpassung - - Rev 1.87 01 Sep 1997 13:23:56 OS - DLL-Umstellung - - Rev 1.86 06 Aug 1997 14:37:02 TRI - VCL: includes - - Rev 1.85 11 Jul 1997 14:46:36 OM - #41525# Nur durch SQL-Statement eingeschraenkte Datensaetze verwenden - - Rev 1.84 09 Jun 1997 17:23:16 OM - Serienbriefe als Dateien speichern - - Rev 1.83 29 Apr 1997 16:19:48 OM - Druckdialog bei Aufruf aus Basic unterdruecken - - Rev 1.82 07 Apr 1997 17:45:56 MH - chg: header - - Rev 1.81 09 Mar 1997 15:51:36 OM - Basic abgesichert - - Rev 1.80 24 Feb 1997 16:54:02 OS - Item mit Tabellenname auswerten - - Rev 1.79 13 Feb 1997 22:59:16 MA - Datenbankfunktionalitaet wieder hergestellt - - Rev 1.78 12 Feb 1997 16:57:48 OM - Datenbankslots ueber Baseshell rufen - - Rev 1.77 12 Feb 1997 10:40:46 OM - Endlosschleife behoben - - Rev 1.76 12 Feb 1997 09:22:44 OM - DD-Trenner korrigiert - - Rev 1.75 09 Feb 1997 15:09:34 OM - Anderer Trenner bei DB Drag u. Drop - - Rev 1.74 07 Feb 1997 17:20:36 OM - Datenbankumstellung Drag u. Drop - - Rev 1.73 16 Dec 1996 10:59:02 OM - Drucken aus DB-Browser angefangen - - Rev 1.72 11 Dec 1996 10:50:56 MA - Warnings - - Rev 1.71 01 Dec 1996 19:30:28 sdo - GCC-Parser - - Rev 1.70 12 Nov 1996 16:50:58 MA - richtige Versionen gemerged - - Rev 1.68 08 Nov 1996 17:40:14 OM - DB-Mode fuer Serienbriefe und Etiketten zum Teil wiederbelebt - - Rev 1.67 24 Oct 1996 13:36:40 JP - String Umstellung: [] -> GetChar() - - Rev 1.66 25 Sep 1996 14:12:10 OM - Neue Datenbanktrenner - - Rev 1.65 19 Sep 1996 14:32:52 OM - Datenbank Basicanbindung - - Rev 1.64 18 Sep 1996 10:44:58 OM - Serienbriefe wieder angebunden - - Rev 1.63 13 Sep 1996 15:47:16 OM - Serienbrief - - Rev 1.62 06 Sep 1996 12:31:42 OM - Statusmethode fuer DB-Slot - - Rev 1.61 28 Aug 1996 15:54:58 OS - includes - - Rev 1.60 23 Aug 1996 15:51:56 OM - Datenbank: Drag&Drop - - Rev 1.59 23 Aug 1996 14:48:00 OM - Datenbank: Drag&Drop - - Rev 1.58 21 Aug 1996 14:51:52 OM - Datenbank Drag&Drop - - Rev 1.57 07 Aug 1996 16:24:24 OM - Datenbankumstellung - - Rev 1.56 19 Jul 1996 16:10:14 OM - SBA-Umstellung - - Rev 1.55 17 Jul 1996 13:47:40 OM - Datenbankumstellung 327 - - Rev 1.54 02 Jul 1996 16:36:20 OM - #28615# Makroausfuehrung auch bei Serienbriefdruck - - Rev 1.53 04 Jun 1996 14:11:22 OM - Serienbrief Mailing - - Rev 1.52 06 May 1996 17:39:34 OM - Mehrere Datenbanken pro Dokument - - Rev 1.51 30 Apr 1996 09:24:34 OM - Mehrere Datenbanken pro Dok - -------------------------------------------------------------------------*/ - diff --git a/sw/source/ui/uiview/viewprt.cxx b/sw/source/ui/uiview/viewprt.cxx index 5bef44eebed7..708ae3109087 100644 --- a/sw/source/ui/uiview/viewprt.cxx +++ b/sw/source/ui/uiview/viewprt.cxx @@ -2,9 +2,9 @@ * * $RCSfile: viewprt.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: jp $ $Date: 2000-10-06 13:38:28 $ + * last change: $Author: os $ $Date: 2000-10-27 11:24:37 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -374,11 +374,7 @@ ErrCode SwView::DoPrint( SfxPrinter *pPrinter, PrintDialog *pDlg, if( pMgr->GetMergeType() == DBMGR_MERGE_MAILMERGE ) { ::MakeOptions( pDlg, aOpts, 0, bWeb, GetPrinter() ); -#ifdef REPLACE_OFADBMGR bStartJob = pMgr->MergePrint( *this, aOpts, *pProgress ); -#else - bStartJob = pMgr->MergePrint( *this, aOpts, *pProgress ); -#endif } else { @@ -627,144 +623,3 @@ void SetAppPrintOptions( ViewShell* pSh, BOOL bWeb ) } -/*-------------------------------------------------------------------- - -$Log: not supported by cvs2svn $ -Revision 1.1.1.1 2000/09/18 17:14:49 hr -initial import - -Revision 1.143 2000/09/18 16:06:14 willem.vandorp -OpenOffice header added. - -Revision 1.142 2000/09/07 15:59:33 os -change: SFX_DISPATCHER/SFX_BINDINGS removed - -Revision 1.141 2000/09/07 08:24:35 os -FaxName now in SwPrintOptions - -Revision 1.140 2000/08/10 07:36:58 os -#77466# CreateFromInt32 - -Revision 1.139 2000/07/18 12:50:09 os -replace ofadbmgr - -Revision 1.138 2000/07/10 07:02:56 os -replace ofadbmgr - -Revision 1.137 2000/07/07 15:25:44 os -replace ofadbmgr - -Revision 1.136 2000/05/26 07:21:35 os -old SW Basic API Slots removed - -Revision 1.135 2000/03/03 15:17:04 os -StarView remainders removed - -Revision 1.134 2000/02/11 14:59:27 hr -#70473# changes for unicode ( patched by automated patchtool ) - -Revision 1.133 2000/02/01 14:11:31 os -#72527# print selection query box - -Revision 1.132 1999/12/14 14:32:05 jp -Bug #69595#: print can create single Jobs - -Revision 1.131 1999/11/11 15:09:57 hr -#65293#: STLPORT 3.2.1 - -Revision 1.130 1999/09/10 08:35:03 os -restore ViewOption after printing - -Revision 1.129 1999/09/09 07:13:27 os -Query changed: printing documents with field commands - -Revision 1.128 1999/08/11 14:12:24 JP -Bug #68171#: DoPrint - donst change selektionflag if not execute the Sel.Dlg - - - Rev 1.127 11 Aug 1999 16:12:24 JP - Bug #68171#: DoPrint - donst change selektionflag if not execute the Sel.Dlg - - Rev 1.126 09 Jul 1999 13:54:30 JP - Bug #67535#: DoPrint - PrintSelection Dialog before any action started - - Rev 1.125 01 Mar 1999 16:22:16 MA - #62490# Altlast entfernt (Drucken und Briefumschlaege/Etiketten und Datenbank) - - Rev 1.124 04 Feb 1999 11:22:16 ER - #61415# OfaMiscCfg nach SFX verschoben - - Rev 1.123 13 Jan 1999 11:53:12 JP - Bug #60794#: Fehlererkennung beim Tabellenrechnen - - Rev 1.122 29 Oct 1998 11:52:44 OM - #58593# Selektion nur anbieten, wenn auch vorhanden - - Rev 1.121 19 Oct 1998 11:34:48 OM - #58017# Falschen Hilfetext entfernt - - Rev 1.120 29 Sep 1998 16:58:30 OM - #57214# Fokus von Controls nicht als Selektion interpretieren - - Rev 1.119 08 Sep 1998 09:59:24 MI - #55602# DocInfo vor Ausdruck setzen und ggf. hinterher resetten (ErrorCode bei Abort) - - Rev 1.118 31 Aug 1998 17:48:56 OM - #55613# Selektion drucken - - Rev 1.117 25 Aug 1998 08:25:28 OS - SfxPrintProgress ermittelt den aktuellen Drucker der ViewShell -> fuer Fax spaeter erzeugen #55210# - - Rev 1.116 13 Jul 1998 14:42:30 TJ - include - - Rev 1.115 13 Jul 1998 08:48:42 OS - Dialog-Parent richtig setzen #51814# - - Rev 1.114 07 Jul 1998 14:25:54 AMA - Chg: DoPrint uebernimmt das Drucken - - Rev 1.113 03 Jul 1998 15:04:32 AMA - Chg: DoPrint uebernimmt das Drucken - - Rev 1.112 24 Jun 1998 16:17:42 OM - #51575# Printoptionen auch in Seitenvorschau beachten - - Rev 1.111 21 Nov 1997 15:00:26 MA - includes - - Rev 1.110 02 Oct 1997 16:29:14 TJ - include - - Rev 1.109 30 Sep 1997 16:57:50 TJ - include - - Rev 1.108 03 Sep 1997 15:55:34 OS - DLL-Umbau - - Rev 1.107 02 Sep 1997 09:56:28 OM - SDB-Headeranpassung - - Rev 1.106 08 Aug 1997 17:26:22 OM - Headerfile-Umstellung - - Rev 1.105 21 Jul 1997 17:16:20 AMA - Fix #38434#: Das FontListen-Update wird jetzt von SetPrt angestossen - - Rev 1.104 11 Jul 1997 14:47:00 OM - #41525# Nur durch SQL-Statement eingeschraenkte Datensaetze verwenden - - Rev 1.103 08 Jul 1997 14:06:12 OS - ConfigItems von der App ans Module - - Rev 1.102 13 Jun 1997 12:11:30 MA - #40665# sid_broiwse ist an der DocShell - - Rev 1.101 11 Jun 1997 09:18:22 OS - FN_CONFIG_DLG ->SID_SW_EDITOPTIONS fuer Fax #40584# - - Rev 1.100 09 Jun 1997 14:27:58 MA - chg: Browse-Flag nur noch am Doc - -*/ - |