diff options
author | Oliver Specht <os@openoffice.org> | 2000-12-15 10:09:31 +0000 |
---|---|---|
committer | Oliver Specht <os@openoffice.org> | 2000-12-15 10:09:31 +0000 |
commit | 5bfc91e53184ed1d3fad0c5a33fa28f1bf80e95b (patch) | |
tree | d7f11c0f8d87205e58ede67ac3eba6c969678842 /extensions | |
parent | 63bd31cdb698e14baa1e4f2b30c67869c2b1762d (diff) |
#82160# configuration of column assignment corrected
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/bibliography/bibconfig.cxx | 11 | ||||
-rw-r--r-- | extensions/source/bibliography/datman.cxx | 53 |
2 files changed, 37 insertions, 27 deletions
diff --git a/extensions/source/bibliography/bibconfig.cxx b/extensions/source/bibliography/bibconfig.cxx index e414364cc4f4..3cfd8572736f 100644 --- a/extensions/source/bibliography/bibconfig.cxx +++ b/extensions/source/bibliography/bibconfig.cxx @@ -2,9 +2,9 @@ * * $RCSfile: bibconfig.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: os $ $Date: 2000-12-01 12:46:59 $ + * last change: $Author: os $ $Date: 2000-12-15 11:09:31 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -209,7 +209,7 @@ BibConfig::BibConfig() : pAssignmentPropertyNames[nFieldIdx] = sSubPrefix; pAssignmentPropertyNames[nFieldIdx++] += C2U("/FieldName"); pAssignmentPropertyNames[nFieldIdx] = sSubPrefix; - pAssignmentPropertyNames[nFieldIdx++] += C2U("/DatabaseFieldName"); + pAssignmentPropertyNames[nFieldIdx++] += C2U("/DatasourceFieldName"); } Sequence<Any> aAssignmentValues = GetProperties(aAssignmentPropertyNames); const Any* pAssignmentValues = aAssignmentValues.getConstArray(); @@ -321,10 +321,11 @@ void BibConfig::Commit() sPrefix += C2U("Fields"); sal_Int32 nFieldAssignment = 0; OUString sFieldName = C2U("/FieldName"); - OUString sDatabaseFieldName = C2U("/DatabaseFieldName"); + OUString sDatabaseFieldName = C2U("/DatasourceFieldName"); ClearNodeSet( sPrefix ); - while(pMapping->aColumnPairs[nFieldAssignment].sLogicalColumnName.getLength()) + while(nFieldAssignment < COLUMN_COUNT && + pMapping->aColumnPairs[nFieldAssignment].sLogicalColumnName.getLength()) { OUString sSubPrefix(sPrefix); sSubPrefix += C2U("/_"); diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx index 75cc92a52c19..86cd7eaf5e28 100644 --- a/extensions/source/bibliography/datman.cxx +++ b/extensions/source/bibliography/datman.cxx @@ -2,9 +2,9 @@ * * $RCSfile: datman.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: os $ $Date: 2000-12-01 12:46:59 $ + * last change: $Author: os $ $Date: 2000-12-15 11:09:31 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -448,6 +448,8 @@ class MappingDialog_Impl : public ModalDialog ListBox* aListBoxes[COLUMN_COUNT]; String sNone; + sal_Bool bModified; + BibDataManager* pDatMan; DECL_LINK(OkHdl, OKButton*); @@ -457,6 +459,8 @@ public: MappingDialog_Impl(Window* pParent, BibDataManager* pDatMan); ~MappingDialog_Impl(); + void SetModified() {bModified = TRUE;} + }; /* -----------------11.11.99 16:42------------------- @@ -543,7 +547,8 @@ MappingDialog_Impl::MappingDialog_Impl(Window* pParent, BibDataManager* pMan) : aCustom4LB(this, ResId( LB_CUSTOM4 )), aCustom5FT(this, ResId( FT_CUSTOM5 )), aCustom5LB(this, ResId( LB_CUSTOM5 )), - sNone(ResId(ST_NONE)) + sNone(ResId(ST_NONE)), + bModified(sal_False) { FreeResource(); @@ -642,6 +647,7 @@ IMPL_LINK(MappingDialog_Impl, ListBoxSelectHdl, ListBox*, pListBox) aListBoxes[i]->SelectEntryPos(0); } } + SetModified(); return 0; } /* -----------------12.11.99 14:50------------------- @@ -649,29 +655,32 @@ IMPL_LINK(MappingDialog_Impl, ListBoxSelectHdl, ListBox*, pListBox) --------------------------------------------------*/ IMPL_LINK(MappingDialog_Impl, OkHdl, OKButton*, EMPTYARG) { - Mapping aNew; - aNew.sTableName = String(pDatMan->getActiveDataTable()); - aNew.sURL = String(pDatMan->getActiveDataSource()); - - sal_uInt16 nWriteIndex = 0; - BibConfig* pConfig = BibModul::GetConfig(); - for(sal_uInt16 nEntry = 0; nEntry < COLUMN_COUNT; nEntry++) + if(bModified) { - String sSel = aListBoxes[nEntry]->GetSelectEntry(); - if(sSel != sNone) + Mapping aNew; + aNew.sTableName = String(pDatMan->getActiveDataTable()); + aNew.sURL = String(pDatMan->getActiveDataSource()); + + sal_uInt16 nWriteIndex = 0; + BibConfig* pConfig = BibModul::GetConfig(); + for(sal_uInt16 nEntry = 0; nEntry < COLUMN_COUNT; nEntry++) { - aNew.aColumnPairs[nWriteIndex].sRealColumnName = sSel; - aNew.aColumnPairs[nWriteIndex].sLogicalColumnName = pConfig->GetDefColumnName(nEntry); - nWriteIndex++; + String sSel = aListBoxes[nEntry]->GetSelectEntry(); + if(sSel != sNone) + { + aNew.aColumnPairs[nWriteIndex].sRealColumnName = sSel; + aNew.aColumnPairs[nWriteIndex].sLogicalColumnName = pConfig->GetDefColumnName(nEntry); + nWriteIndex++; + } } + BibDBDescriptor aDesc; + aDesc.sDataSource = pDatMan->getActiveDataSource(); + aDesc.sTableOrQuery = pDatMan->getActiveDataTable(); + aDesc.nCommandType = CommandType::TABLE; + pDatMan->ResetIdentifierMapping(); + pConfig->SetMapping(aDesc, &aNew); } - BibDBDescriptor aDesc; - aDesc.sDataSource = pDatMan->getActiveDataSource(); - aDesc.sTableOrQuery = pDatMan->getActiveDataTable(); - aDesc.nCommandType = CommandType::TABLE; - pDatMan->ResetIdentifierMapping(); - pConfig->SetMapping(aDesc, &aNew); - EndDialog(RET_OK); + EndDialog(bModified ? RET_OK : RET_CANCEL); return 0; } /* -----------------18.11.99 10:23------------------- |