diff options
author | Oliver Specht <os@openoffice.org> | 2000-11-13 10:41:26 +0000 |
---|---|---|
committer | Oliver Specht <os@openoffice.org> | 2000-11-13 10:41:26 +0000 |
commit | e1f02829a365c86e711bdc8141c8308e60bcfd45 (patch) | |
tree | 35c22729f5984e028268122079de07232123ffba /extensions/source/bibliography | |
parent | e912fd4cd36f092b672c5026b74150e1c358e379 (diff) |
using Configuration service
Diffstat (limited to 'extensions/source/bibliography')
-rw-r--r-- | extensions/source/bibliography/bibbeam.cxx | 5 | ||||
-rw-r--r-- | extensions/source/bibliography/bibconfig.cxx | 412 | ||||
-rw-r--r-- | extensions/source/bibliography/bibconfig.hxx | 150 | ||||
-rw-r--r-- | extensions/source/bibliography/bibcont.cxx | 5 | ||||
-rw-r--r-- | extensions/source/bibliography/bibload.cxx | 39 | ||||
-rw-r--r-- | extensions/source/bibliography/bibmod.cxx | 117 | ||||
-rw-r--r-- | extensions/source/bibliography/bibmod.hxx | 15 | ||||
-rw-r--r-- | extensions/source/bibliography/datman.cxx | 295 | ||||
-rw-r--r-- | extensions/source/bibliography/datman.hxx | 68 | ||||
-rw-r--r-- | extensions/source/bibliography/general.cxx | 103 | ||||
-rw-r--r-- | extensions/source/bibliography/general.hxx | 6 | ||||
-rw-r--r-- | extensions/source/bibliography/toolbar.cxx | 7 |
12 files changed, 725 insertions, 497 deletions
diff --git a/extensions/source/bibliography/bibbeam.cxx b/extensions/source/bibliography/bibbeam.cxx index 7848eab220b1..9c0eb329a5e4 100644 --- a/extensions/source/bibliography/bibbeam.cxx +++ b/extensions/source/bibliography/bibbeam.cxx @@ -2,9 +2,9 @@ * * $RCSfile: bibbeam.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:16:44 $ + * last change: $Author: os $ $Date: 2000-11-13 11:41:26 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -84,7 +84,6 @@ #endif #include <svtools/iniprop.hxx> -#include <svtools/iniman.hxx> #include <extensio.hrc> #ifndef _SV_LSTBOX_HXX //autogen wg. form::component::ListBox diff --git a/extensions/source/bibliography/bibconfig.cxx b/extensions/source/bibliography/bibconfig.cxx new file mode 100644 index 000000000000..0d021477c6e7 --- /dev/null +++ b/extensions/source/bibliography/bibconfig.cxx @@ -0,0 +1,412 @@ +/************************************************************************* + * + * $RCSfile: bibconfig.cxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: os $ $Date: 2000-11-13 11:36:54 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include <bibconfig.hxx> +#ifndef _SVARRAY_HXX +#include <svtools/svarray.hxx> +#endif + +#ifndef _TOOLS_DEBUG_HXX +#include <tools/debug.hxx> +#endif +#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_ +#include <com/sun/star/uno/Sequence.hxx> +#endif +#ifndef _COM_SUN_STAR_UNO_ANY_HXX_ +#include <com/sun/star/uno/Any.hxx> +#endif + +using namespace rtl; +using namespace ::com::sun::star::uno; +/* -----------------11.11.99 14:34------------------- + + --------------------------------------------------*/ +typedef Mapping* MappingPtr; +SV_DECL_PTRARR_DEL(MappingArray, MappingPtr, 2, 2); +SV_IMPL_PTRARR(MappingArray, MappingPtr); + +#define C2U(cChar) OUString::createFromAscii(cChar) +/* -----------------------------13.11.00 12:21-------------------------------- + + ---------------------------------------------------------------------------*/ +Sequence<OUString>& BibConfig::GetPropertyNames() +{ + static Sequence<OUString> aNames; + if(!aNames.getLength()) + { + aNames.realloc(3); + OUString* pNames = aNames.getArray(); + pNames[0] = C2U("CurrentDataSource/DataSourceName"); + pNames[1] = C2U("CurrentDataSource/Command"); + pNames[2] = C2U("CurrentDataSource/CommandType"); + } + return aNames; +} +/* -----------------------------13.11.00 11:00-------------------------------- + + ---------------------------------------------------------------------------*/ +BibConfig::BibConfig() : + ConfigItem(C2U("Office.DataAccess/Bibliography")), + pMappingsArr(new MappingArray) +{ + //Names of the default columns + aColumnDefaults[0] = C2U("Identifier"); + aColumnDefaults[1] = C2U("BibliographyType"); + aColumnDefaults[2] = C2U("Author"); + aColumnDefaults[3] = C2U("Title"); + aColumnDefaults[4] = C2U("Year"); + aColumnDefaults[5] = C2U("ISBN"); + aColumnDefaults[6] = C2U("Booktitle"); + aColumnDefaults[7] = C2U("Chapter"); + aColumnDefaults[8] = C2U("Edition"); + aColumnDefaults[9] = C2U("Editor"); + aColumnDefaults[10] = C2U("Howpublished"); + aColumnDefaults[11] = C2U("Institution"); + aColumnDefaults[12] = C2U("Journal"); + aColumnDefaults[13] = C2U("Month"); + aColumnDefaults[14] = C2U("Note"); + aColumnDefaults[15] = C2U("Annote"); + aColumnDefaults[16] = C2U("Number"); + aColumnDefaults[17] = C2U("Organizations"); + aColumnDefaults[18] = C2U("Pages"); + aColumnDefaults[19] = C2U("Publisher"); + aColumnDefaults[20] = C2U("Address"); + aColumnDefaults[21] = C2U("School"); + aColumnDefaults[22] = C2U("Series"); + aColumnDefaults[23] = C2U("ReportType"); + aColumnDefaults[24] = C2U("Volume"); + aColumnDefaults[25] = C2U("URL"); + aColumnDefaults[26] = C2U("Custom1"); + aColumnDefaults[27] = C2U("Custom2"); + aColumnDefaults[28] = C2U("Custom3"); + aColumnDefaults[29] = C2U("Custom4"); + aColumnDefaults[30] = C2U("Custom5"); + + + Sequence<OUString>& aNames = GetPropertyNames(); + Sequence<Any> aValues = GetProperties(aNames); + const Any* pValues = aValues.getConstArray(); + if(aValues.getLength() == aNames.getLength()) + { + for(int nProp = 0; nProp < aNames.getLength(); nProp++) + { + if(pValues[nProp].hasValue()) + { + switch(nProp) + { + case 0: pValues[nProp] >>= sDataSource; break; + case 1: pValues[nProp] >>= sTableOrQuery; break; + case 2: pValues[nProp] >>= nTblOrQuery; break; + } + } + } + } + +} +/* -----------------------------13.11.00 11:00-------------------------------- + + ---------------------------------------------------------------------------*/ +BibConfig::~BibConfig() +{ + if(IsModified()) + Commit(); + delete pMappingsArr; +} +/* -----------------------------13.11.00 12:08-------------------------------- + + ---------------------------------------------------------------------------*/ +BibDBDescriptor BibConfig::GetBibliographyURL() +{ + BibDBDescriptor aRet; + aRet.sDataSource = sDataSource; + aRet.sTableOrQuery = sTableOrQuery; + aRet.nCommandType = nTblOrQuery; + return aRet; +}; +/* -----------------------------13.11.00 12:20-------------------------------- + + ---------------------------------------------------------------------------*/ +void BibConfig::SetBibliographyURL(const BibDBDescriptor& rDesc) +{ + sDataSource = rDesc.sDataSource; + sTableOrQuery = rDesc.sTableOrQuery; + nTblOrQuery = rDesc.nCommandType; + SetModified(); +}; +/* -----------------------------13.11.00 12:20-------------------------------- + + ---------------------------------------------------------------------------*/ +void BibConfig::Commit() +{ + Sequence<OUString>& aNames = GetPropertyNames(); + Sequence<Any> aValues(aNames.getLength()); + Any* pValues = aValues.getArray(); + + const Type& rType = ::getBooleanCppuType(); + for(int nProp = 0; nProp < aNames.getLength(); nProp++) + { + switch(nProp) + { + case 0: pValues[nProp] <<= sDataSource; break; + case 1: pValues[nProp] <<= sTableOrQuery; break; + case 2: pValues[nProp] <<= nTblOrQuery; break; + } + } + PutProperties(aNames, aValues); +} +/* -----------------------------13.11.00 12:23-------------------------------- + + ---------------------------------------------------------------------------*/ +const Mapping* BibConfig::GetMapping(const BibDBDescriptor& rDesc) const +{ + for(sal_uInt16 i = 0; i < pMappingsArr->Count(); i++) + { + const Mapping* pMapping = pMappingsArr->GetObject(i); + sal_Bool bURLEqual = rDesc.sDataSource.equals(pMapping->sURL); + if(rDesc.sTableOrQuery == pMapping->sTableName && bURLEqual) + return pMapping; + } + return 0; +} +/* -----------------------------13.11.00 12:23-------------------------------- + + ---------------------------------------------------------------------------*/ +void BibConfig::SetMapping(const BibDBDescriptor& rDesc, const Mapping* pSetMapping) +{ +} +/* + + SfxAppIniManagerProperty aProp; + GetpApp()->Property( aProp ); + + SfxIniManager* pIniMan = aProp.GetIniManager(); + if(pIniMan) + { + String sBibMapping; + sal_uInt16 nIdx = USHRT_MAX; + String sEntry; + do + { + String sKey(C2S(BIBLIOGRAPHY_INI_DB_ENTRY)); + String sMapKey = C2S(BIBLIOGRAPHY_INI_MAPPING); + if(USHRT_MAX != nIdx) + { + sKey += nIdx; + sMapKey += nIdx; + } + + sEntry = pIniMan->ReadKey( C2S(BIBLIOGRAPHY_INI_GROUP), + sKey ); + String sURL = sEntry.GetToken(0, ';'); + sURL = pIniMan->SubstPathVars( sURL ); + + sURL = URIHelper::SmartRelToAbs(sURL); + + + String sTableName = sEntry.GetToken(1, ';'); + + sBibMapping = pIniMan->ReadKey( C2S(BIBLIOGRAPHY_INI_GROUP), + sMapKey ); + if(sTableName.Len()) + { + Mapping* pNew = new Mapping; + pNew->sTableName = sTableName; + pNew->sURL = sURL; + sal_uInt16 nMapTokens = sBibMapping.GetTokenCount(MAP_TOKEN); + for(sal_uInt16 i = 0; i < nMapTokens && i < COLUMN_COUNT; i++) + { + String sPair = sBibMapping.GetToken(i, MAP_TOKEN); + pNew->aColumnPairs[i].sLogicalColumnName = sPair.GetToken(0, PAIR_TOKEN); + pNew->aColumnPairs[i].sRealColumnName = sPair.GetToken(1, PAIR_TOKEN); + } + pMappingsArr->Insert(pNew, pMappingsArr->Count()); + } + nIdx = USHRT_MAX == nIdx ? 0 : nIdx + 1; + } + while(sEntry.Len()); + } + + +// -----------------12.11.99 14:26------------------- + +// -------------------------------------------------- +const Mapping* BibDataManager::GetMapping(const rtl::OUString& rTableName, const rtl::OUString& sDataSourceURL) const +{ + String sTable(rTableName); + String sURL(sDataSourceURL); + for(sal_uInt16 i = 0; i < pMappingsArr->Count(); i++) + { + sal_Bool bCaseSensitive = sal_True; + INetURLObject aTempURL(sURL); + if(INET_PROT_FILE == aTempURL.GetProtocol()) + { + sal_Bool bCaseSensitive = lcl_IsCaseSensitive(aTempURL.GetMainURL()); +// DirEntry aEnt(aTempURL.GetPath()); +// bCaseSensitive = aEnt.IsCaseSensitive(); + } + + const Mapping* pMapping = pMappingsArr->GetObject(i); + sal_Bool bURLEqual = bCaseSensitive ? + sURL.Equals(pMapping->sURL) : + sURL.EqualsIgnoreCaseAscii(pMapping->sURL); + + if(sTable == pMapping->sTableName && bURLEqual) + return pMapping; + } + return 0; +} +// -----------------12.11.99 14:26------------------- + +//-------------------------------------------------- +void BibDataManager::SetMapping(const rtl::OUString& rTableName, const Mapping* pSetMapping) +{ + ResetIdentifierMapping(); + String sTable(rTableName); + const String sURL(aDataSourceURL); + for(sal_uInt16 i = 0; i < pMappingsArr->Count(); i++) + { + const Mapping* pMapping = pMappingsArr->GetObject(i); + + sal_Bool bCaseSensitive = sal_True; + INetURLObject aTempURL(sURL); + if(INET_PROT_FILE == aTempURL.GetProtocol()) + { + sal_Bool bCaseSensitive = lcl_IsCaseSensitive(aTempURL.GetMainURL()); +// DirEntry aEnt(aTempURL.GetPath()); +// bCaseSensitive = aEnt.IsCaseSensitive(); + } + + sal_Bool bURLEqual = bCaseSensitive ? + sURL.Equals(pMapping->sURL) : + sURL.EqualsIgnoreCaseAscii(pMapping->sURL); + + if(sTable == pMapping->sTableName && bURLEqual) + { + pMappingsArr->DeleteAndDestroy(i, 1); + break; + } + } + Mapping* pNew = new Mapping(*pSetMapping); + pMappingsArr->Insert(pNew, pMappingsArr->Count()); + + SfxAppIniManagerProperty aProp; + GetpApp()->Property( aProp ); + SfxIniManager* pIniMan = aProp.GetIniManager(); + if(pIniMan) + { + //kill all old entries an rewrite all mappings + String sTempEntry; + sal_uInt16 nIdx = USHRT_MAX; + do + { + String sDBKey(C2S(BIBLIOGRAPHY_INI_DB_ENTRY)); + String sMapKey = C2S(BIBLIOGRAPHY_INI_MAPPING); + if(USHRT_MAX != nIdx) + { + sDBKey += nIdx; + sMapKey += nIdx; + } + sTempEntry = pIniMan->ReadKey( C2S(BIBLIOGRAPHY_INI_GROUP), + sDBKey ); + pIniMan->DeleteKey( C2S(BIBLIOGRAPHY_INI_GROUP), sDBKey); + pIniMan->DeleteKey( C2S(BIBLIOGRAPHY_INI_GROUP), sMapKey); + nIdx = USHRT_MAX == nIdx ? 0 : nIdx +1; + }while(sTempEntry.Len()); + + nIdx = USHRT_MAX; + for(sal_uInt16 i = 0; i < pMappingsArr->Count(); i++) + { + const Mapping* pMapping = pMappingsArr->GetObject(i); + + String sDataTableEntry(pMapping->sURL); + sDataTableEntry = pIniMan->UsePathVars( sDataTableEntry ); + sDataTableEntry += ';'; + sDataTableEntry += pMapping->sTableName; + + String sDBKey = C2S(BIBLIOGRAPHY_INI_DB_ENTRY); + String sMapKey = C2S(BIBLIOGRAPHY_INI_MAPPING); + if(USHRT_MAX != nIdx) + { + sDBKey += nIdx; + sMapKey += nIdx; + } + pIniMan->WriteKey( C2S(BIBLIOGRAPHY_INI_GROUP), sDBKey, sDataTableEntry ); + + String sEntry; + for(sal_uInt16 nColumn = 0; nColumn < COLUMN_COUNT; nColumn++) + { + if(!pMapping->aColumnPairs[nColumn].sLogicalColumnName.Len() || + !pMapping->aColumnPairs[nColumn].sRealColumnName.Len()) + break; + sEntry += pMapping->aColumnPairs[nColumn].sLogicalColumnName; + sEntry += PAIR_TOKEN; + sEntry += pMapping->aColumnPairs[nColumn].sRealColumnName; + sEntry += MAP_TOKEN; + } + pIniMan->WriteKey( C2S(BIBLIOGRAPHY_INI_GROUP), sMapKey, sEntry ); + + nIdx = USHRT_MAX == nIdx ? 0 : nIdx +1; + } + pIniMan->Flush(); + } +} + +*/ diff --git a/extensions/source/bibliography/bibconfig.hxx b/extensions/source/bibliography/bibconfig.hxx new file mode 100644 index 000000000000..4c213314bcda --- /dev/null +++ b/extensions/source/bibliography/bibconfig.hxx @@ -0,0 +1,150 @@ +/************************************************************************* + * + * $RCSfile: bibconfig.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: os $ $Date: 2000-11-13 11:38:26 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _BIBCONFIG_HXX +#define _BIBCONFIG_HXX + +#ifndef _UTL_CONFIGITEM_HXX_ +#include <unotools/configitem.hxx> +#endif +class MappingArray; + +//----------------------------------------------------------------------------- +#define COLUMN_COUNT 31 +#define IDENTIFIER_POS 0 +#define AUTHORITYTYPE_POS 1 +#define AUTHOR_POS 2 +#define TITLE_POS 3 +#define YEAR_POS 4 +#define ISBN_POS 5 +#define BOOKTITLE_POS 6 +#define CHAPTER_POS 7 +#define EDITION_POS 8 +#define EDITOR_POS 9 +#define HOWPUBLISHED_POS 10 +#define INSTITUTION_POS 11 +#define JOURNAL_POS 12 +#define MONTH_POS 13 +#define NOTE_POS 14 +#define ANNOTE_POS 15 +#define NUMBER_POS 16 +#define ORGANIZATIONS_POS 17 +#define PAGES_POS 18 +#define PUBLISHER_POS 19 +#define ADDRESS_POS 20 +#define SCHOOL_POS 21 +#define SERIES_POS 22 +#define REPORTTYPE_POS 23 +#define VOLUME_POS 24 +#define URL_POS 25 +#define CUSTOM1_POS 26 +#define CUSTOM2_POS 27 +#define CUSTOM3_POS 28 +#define CUSTOM4_POS 29 +#define CUSTOM5_POS 30 +//----------------------------------------------------------------------------- +struct StringPair +{ + rtl::OUString sRealColumnName; + rtl::OUString sLogicalColumnName; +}; +//----------------------------------------------------------------------------- +struct Mapping +{ + rtl::OUString sTableName; + rtl::OUString sURL; + StringPair aColumnPairs[COLUMN_COUNT]; +}; +//----------------------------------------------------------------------------- +struct BibDBDescriptor +{ + rtl::OUString sDataSource; + rtl::OUString sTableOrQuery; + sal_Int32 nCommandType; +}; +//----------------------------------------------------------------------------- + +class BibConfig : public utl::ConfigItem +{ + rtl::OUString sDataSource; + rtl::OUString sTableOrQuery; + sal_Int32 nTblOrQuery; + + MappingArray* pMappingsArr; + rtl::OUString aColumnDefaults[COLUMN_COUNT]; + + com::sun::star::uno::Sequence<rtl::OUString>& GetPropertyNames(); +public: + BibConfig(); + ~BibConfig(); + + virtual void Commit(); + + BibDBDescriptor GetBibliographyURL(); + void SetBibliographyURL(const BibDBDescriptor& rDesc); + + const Mapping* GetMapping(const BibDBDescriptor& rDesc) const; + void SetMapping(const BibDBDescriptor& rDesc, const Mapping* pMapping); + + const rtl::OUString& GetDefColumnName(sal_uInt16 nIndex) const + {return aColumnDefaults[nIndex];} +}; +#endif diff --git a/extensions/source/bibliography/bibcont.cxx b/extensions/source/bibliography/bibcont.cxx index 49dca576f05b..fab25b8343a8 100644 --- a/extensions/source/bibliography/bibcont.cxx +++ b/extensions/source/bibliography/bibcont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: bibcont.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:16:44 $ + * last change: $Author: os $ $Date: 2000-11-13 11:41:26 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -84,7 +84,6 @@ #include <svtools/iniprop.hxx> -#include <svtools/iniman.hxx> #include "datman.hxx" #include "bibcont.hxx" diff --git a/extensions/source/bibliography/bibload.cxx b/extensions/source/bibliography/bibload.cxx index d5f246c97bc9..64c9d48b96ef 100644 --- a/extensions/source/bibliography/bibload.cxx +++ b/extensions/source/bibliography/bibload.cxx @@ -2,9 +2,9 @@ * * $RCSfile: bibload.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:16:44 $ + * last change: $Author: os $ $Date: 2000-11-13 11:41:26 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -144,9 +144,6 @@ #ifndef _SFXINIPROP_HXX #include <svtools/iniprop.hxx> #endif -#ifndef _SFXINIMGR_HXX -#include <svtools/iniman.hxx> -#endif #ifndef _SVEDIT_HXX #include <svtools/svmedit.hxx> #endif @@ -160,7 +157,7 @@ #ifndef ADRBEAM_HXX #include "bibbeam.hxx" #endif -#ifndef ADDRMOD_HXX +#ifndef BIBMOD_HXX #include "bibmod.hxx" #endif #ifndef _BIB_VIEW_HXX @@ -172,6 +169,9 @@ #ifndef _BIB_DATMAN_HXX #include "datman.hxx" #endif +#ifndef _BIBCONFIG_HXX +#include <bibconfig.hxx> +#endif #ifndef _CPPUHELPER_IMPLBASE4_HXX_ #include <cppuhelper/implbase4.hxx> // helper for implementations @@ -410,10 +410,9 @@ void BibliographyLoader::loadView(const Reference< frame::XFrame > & rFrame, con BibDataManager* pDatMan=(*pBibMod)->createDataManager(); xDatMan = pDatMan; - String sTableName; - rtl::OUString aBibUrl=BibModul::GetBibliographyURL(&sTableName); + BibDBDescriptor aBibDesc = BibModul::GetConfig()->GetBibliographyURL(); - Reference< form::XForm > xForm = pDatMan->createDatabaseForm(aBibUrl, OUString(sTableName)); + Reference< form::XForm > xForm = pDatMan->createDatabaseForm(aBibDesc); if(xForm.is()) { @@ -504,14 +503,13 @@ Reference< container::XNameAccess > BibliographyLoader::GetDataColumns() const Reference< XPropertySet > xResultSetProps(xRowSet, UNO_QUERY); DBG_ASSERT(xResultSetProps.is() , "BibliographyLoader::GetDataCursor : invalid row set (no XResultSet or no XPropertySet) !"); - String sTableName; - rtl::OUString aBibUrl = BibModul::GetBibliographyURL(&sTableName); + BibDBDescriptor aBibDesc = BibModul::GetConfig()->GetBibliographyURL(); - Any aBibUrlAny; aBibUrlAny <<= aBibUrl; + Any aBibUrlAny; aBibUrlAny <<= aBibDesc.sDataSource; xResultSetProps->setPropertyValue(C2U("DataSourceName"), aBibUrlAny); - Any aCommandType; aCommandType <<= (sal_Int32)(CommandType::TABLE); + Any aCommandType; aCommandType <<= aBibDesc.nCommandType; xResultSetProps->setPropertyValue(C2U("CommandType"), aCommandType); - Any aTableName; aTableName <<= OUString(sTableName); + Any aTableName; aTableName <<= aBibDesc.sTableOrQuery; xResultSetProps->setPropertyValue(C2U("Command"), aTableName); Any aResultSetType; aResultSetType <<= (sal_Int32)(ResultSetType::SCROLL_INSENSITIVE); xResultSetProps->setPropertyValue(C2U("ResultSetType"), aResultSetType); @@ -598,7 +596,7 @@ rtl::OUString lcl_AddProperty(Reference< container::XNameAccess > xColumns, { for(sal_uInt16 nEntry = 0; nEntry < COLUMN_COUNT; nEntry++) { - if(pMapping->aColumnPairs[nEntry].sLogicalColumnName == rColumnName) + if(pMapping->aColumnPairs[nEntry].sLogicalColumnName == OUString(rColumnName)) { sColumnName = pMapping->aColumnPairs[nEntry].sRealColumnName; break; @@ -645,12 +643,12 @@ Any BibliographyLoader::getByName(const rtl::OUString& rName) throw { Sequence<PropertyValue> aPropSequ(COLUMN_COUNT); PropertyValue* pValues = aPropSequ.getArray(); - String sTableName; - rtl::OUString aBibUrl = BibModul::GetBibliographyURL(&sTableName); - const Mapping* pMapping = pDatMan->GetMapping(sTableName, &aBibUrl); + BibConfig* pConfig = BibModul::GetConfig(); + BibDBDescriptor aBibDesc = BibModul::GetConfig()->GetBibliographyURL(); + const Mapping* pMapping = pConfig->GetMapping(aBibDesc); for(sal_uInt16 nEntry = 0; nEntry < COLUMN_COUNT; nEntry++) { - const String sColName = pDatMan->GetDefColumnName( + const String sColName = pConfig->GetDefColumnName( nEntry); pValues[nEntry].Name = sColName; pValues[nEntry].Value <<= lcl_AddProperty(xColumns, pMapping, sColName); @@ -829,9 +827,10 @@ Any BibliographyLoader::getPropertyValue(const rtl::OUString& rPropertyName) Sequence<PropertyValue> aSeq(COLUMN_COUNT); PropertyValue* pArray = aSeq.getArray(); BibDataManager* pDatMan = GetDataManager(); + BibConfig* pConfig = BibModul::GetConfig(); for(sal_uInt16 i = 0; i <= text::BibliographyDataField::ISBN ; i++) { - pArray[i].Name = pDatMan->GetDefColumnName(aInternalMapping[i]); + pArray[i].Name = pConfig->GetDefColumnName(aInternalMapping[i]); pArray[i].Value <<= (sal_Int16) i; } aRet.setValue(&aSeq, ::getCppuType((Sequence<PropertyValue>*)0)); diff --git a/extensions/source/bibliography/bibmod.cxx b/extensions/source/bibliography/bibmod.cxx index 97cf120a2cd2..d9294ffa0223 100644 --- a/extensions/source/bibliography/bibmod.cxx +++ b/extensions/source/bibliography/bibmod.cxx @@ -2,9 +2,9 @@ * * $RCSfile: bibmod.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:16:44 $ + * last change: $Author: os $ $Date: 2000-11-13 11:41:26 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -61,8 +61,6 @@ #include <tools/resmgr.hxx> -#include <svtools/iniprop.hxx> -#include <svtools/iniman.hxx> #ifndef _URLOBJ_HXX #include <tools/urlobj.hxx> #endif @@ -91,6 +89,7 @@ #include "bibresid.hxx" #include "registry.hxx" #include "datman.hxx" +#include "bibconfig.hxx" static PtrBibModul pBibModul=NULL; static nBibModulCount=0; @@ -128,16 +127,11 @@ void CloseBibModul(HdlBibModul ppBibModul) } } -/*PtrBibModul GetBibModul() -{ - return pBibModul; -} */ - BibResId::BibResId( sal_uInt16 nId ) : ResId( nId, pBibModul->GetResMgr() ) { } - +BibConfig* BibModul::pBibConfig = 0; BibModul::BibModul() { pResMgr = ResMgr::CreateResMgr( "bib" MAKE_NUMSTR(SUPD) ); @@ -148,6 +142,7 @@ BibModul::BibModul() BibModul::~BibModul() { delete pResMgr; + delete pBibConfig; xRegistry = 0; //delete pRegistry; } @@ -157,107 +152,13 @@ BibDataManager* BibModul::createDataManager() return new BibDataManager(pRegistry); } //----------------------------------------------------------------------------- -String BibModul::GetBibliographyURL(String* pTableName) +BibConfig* BibModul::GetConfig() { - String aURL; - SfxAppIniManagerProperty aProp; - GetpApp()->Property( aProp ); - SfxIniManager* pIniMan = aProp.GetIniManager(); - if( !pIniMan ) - return String(); - - String aBib = pIniMan->Get( C2S(BIBLIOGRAPHY_INI_GROUP), - sal_False, sal_False, - C2S(BIBLIOGRAPHY_INI_CUR_NAME)); - sal_Bool bCorrect = sal_False; - if(aBib.Len()) - { - aURL = aBib.GetToken( 0, ';' ); - aURL = pIniMan->SubstPathVars( aURL ); - aURL = URIHelper::SmartRelToAbs(aURL); - - INetURLObject aTmpURL(aURL); - BOOL bExist = FALSE; - if(aTmpURL.GetProtocol() == INET_PROT_FILE) - try - { - bExist = ::ucb::Content( - aTmpURL.GetMainURL(), uno::Reference< XCommandEnvironment >()).isDocument(); - } - catch(...){} - - if(bExist) - { - bCorrect = sal_True; - if(pTableName) - *pTableName = aBib.GetToken( 1, ';' ); - } - } - if(!bCorrect) - { - //if there's no entry defined take the first *.sdb from the database favorites - try - { - uno::Reference< lang::XMultiServiceFactory > xMgr = utl::getProcessServiceFactory(); - uno::Reference< container::XNameAccess > xDatabaseContext(xMgr->createInstance( - C2U("com.sun.star.sdb.DatabaseAccessContext") ), UNO_QUERY ); -// uno::Sequence<rtl::OUString> aFavorites; -// if (xDatabaseContext.is()) -// aFavorites = xDatabaseContext->getElementNames(); -// if (aFavorites.getLength()) -// aURL = INetURLObject::SmartRelToAbs(U2S(aFavorites.getConstArray()[0])); - Reference<XLocalizedAliases> xAlias(xDatabaseContext, UNO_QUERY); - Reference<XLocalizable> xLocal(xDatabaseContext, UNO_QUERY); - Sequence< AliasProgrammaticPair > aAliasPairs = - xAlias->listAliases(xLocal->getLocale()); - const AliasProgrammaticPair* pPairs = aAliasPairs.getConstArray(); - for(INT32 nFav = 0; nFav < aAliasPairs.getLength(); nFav++) - { - String sURL = pPairs[nFav].ProgrammaticName; - aURL = URIHelper::SmartRelToAbs(sURL); - INetURLObject aTmpURL(aURL); - BOOL bExist = FALSE; - if(aTmpURL.GetProtocol() == INET_PROT_FILE) - try - { - bExist = ::ucb::Content( - aTmpURL.GetMainURL(), uno::Reference< XCommandEnvironment >()).isDocument(); - } - catch(...){} - - if(bExist) - break; - else - aURL.Erase(); - } - - } - catch(...) - { - DBG_ERROR("Exception in BibDataManager::DBChangeDialog_Impl::DBChangeDialog_Impl") - } - - } - return aURL; + if(!pBibConfig) + pBibConfig = new BibConfig; + return pBibConfig; } -//----------------------------------------------------------------------------- -void BibModul::SetBibliographyURL(const String& rURL, const String& rTable) -{ - SfxAppIniManagerProperty aProp; - GetpApp()->Property( aProp ); - SfxIniManager* pIniMan = aProp.GetIniManager(); - if( !pIniMan ) - return; - - String sEntry(rURL); - sEntry = pIniMan->UsePathVars( sEntry ); - sEntry += ';'; - sEntry += rTable; - - pIniMan->WriteKey( C2S(BIBLIOGRAPHY_INI_GROUP), - C2S(BIBLIOGRAPHY_INI_CUR_NAME), sEntry); -} // PropertyNames #define STATIC_USTRING(a,b) rtl::OUString a(b) diff --git a/extensions/source/bibliography/bibmod.hxx b/extensions/source/bibliography/bibmod.hxx index 306ede67bb3b..3db6a2fce9f1 100644 --- a/extensions/source/bibliography/bibmod.hxx +++ b/extensions/source/bibliography/bibmod.hxx @@ -2,9 +2,9 @@ * * $RCSfile: bibmod.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:16:44 $ + * last change: $Author: os $ $Date: 2000-11-13 11:41:26 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -59,8 +59,8 @@ * ************************************************************************/ -#ifndef ADDRMOD_HXX -#define ADDRMOD_HXX +#ifndef BIBMOD_HXX +#define BIBMOD_HXX #ifndef _COM_SUN_STAR_REGISTRY_MERGECONFLICTEXCEPTION_HPP_ @@ -73,6 +73,7 @@ class ResMgr; class BibDataManager; class BibRegistry; +class BibConfig; #define BIBLIOGRAPHY_INI_GROUP "Bibliography" #define BIBLIOGRAPHY_INI_CUR_NAME "BibliographyCurrent" @@ -84,6 +85,8 @@ class BibModul { private: ResMgr* pResMgr; + static BibConfig* pBibConfig; + BibRegistry* pRegistry; ::com::sun::star::uno::Reference< ::com::sun::star::registry::XSimpleRegistry > xRegistry; @@ -92,9 +95,7 @@ class BibModul ~BibModul(); ResMgr* GetResMgr(){return pResMgr;} - - static String GetBibliographyURL(String* pTableName); - static void SetBibliographyURL(const String& rURL, const String& rTable); + static BibConfig* GetConfig(); BibDataManager* createDataManager(); diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx index 662881852b56..098bb42efef8 100644 --- a/extensions/source/bibliography/datman.cxx +++ b/extensions/source/bibliography/datman.cxx @@ -2,9 +2,9 @@ * * $RCSfile: datman.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:16:44 $ + * last change: $Author: os $ $Date: 2000-11-13 11:41:26 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -150,16 +150,12 @@ #include <svtools/urihelper.hxx> #endif #include <svtools/iniprop.hxx> -#include <svtools/iniman.hxx> #ifndef _SVTABBX_HXX #include <svtools/svtabbx.hxx> #endif #ifndef _HEADBAR_HXX #include <svtools/headbar.hxx> #endif -#ifndef _SVARRAY_HXX -#include <svtools/svarray.hxx> -#endif #ifndef _SV_DIALOG_HXX #include <vcl/dialog.hxx> #endif @@ -195,7 +191,7 @@ #ifndef ADRRESID_HXX #include "bibresid.hxx" #endif -#ifndef ADDRMOD_HXX +#ifndef BIBMOD_HXX #include "bibmod.hxx" #endif #ifndef _BIB_VIEW_HXX @@ -210,6 +206,9 @@ #ifndef _BIB_TOOLBAR_HXX #include "toolbar.hxx" #endif +#ifndef _BIBCONFIG_HXX +#include "bibconfig.hxx" +#endif #ifndef ADRBEAM_HXX #include "bibbeam.hxx" #endif @@ -238,12 +237,6 @@ using namespace ::ucb; #define MAP_TOKEN ';' #define PAIR_TOKEN ':' -/* -----------------11.11.99 14:34------------------- - - --------------------------------------------------*/ -typedef Mapping* MappingPtr; -SV_DECL_PTRARR_DEL(MappingArray, MappingPtr, 2, 2); -SV_IMPL_PTRARR(MappingArray, MappingPtr); /* -----------------------------15.06.00 16:12-------------------------------- @@ -513,12 +506,12 @@ public: /* -----------------11.11.99 16:42------------------- --------------------------------------------------*/ -sal_uInt16 lcl_FindLogicalName(BibDataManager* pDatMan, - const String& rLogicalColumnName) +sal_uInt16 lcl_FindLogicalName(BibConfig* pConfig , + const OUString& rLogicalColumnName) { for(sal_uInt16 i = 0; i < COLUMN_COUNT; i++) { - if(rLogicalColumnName == pDatMan->GetDefColumnName(i)) + if(rLogicalColumnName == pConfig->GetDefColumnName(i)) return i; } return USHRT_MAX; @@ -657,13 +650,17 @@ MappingDialog_Impl::MappingDialog_Impl(Window* pParent, BibDataManager* pMan) : aListBoxes[i]->SelectEntryPos(0); aListBoxes[i]->SetSelectHdl(aLnk); } - const Mapping* pMapping = pDatMan->GetMapping(pDatMan->getActiveDataTable()); + BibConfig* pConfig = BibModul::GetConfig(); + BibDBDescriptor aDesc; + aDesc.sDataSource = pDatMan->getActiveDataSource(); + aDesc.sTableOrQuery = pDatMan->getActiveDataTable(); + aDesc.nCommandType = CommandType::TABLE; + const Mapping* pMapping = pConfig->GetMapping(aDesc); if(pMapping) { for(sal_uInt16 nEntry = 0; nEntry < COLUMN_COUNT; nEntry++) { - sal_uInt16 nListBoxIndex = lcl_FindLogicalName(pDatMan, - pMapping->aColumnPairs[nEntry].sLogicalColumnName); + sal_uInt16 nListBoxIndex = lcl_FindLogicalName( pConfig, pMapping->aColumnPairs[nEntry].sLogicalColumnName); if(nListBoxIndex < COLUMN_COUNT) { aListBoxes[nListBoxIndex]->SelectEntry(pMapping->aColumnPairs[nEntry].sRealColumnName); @@ -702,18 +699,22 @@ IMPL_LINK(MappingDialog_Impl, OkHdl, OKButton*, EMPTYARG) aNew.sURL = String(pDatMan->getActiveDataSource()); sal_uInt16 nWriteIndex = 0; + BibConfig* pConfig = BibModul::GetConfig(); for(sal_uInt16 nEntry = 0; nEntry < COLUMN_COUNT; nEntry++) { - String sSel = aListBoxes[nEntry]->GetSelectEntry(); if(sSel != sNone) { aNew.aColumnPairs[nWriteIndex].sRealColumnName = sSel; - aNew.aColumnPairs[nWriteIndex].sLogicalColumnName = pDatMan->GetDefColumnName(nEntry); + aNew.aColumnPairs[nWriteIndex].sLogicalColumnName = pConfig->GetDefColumnName(nEntry); nWriteIndex++; } } - pDatMan->SetMapping(pDatMan->getActiveDataTable(), &aNew); + BibDBDescriptor aDesc; + aDesc.sDataSource = pDatMan->getActiveDataSource(); + aDesc.sTableOrQuery = pDatMan->getActiveDataTable(); + aDesc.nCommandType = CommandType::TABLE; + pConfig->SetMapping(aDesc, &aNew); EndDialog(RET_OK); return 0; } @@ -868,96 +869,14 @@ rtl::OUString gBeamerSize(C2U("theBeamerSize")); rtl::OUString gViewSize(C2U("theViewSize")); BibDataManager::BibDataManager(BibRegistry * pRegistry) : - pMappingsArr(new MappingArray), pToolbar(0), pGridWin(0) { - //Names of the default columns - aColumnDefaults[0] = C2S("Identifier"); - aColumnDefaults[1] = C2S("BibliographyType"); - aColumnDefaults[2] = C2S("Author"); - aColumnDefaults[3] = C2S("Title"); - aColumnDefaults[4] = C2S("Year"); - aColumnDefaults[5] = C2S("ISBN"); - aColumnDefaults[6] = C2S("Booktitle"); - aColumnDefaults[7] = C2S("Chapter"); - aColumnDefaults[8] = C2S("Edition"); - aColumnDefaults[9] = C2S("Editor"); - aColumnDefaults[10] = C2S("Howpublished"); - aColumnDefaults[11] = C2S("Institution"); - aColumnDefaults[12] = C2S("Journal"); - aColumnDefaults[13] = C2S("Month"); - aColumnDefaults[14] = C2S("Note"); - aColumnDefaults[15] = C2S("Annote"); - aColumnDefaults[16] = C2S("Number"); - aColumnDefaults[17] = C2S("Organizations"); - aColumnDefaults[18] = C2S("Pages"); - aColumnDefaults[19] = C2S("Publisher"); - aColumnDefaults[20] = C2S("Address"); - aColumnDefaults[21] = C2S("School"); - aColumnDefaults[22] = C2S("Series"); - aColumnDefaults[23] = C2S("ReportType"); - aColumnDefaults[24] = C2S("Volume"); - aColumnDefaults[25] = C2S("URL"); - aColumnDefaults[26] = C2S("Custom1"); - aColumnDefaults[27] = C2S("Custom2"); - aColumnDefaults[28] = C2S("Custom3"); - aColumnDefaults[29] = C2S("Custom4"); - aColumnDefaults[30] = C2S("Custom5"); // nEditMode = DatabaseRecordMode_STANDARD; xRegistry = pRegistry; xGlobalProps=createGlobalProperties(); - SfxAppIniManagerProperty aProp; - GetpApp()->Property( aProp ); - - SfxIniManager* pIniMan = aProp.GetIniManager(); - if(pIniMan) - { - String sBibMapping; - sal_uInt16 nIdx = USHRT_MAX; - String sEntry; - do - { - String sKey(C2S(BIBLIOGRAPHY_INI_DB_ENTRY)); - String sMapKey = C2S(BIBLIOGRAPHY_INI_MAPPING); - if(USHRT_MAX != nIdx) - { - sKey += nIdx; - sMapKey += nIdx; - } - - sEntry = pIniMan->ReadKey( C2S(BIBLIOGRAPHY_INI_GROUP), - sKey ); - String sURL = sEntry.GetToken(0, ';'); - sURL = pIniMan->SubstPathVars( sURL ); - - sURL = URIHelper::SmartRelToAbs(sURL); - - - String sTableName = sEntry.GetToken(1, ';'); - - sBibMapping = pIniMan->ReadKey( C2S(BIBLIOGRAPHY_INI_GROUP), - sMapKey ); - if(sTableName.Len()) - { - Mapping* pNew = new Mapping; - pNew->sTableName = sTableName; - pNew->sURL = sURL; - sal_uInt16 nMapTokens = sBibMapping.GetTokenCount(MAP_TOKEN); - for(sal_uInt16 i = 0; i < nMapTokens && i < COLUMN_COUNT; i++) - { - String sPair = sBibMapping.GetToken(i, MAP_TOKEN); - pNew->aColumnPairs[i].sLogicalColumnName = sPair.GetToken(0, PAIR_TOKEN); - pNew->aColumnPairs[i].sRealColumnName = sPair.GetToken(1, PAIR_TOKEN); - } - pMappingsArr->Insert(pNew, pMappingsArr->Count()); - } - nIdx = USHRT_MAX == nIdx ? 0 : nIdx + 1; - } - while(sEntry.Len()); - } } /* -------------------------------------------------- @@ -975,7 +894,6 @@ BibDataManager::~BibDataManager() xComp->dispose(); xForm = NULL; } - delete pMappingsArr; } //------------------------------------------------------------------------ void BibDataManager::InsertFields(const uno::Reference< XFormComponent > & xGrid) @@ -1071,21 +989,21 @@ uno::Reference< XForm > BibDataManager::getDatabaseForm() /* -------------------------------------------------- --------------------------------------------------*/ -uno::Reference< XForm > BibDataManager::createDatabaseForm(const rtl::OUString& rURL, rtl::OUString& rTable) +uno::Reference< XForm > BibDataManager::createDatabaseForm(BibDBDescriptor& rDesc) { uno::Reference< XForm > xResult; try { - uno::Reference< lang::XMultiServiceFactory > xMgr = utl::getProcessServiceFactory(); + uno::Reference< lang::XMultiServiceFactory > xMgr = utl::getProcessServiceFactory(); xForm = uno::Reference< XForm > (xMgr->createInstance( C2U("com.sun.star.form.component.Form") ), UNO_QUERY ); uno::Reference< XPropertySet > aPropertySet(xForm, UNO_QUERY ); - aDataSourceURL = rURL; + aDataSourceURL = rDesc.sDataSource; if(aPropertySet.is()) { - Any aVal; aVal <<= rURL; + Any aVal; aVal <<= rDesc.sDataSource; aPropertySet->setPropertyValue(C2U("DataSourceName"), aVal); aVal <<= (sal_Int32)sdbc::ResultSetType::SCROLL_INSENSITIVE; aPropertySet->setPropertyValue(C2U("ResultSetType"),aVal ); @@ -1096,7 +1014,7 @@ uno::Reference< XForm > BibDataManager::createDatabaseForm(const rtl::OUString& aVal <<= (sal_Int32)50; aPropertySet->setPropertyValue(C2U("FetchSize"), aVal); - uno::Reference< sdbc::XConnection > xConnection = getConnection(rURL); + uno::Reference< sdbc::XConnection > xConnection = getConnection(rDesc.sDataSource); uno::Reference< sdbcx::XTablesSupplier > xSupplyTables(xConnection, UNO_QUERY); uno::Reference< XNameAccess > xTables = xSupplyTables.is() ? xSupplyTables->getTables() : uno::Reference< XNameAccess > (); @@ -1108,10 +1026,13 @@ uno::Reference< XForm > BibDataManager::createDatabaseForm(const rtl::OUString& if(aTableNameSeq.getLength() > 0) { const rtl::OUString* pTableNames = aTableNameSeq.getConstArray(); - if(rTable.getLength()) - aActiveDataTable = rTable; + if(rDesc.sTableOrQuery.getLength()) + aActiveDataTable = rDesc.sTableOrQuery; else - rTable = aActiveDataTable = pTableNames[0]; + { + rDesc.sTableOrQuery = aActiveDataTable = pTableNames[0]; + rDesc.nCommandType = CommandType::TABLE; + } uno::Reference< registry::XRegistryKey > xRoot = xRegistry->getRootKey(); uno::Reference< registry::XRegistryKey > xKey = xRoot->openKey(aActiveDataTable); @@ -1122,7 +1043,7 @@ uno::Reference< XForm > BibDataManager::createDatabaseForm(const rtl::OUString& aVal <<= aActiveDataTable; aPropertySet->setPropertyValue(C2U("Command"), aVal); - aVal <<= (sal_Int32)CommandType::TABLE; + aVal <<= rDesc.nCommandType; aPropertySet->setPropertyValue(C2U("CommandType"), aVal); @@ -1460,7 +1381,11 @@ void BibDataManager::setActiveDataTable(const rtl::OUString& rTable) setQueryField(getQueryField()); startQueryWith(getQueryString()); - BibModul::SetBibliographyURL(aDataSourceURL, aActiveDataTable); + BibDBDescriptor aDesc; + aDesc.sDataSource = aDataSourceURL; + aDesc.sTableOrQuery = aActiveDataTable; + aDesc.nCommandType = CommandType::TABLE; + BibModul::GetConfig()->SetBibliographyURL(aDesc); } if(pBibView) pBibView->UpdatePages(); @@ -1976,140 +1901,20 @@ rtl::OUString BibDataManager::CreateDBChangeDialog(Window* pParent) delete pDlg; return uRet; } -/* -----------------12.11.99 14:26------------------- - - --------------------------------------------------*/ -const Mapping* BibDataManager::GetMapping(const rtl::OUString& rTableName, const rtl::OUString* pURL) const -{ - String sTable(rTableName); - String sURL(aDataSourceURL); - if(pURL) - sURL = String(*pURL); - for(sal_uInt16 i = 0; i < pMappingsArr->Count(); i++) - { - sal_Bool bCaseSensitive = sal_True; - INetURLObject aTempURL(sURL); - if(INET_PROT_FILE == aTempURL.GetProtocol()) - { - sal_Bool bCaseSensitive = lcl_IsCaseSensitive(aTempURL.GetMainURL()); -// DirEntry aEnt(aTempURL.GetPath()); -// bCaseSensitive = aEnt.IsCaseSensitive(); - } - - const Mapping* pMapping = pMappingsArr->GetObject(i); - sal_Bool bURLEqual = bCaseSensitive ? - sURL.Equals(pMapping->sURL) : - sURL.EqualsIgnoreCaseAscii(pMapping->sURL); - - if(sTable == pMapping->sTableName && bURLEqual) - return pMapping; - } - return 0; -} -/* -----------------12.11.99 14:26------------------- - - --------------------------------------------------*/ -void BibDataManager::SetMapping(const rtl::OUString& rTableName, const Mapping* pSetMapping) -{ - ResetIdentifierMapping(); - String sTable(rTableName); - const String sURL(aDataSourceURL); - for(sal_uInt16 i = 0; i < pMappingsArr->Count(); i++) - { - const Mapping* pMapping = pMappingsArr->GetObject(i); - - sal_Bool bCaseSensitive = sal_True; - INetURLObject aTempURL(sURL); - if(INET_PROT_FILE == aTempURL.GetProtocol()) - { - sal_Bool bCaseSensitive = lcl_IsCaseSensitive(aTempURL.GetMainURL()); -// DirEntry aEnt(aTempURL.GetPath()); -// bCaseSensitive = aEnt.IsCaseSensitive(); - } - - sal_Bool bURLEqual = bCaseSensitive ? - sURL.Equals(pMapping->sURL) : - sURL.EqualsIgnoreCaseAscii(pMapping->sURL); - - if(sTable == pMapping->sTableName && bURLEqual) - { - pMappingsArr->DeleteAndDestroy(i, 1); - break; - } - } - Mapping* pNew = new Mapping(*pSetMapping); - pMappingsArr->Insert(pNew, pMappingsArr->Count()); - - SfxAppIniManagerProperty aProp; - GetpApp()->Property( aProp ); - SfxIniManager* pIniMan = aProp.GetIniManager(); - if(pIniMan) - { - //kill all old entries an rewrite all mappings - String sTempEntry; - sal_uInt16 nIdx = USHRT_MAX; - do - { - String sDBKey(C2S(BIBLIOGRAPHY_INI_DB_ENTRY)); - String sMapKey = C2S(BIBLIOGRAPHY_INI_MAPPING); - if(USHRT_MAX != nIdx) - { - sDBKey += nIdx; - sMapKey += nIdx; - } - sTempEntry = pIniMan->ReadKey( C2S(BIBLIOGRAPHY_INI_GROUP), - sDBKey ); - pIniMan->DeleteKey( C2S(BIBLIOGRAPHY_INI_GROUP), sDBKey); - pIniMan->DeleteKey( C2S(BIBLIOGRAPHY_INI_GROUP), sMapKey); - nIdx = USHRT_MAX == nIdx ? 0 : nIdx +1; - }while(sTempEntry.Len()); - - nIdx = USHRT_MAX; - for(sal_uInt16 i = 0; i < pMappingsArr->Count(); i++) - { - const Mapping* pMapping = pMappingsArr->GetObject(i); - - String sDataTableEntry(pMapping->sURL); - sDataTableEntry = pIniMan->UsePathVars( sDataTableEntry ); - sDataTableEntry += ';'; - sDataTableEntry += pMapping->sTableName; - - String sDBKey = C2S(BIBLIOGRAPHY_INI_DB_ENTRY); - String sMapKey = C2S(BIBLIOGRAPHY_INI_MAPPING); - if(USHRT_MAX != nIdx) - { - sDBKey += nIdx; - sMapKey += nIdx; - } - pIniMan->WriteKey( C2S(BIBLIOGRAPHY_INI_GROUP), sDBKey, sDataTableEntry ); - - String sEntry; - for(sal_uInt16 nColumn = 0; nColumn < COLUMN_COUNT; nColumn++) - { - if(!pMapping->aColumnPairs[nColumn].sLogicalColumnName.Len() || - !pMapping->aColumnPairs[nColumn].sRealColumnName.Len()) - break; - sEntry += pMapping->aColumnPairs[nColumn].sLogicalColumnName; - sEntry += PAIR_TOKEN; - sEntry += pMapping->aColumnPairs[nColumn].sRealColumnName; - sEntry += MAP_TOKEN; - } - pIniMan->WriteKey( C2S(BIBLIOGRAPHY_INI_GROUP), sMapKey, sEntry ); - - nIdx = USHRT_MAX == nIdx ? 0 : nIdx +1; - } - pIniMan->Flush(); - } -} /* -----------------06.12.99 15:11------------------- --------------------------------------------------*/ -const String& BibDataManager::GetIdentifierMapping() +const OUString& BibDataManager::GetIdentifierMapping() { - if(!sIdentifierMapping.Len()) - { - const Mapping* pMapping = GetMapping(getActiveDataTable()); - sIdentifierMapping = GetDefColumnName(IDENTIFIER_POS); + if(!sIdentifierMapping.getLength()) + { + BibConfig* pConfig = BibModul::GetConfig(); + BibDBDescriptor aDesc; + aDesc.sDataSource = getActiveDataSource(); + aDesc.sTableOrQuery = getActiveDataTable(); + aDesc.nCommandType = CommandType::TABLE; + const Mapping* pMapping = pConfig->GetMapping(aDesc); + sIdentifierMapping = pConfig->GetDefColumnName(IDENTIFIER_POS); if(pMapping) { for(sal_uInt16 nEntry = 0; nEntry < COLUMN_COUNT; nEntry++) diff --git a/extensions/source/bibliography/datman.hxx b/extensions/source/bibliography/datman.hxx index 130ebfae7403..c3b4de5added 100644 --- a/extensions/source/bibliography/datman.hxx +++ b/extensions/source/bibliography/datman.hxx @@ -2,9 +2,9 @@ * * $RCSfile: datman.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:16:44 $ + * last change: $Author: os $ $Date: 2000-11-13 11:41:26 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -83,60 +83,13 @@ #endif class BibRegistry; -class MappingArray; class Window; -//----------------------------------------------------------------------------- -#define COLUMN_COUNT 31 -#define IDENTIFIER_POS 0 -#define AUTHORITYTYPE_POS 1 -#define AUTHOR_POS 2 -#define TITLE_POS 3 -#define YEAR_POS 4 -#define ISBN_POS 5 -#define BOOKTITLE_POS 6 -#define CHAPTER_POS 7 -#define EDITION_POS 8 -#define EDITOR_POS 9 -#define HOWPUBLISHED_POS 10 -#define INSTITUTION_POS 11 -#define JOURNAL_POS 12 -#define MONTH_POS 13 -#define NOTE_POS 14 -#define ANNOTE_POS 15 -#define NUMBER_POS 16 -#define ORGANIZATIONS_POS 17 -#define PAGES_POS 18 -#define PUBLISHER_POS 19 -#define ADDRESS_POS 20 -#define SCHOOL_POS 21 -#define SERIES_POS 22 -#define REPORTTYPE_POS 23 -#define VOLUME_POS 24 -#define URL_POS 25 -#define CUSTOM1_POS 26 -#define CUSTOM2_POS 27 -#define CUSTOM3_POS 28 -#define CUSTOM4_POS 29 -#define CUSTOM5_POS 30 //----------------------------------------------------------------------------- -struct StringPair -{ - String sRealColumnName; - String sLogicalColumnName; -}; -//----------------------------------------------------------------------------- -struct Mapping -{ - String sTableName; - String sURL; - StringPair aColumnPairs[COLUMN_COUNT]; -}; -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- class BibView; class BibToolBar; class BibGridwin; +struct BibDBDescriptor; class BibDataManager : public cppu::WeakImplHelper1 < ::com::sun::star::beans::XPropertyChangeListener> { private: @@ -153,14 +106,12 @@ private: // sal_Bool bModified; ::com::sun::star::uno::Any aUID; ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > xBibCursor; - MappingArray* pMappingsArr; BibView* pBibView; BibToolBar* pToolbar; BibGridwin* pGridWin; - String aColumnDefaults[COLUMN_COUNT]; - String sIdentifierMapping; + rtl::OUString sIdentifierMapping; protected: ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createGlobalProperties(); @@ -181,7 +132,7 @@ public: - ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm > createDatabaseForm(const ::rtl::OUString& rURL, ::rtl::OUString& rTableName); + ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm > createDatabaseForm( BibDBDescriptor& aDesc); ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm > getDatabaseForm(); ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > createGridModel(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm > & xDbForm); @@ -234,19 +185,14 @@ public: void CreateMappingDialog(Window* pParent); ::rtl::OUString CreateDBChangeDialog(Window* pParent); - const Mapping* GetMapping(const ::rtl::OUString& rTableName, const ::rtl::OUString* pURL = 0) const; - void SetMapping(const ::rtl::OUString& rTableName, const Mapping* pMapping); - - const String& GetDefColumnName(sal_uInt16 nIndex) const - {return aColumnDefaults[nIndex];} void SetView(BibView* pView) {pBibView = pView;} void SetToolbar(BibToolBar* pSet) {pToolbar = pSet;} void SetGridWin(BibGridwin* pSet) {pGridWin = pSet;} - const String& GetIdentifierMapping(); - void ResetIdentifierMapping() {sIdentifierMapping.Erase();} + const rtl::OUString& GetIdentifierMapping(); + void ResetIdentifierMapping() {sIdentifierMapping = rtl::OUString();} }; diff --git a/extensions/source/bibliography/general.cxx b/extensions/source/bibliography/general.cxx index 9a15129156d9..5d4d10040578 100644 --- a/extensions/source/bibliography/general.cxx +++ b/extensions/source/bibliography/general.cxx @@ -2,9 +2,9 @@ * * $RCSfile: general.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:16:44 $ + * last change: $Author: os $ $Date: 2000-11-13 11:41:26 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -74,6 +74,9 @@ #ifndef _COM_SUN_STAR_SDB_XCOLUMN_HPP_ #include <com/sun/star/sdb/XColumn.hpp> #endif +#ifndef _COM_SUN_STAR_SDB_COMMANDTYPE_HPP_ +#include <com/sun/star/sdb/CommandType.hpp> +#endif #ifndef _COM_SUN_STAR_SDBCX_XCOLUMNSSUPPLIER_HPP_ #include <com/sun/star/sdbcx/XColumnsSupplier.hpp> #endif @@ -100,12 +103,15 @@ #ifndef _BIB_DATMAN_HXX #include "datman.hxx" #endif +#ifndef _BIBCONFIG_HXX +#include "bibconfig.hxx" +#endif #ifndef _BIB_FMPROP_HRC #include "bibprop.hrc" #endif -//#ifndef _TOOLKIT_UNOIFACE_HXX -//#include <toolkit/unoiface.hxx> -//#endif +#ifndef BIBMOD_HXX +#include "bibmod.hxx" +#endif #include <extensio.hrc> #ifndef _TOOLS_DEBUG_HXX #include <tools/debug.hxx> @@ -114,6 +120,7 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::form; +using namespace ::com::sun::star::sdb; using namespace ::rtl; #define C2U(cChar) OUString::createFromAscii(cChar) @@ -128,9 +135,10 @@ Point lcl_MovePoint(const FixedText& rFixedText) } //----------------------------------------------------------------------------- -String lcl_GetColumnName(BibDataManager* pDatMan, const Mapping* pMapping, sal_uInt16 nIndexPos) +OUString lcl_GetColumnName(const Mapping* pMapping, sal_uInt16 nIndexPos) { - String sRet = pDatMan->GetDefColumnName(nIndexPos); + BibConfig* pBibConfig = BibModul::GetConfig(); + OUString sRet = pBibConfig->GetDefColumnName(nIndexPos); if(pMapping) for(sal_uInt16 i = 0; i < COLUMN_COUNT; i++) { @@ -178,9 +186,15 @@ void BibPosListener::cursorMoved(const lang::EventObject& /*aEvent*/) throw( uno uno::Reference< beans::XPropertySet > xPropSet(xLstBox, UNO_QUERY); if(xPropSet.is()) { + BibConfig* pBibConfig = BibModul::GetConfig(); BibDataManager* pDatMan = pParentPage->GetDataManager(); - const Mapping* pMapping = pDatMan->GetMapping(pDatMan->getActiveDataTable()); - String sTypeMapping = pDatMan->GetDefColumnName(AUTHORITYTYPE_POS); + BibDBDescriptor aDesc; + aDesc.sDataSource = pDatMan->getActiveDataSource(); + aDesc.sTableOrQuery = pDatMan->getActiveDataTable(); + aDesc.nCommandType = CommandType::TABLE; + + const Mapping* pMapping = pBibConfig->GetMapping(aDesc); + OUString sTypeMapping = pBibConfig->GetDefColumnName(AUTHORITYTYPE_POS); if(pMapping) { for(sal_uInt16 nEntry = 0; nEntry < COLUMN_COUNT; nEntry++) @@ -361,18 +375,23 @@ BibGeneralPage::BibGeneralPage(Window* pParent, BibDataManager* pMan): aHoriScroll.Show(); aVertScroll.Show(); - const Mapping* pMapping = pDatMan->GetMapping(pDatMan->getActiveDataTable()); + BibConfig* pBibConfig = BibModul::GetConfig(); + BibDBDescriptor aDesc; + aDesc.sDataSource = pDatMan->getActiveDataSource(); + aDesc.sTableOrQuery = pDatMan->getActiveDataTable(); + aDesc.nCommandType = CommandType::TABLE; + const Mapping* pMapping = pBibConfig->GetMapping(aDesc); xCtrlContnr = VCLUnoHelper::CreateControlContainer(&aControlParentWin); xMgr = utl::getProcessServiceFactory(); AddControlWithError( - lcl_GetColumnName(pDatMan, pMapping, IDENTIFIER_POS), + lcl_GetColumnName(pMapping, IDENTIFIER_POS), lcl_MovePoint(aIdentifierFT), aIdentifierFT.GetSizePixel(), sTableErrorString, aIdentifierFT.GetText(), HID_BIB_IDENTIFIER_POS); - sTypeColumnName = lcl_GetColumnName(pDatMan, pMapping, AUTHORITYTYPE_POS); + sTypeColumnName = lcl_GetColumnName(pMapping, AUTHORITYTYPE_POS); AddControlWithError( sTypeColumnName, @@ -381,96 +400,96 @@ BibGeneralPage::BibGeneralPage(Window* pParent, BibDataManager* pMan): Point aYearPos = lcl_MovePoint(aYearFT); AddControlWithError( - lcl_GetColumnName(pDatMan, pMapping, YEAR_POS), + lcl_GetColumnName(pMapping, YEAR_POS), aYearPos, aYearFT.GetSizePixel(), sTableErrorString, aYearFT.GetText(), HID_BIB_YEAR_POS); AddControlWithError( - lcl_GetColumnName(pDatMan, pMapping, AUTHOR_POS), + lcl_GetColumnName(pMapping, AUTHOR_POS), lcl_MovePoint(aAuthorFT ), aAuthorFT .GetSizePixel(), sTableErrorString, aAuthorFT.GetText(), HID_BIB_AUTHOR_POS); Point aTitlePos(lcl_MovePoint(aTitleFT)); Size aTitleSize = aTitleFT .GetSizePixel(); aTitleSize.Width() = aYearPos.X() + aYearFT.GetSizePixel().Width() - aTitlePos.X(); AddControlWithError( - lcl_GetColumnName(pDatMan, pMapping, TITLE_POS), + lcl_GetColumnName(pMapping, TITLE_POS), aTitlePos, aTitleSize, sTableErrorString, aTitleFT.GetText(), HID_BIB_TITLE_POS); AddControlWithError( - lcl_GetColumnName(pDatMan, pMapping, PUBLISHER_POS), + lcl_GetColumnName(pMapping, PUBLISHER_POS), lcl_MovePoint(aPublisherFT), aPublisherFT.GetSizePixel(), sTableErrorString, aPublisherFT.GetText(), HID_BIB_PUBLISHER_POS); AddControlWithError( - lcl_GetColumnName(pDatMan, pMapping, ADDRESS_POS), + lcl_GetColumnName(pMapping, ADDRESS_POS), lcl_MovePoint(aAddressFT ), aAddressFT .GetSizePixel(), sTableErrorString, aAddressFT.GetText(), HID_BIB_ADDRESS_POS); AddControlWithError( - lcl_GetColumnName(pDatMan, pMapping, ISBN_POS), + lcl_GetColumnName(pMapping, ISBN_POS), lcl_MovePoint(aISBNFT ), aISBNFT .GetSizePixel(), sTableErrorString, aISBNFT.GetText(), HID_BIB_ISBN_POS); AddControlWithError( - lcl_GetColumnName(pDatMan, pMapping, CHAPTER_POS), + lcl_GetColumnName(pMapping, CHAPTER_POS), lcl_MovePoint(aChapterFT ), aChapterFT .GetSizePixel(), sTableErrorString, aChapterFT.GetText(), HID_BIB_CHAPTER_POS); AddControlWithError( - lcl_GetColumnName(pDatMan, pMapping, PAGES_POS), + lcl_GetColumnName(pMapping, PAGES_POS), lcl_MovePoint(aPagesFT ), aPagesFT .GetSizePixel(), sTableErrorString, aPagesFT.GetText(), HID_BIB_PAGES_POS); AddControlWithError( - lcl_GetColumnName(pDatMan, pMapping, EDITOR_POS), + lcl_GetColumnName(pMapping, EDITOR_POS), lcl_MovePoint(aEditorFT ), aEditorFT .GetSizePixel(), sTableErrorString, aEditorFT.GetText(), HID_BIB_EDITOR_POS); AddControlWithError( - lcl_GetColumnName(pDatMan, pMapping, EDITION_POS), + lcl_GetColumnName(pMapping, EDITION_POS), lcl_MovePoint(aEditionFT ), aEditionFT .GetSizePixel(), sTableErrorString, aEditionFT.GetText(), HID_BIB_EDITION_POS); AddControlWithError( - lcl_GetColumnName(pDatMan, pMapping, BOOKTITLE_POS), + lcl_GetColumnName(pMapping, BOOKTITLE_POS), lcl_MovePoint(aBooktitleFT ), aBooktitleFT .GetSizePixel(), sTableErrorString, aBooktitleFT.GetText(), HID_BIB_BOOKTITLE_POS); AddControlWithError( - lcl_GetColumnName(pDatMan, pMapping, VOLUME_POS), + lcl_GetColumnName(pMapping, VOLUME_POS), lcl_MovePoint(aVolumeFT ), aVolumeFT .GetSizePixel(), sTableErrorString, aVolumeFT.GetText(), HID_BIB_VOLUME_POS); AddControlWithError( - lcl_GetColumnName(pDatMan, pMapping, HOWPUBLISHED_POS), + lcl_GetColumnName(pMapping, HOWPUBLISHED_POS), lcl_MovePoint(aHowpublishedFT ), aHowpublishedFT .GetSizePixel(), sTableErrorString, aHowpublishedFT.GetText(), HID_BIB_HOWPUBLISHED_POS); AddControlWithError( - lcl_GetColumnName(pDatMan, pMapping, ORGANIZATIONS_POS), + lcl_GetColumnName(pMapping, ORGANIZATIONS_POS), lcl_MovePoint(aOrganizationsFT), aOrganizationsFT.GetSizePixel(), sTableErrorString, aOrganizationsFT.GetText(), HID_BIB_ORGANIZATIONS_POS); AddControlWithError( - lcl_GetColumnName(pDatMan, pMapping, INSTITUTION_POS), + lcl_GetColumnName(pMapping, INSTITUTION_POS), lcl_MovePoint(aInstitutionFT ), aInstitutionFT .GetSizePixel(), sTableErrorString, aInstitutionFT.GetText(), HID_BIB_INSTITUTION_POS); AddControlWithError( - lcl_GetColumnName(pDatMan, pMapping, SCHOOL_POS), + lcl_GetColumnName(pMapping, SCHOOL_POS), lcl_MovePoint(aSchoolFT ), aSchoolFT .GetSizePixel(), sTableErrorString, aSchoolFT.GetText(), HID_BIB_SCHOOL_POS); AddControlWithError( - lcl_GetColumnName(pDatMan, pMapping, REPORTTYPE_POS), + lcl_GetColumnName(pMapping, REPORTTYPE_POS), lcl_MovePoint(aReportTypeFT ), aReportTypeFT .GetSizePixel(), sTableErrorString, aReportTypeFT.GetText(), HID_BIB_REPORTTYPE_POS); AddControlWithError( - lcl_GetColumnName(pDatMan, pMapping, MONTH_POS), + lcl_GetColumnName(pMapping, MONTH_POS), lcl_MovePoint(aMonthFT), aMonthFT .GetSizePixel(), sTableErrorString, aMonthFT.GetText(), HID_BIB_MONTH_POS); AddControlWithError( - lcl_GetColumnName(pDatMan, pMapping, JOURNAL_POS), + lcl_GetColumnName(pMapping, JOURNAL_POS), lcl_MovePoint(aJournalFT ), aJournalFT .GetSizePixel(), sTableErrorString, aJournalFT.GetText(), HID_BIB_JOURNAL_POS); AddControlWithError( - lcl_GetColumnName(pDatMan, pMapping, NUMBER_POS), + lcl_GetColumnName(pMapping, NUMBER_POS), lcl_MovePoint(aNumberFT ), aNumberFT .GetSizePixel(), sTableErrorString, aNumberFT.GetText(), HID_BIB_NUMBER_POS); AddControlWithError( - lcl_GetColumnName(pDatMan, pMapping, SERIES_POS), + lcl_GetColumnName(pMapping, SERIES_POS), lcl_MovePoint(aSeriesFT ), aSeriesFT .GetSizePixel(), sTableErrorString, aSeriesFT.GetText(), HID_BIB_SERIES_POS); AddControlWithError( - lcl_GetColumnName(pDatMan, pMapping, ANNOTE_POS), + lcl_GetColumnName(pMapping, ANNOTE_POS), lcl_MovePoint(aAnnoteFT ), aAnnoteFT .GetSizePixel(), sTableErrorString, aAnnoteFT.GetText(), HID_BIB_ANNOTE_POS); AddControlWithError( - lcl_GetColumnName(pDatMan, pMapping, NOTE_POS), + lcl_GetColumnName(pMapping, NOTE_POS), lcl_MovePoint(aNoteFT ), aNoteFT .GetSizePixel(), sTableErrorString, aNoteFT.GetText(), HID_BIB_NOTE_POS); AddControlWithError( - lcl_GetColumnName(pDatMan, pMapping, URL_POS), + lcl_GetColumnName(pMapping, URL_POS), lcl_MovePoint(aURLFT ), aURLFT .GetSizePixel(), sTableErrorString, aURLFT.GetText(), HID_BIB_URL_POS); AddControlWithError( - lcl_GetColumnName(pDatMan, pMapping, CUSTOM1_POS), + lcl_GetColumnName(pMapping, CUSTOM1_POS), lcl_MovePoint(aCustom1FT ), aCustom1FT.GetSizePixel(), sTableErrorString, aCustom1FT.GetText(), HID_BIB_CUSTOM1_POS); AddControlWithError( - lcl_GetColumnName(pDatMan, pMapping, CUSTOM2_POS), + lcl_GetColumnName(pMapping, CUSTOM2_POS), lcl_MovePoint(aCustom2FT ), aCustom2FT.GetSizePixel(), sTableErrorString, aCustom2FT.GetText(), HID_BIB_CUSTOM2_POS); AddControlWithError( - lcl_GetColumnName(pDatMan, pMapping, CUSTOM3_POS), + lcl_GetColumnName(pMapping, CUSTOM3_POS), lcl_MovePoint(aCustom3FT ), aCustom3FT.GetSizePixel(), sTableErrorString, aCustom3FT.GetText(), HID_BIB_CUSTOM3_POS); AddControlWithError( - lcl_GetColumnName(pDatMan, pMapping, CUSTOM4_POS), + lcl_GetColumnName(pMapping, CUSTOM4_POS), lcl_MovePoint(aCustom4FT ), aCustom4FT.GetSizePixel(), sTableErrorString, aCustom4FT.GetText(), HID_BIB_CUSTOM4_POS); AddControlWithError( - lcl_GetColumnName(pDatMan, pMapping, CUSTOM5_POS), + lcl_GetColumnName(pMapping, CUSTOM5_POS), lcl_MovePoint(aCustom5FT ), aCustom5FT.GetSizePixel(), sTableErrorString, aCustom5FT.GetText(), HID_BIB_CUSTOM5_POS); // AddXControl("", lcl_MovePoint(.GetPosPixel()), .GetSizePixel(), sTableErrorString); @@ -528,7 +547,7 @@ void BibGeneralPage::CommitActiveControl() } } //----------------------------------------------------------------------------- -void BibGeneralPage::AddControlWithError(const String& rColumnName, +void BibGeneralPage::AddControlWithError(const OUString& rColumnName, const Point& rPos, const Size& rSize, String& rErrorString, diff --git a/extensions/source/bibliography/general.hxx b/extensions/source/bibliography/general.hxx index 6145bea8432c..4131f271b66e 100644 --- a/extensions/source/bibliography/general.hxx +++ b/extensions/source/bibliography/general.hxx @@ -2,9 +2,9 @@ * * $RCSfile: general.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:16:45 $ + * last change: $Author: os $ $Date: 2000-11-13 11:41:26 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -191,7 +191,7 @@ class BibGeneralPage: ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > AddXControl(const String& rName, Point aPos, Size aSize, sal_uInt16 nHelpId); - void AddControlWithError(const String& rColumnName, + void AddControlWithError(const rtl::OUString& rColumnName, const Point& rPos, const Size& rSize, String& rErrorString, String aColumnUIName, sal_uInt16 nHelpId); diff --git a/extensions/source/bibliography/toolbar.cxx b/extensions/source/bibliography/toolbar.cxx index 5f026ea18ab5..a8d3dc2eda32 100644 --- a/extensions/source/bibliography/toolbar.cxx +++ b/extensions/source/bibliography/toolbar.cxx @@ -2,9 +2,9 @@ * * $RCSfile: toolbar.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:16:45 $ + * last change: $Author: os $ $Date: 2000-11-13 11:41:26 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -78,9 +78,6 @@ #endif -#include <svtools/iniprop.hxx> -#include <svtools/iniman.hxx> - #ifndef _TOOLS_DEBUG_HXX //autogen wg. DBG_ASSERT #include <tools/debug.hxx> #endif |