diff options
author | Oliver Bolte <obo@openoffice.org> | 2009-06-23 09:12:17 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2009-06-23 09:12:17 +0000 |
commit | 7dac09d20b62e44ae7d90b16291dad3cf3072c99 (patch) | |
tree | 8108bf1285060ef89e40f18f040d6c642f55e010 | |
parent | f46ab6c15cf495a4217a71d32e3490af5b25e203 (diff) |
CWS-TOOLING: integrate CWS c17v006
2009-05-26 14:54:33 +0200 os r272304 : #i99069# modification of bibliography entries fixed
-rw-r--r-- | sw/inc/authfld.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/fields/authfld.cxx | 5 | ||||
-rw-r--r-- | sw/source/ui/fldui/fldmgr.cxx | 32 |
3 files changed, 27 insertions, 12 deletions
diff --git a/sw/inc/authfld.hxx b/sw/inc/authfld.hxx index 5315806f41..cb8ac0733b 100644 --- a/sw/inc/authfld.hxx +++ b/sw/inc/authfld.hxx @@ -118,7 +118,7 @@ public: void GetAllEntryIdentifiers( SvStringsDtor& rToFill )const; const SwAuthEntry* GetEntryByIdentifier(const String& rIdentifier)const; - void ChangeEntryContent(const SwAuthEntry* pNewEntry); + bool ChangeEntryContent(const SwAuthEntry* pNewEntry); // import interface USHORT AppendField(const SwAuthEntry& rInsert); long GetHandle(USHORT nPos); diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx index 2914f3ed7c..281de8b636 100644 --- a/sw/source/core/fields/authfld.cxx +++ b/sw/source/core/fields/authfld.cxx @@ -288,8 +288,9 @@ const SwAuthEntry* SwAuthorityFieldType::GetEntryByIdentifier( /* -----------------------------21.12.99 13:20-------------------------------- ---------------------------------------------------------------------------*/ -void SwAuthorityFieldType::ChangeEntryContent(const SwAuthEntry* pNewEntry) +bool SwAuthorityFieldType::ChangeEntryContent(const SwAuthEntry* pNewEntry) { + bool bChanged = false; for( USHORT j = 0; j < m_pDataArr->Count(); ++j ) { SwAuthEntry* pTemp = m_pDataArr->GetObject(j); @@ -299,9 +300,11 @@ void SwAuthorityFieldType::ChangeEntryContent(const SwAuthEntry* pNewEntry) for(USHORT i = 0; i < AUTH_FIELD_END; i++) pTemp->SetAuthorField((ToxAuthorityField) i, pNewEntry->GetAuthorField((ToxAuthorityField)i)); + bChanged = true; break; } } + return bChanged; } /*-- 11.10.99 08:49:22--------------------------------------------------- Description: appends a new entry (if new) and returns the array position diff --git a/sw/source/ui/fldui/fldmgr.cxx b/sw/source/ui/fldui/fldmgr.cxx index d1d260be0e..289b4ab7bb 100644 --- a/sw/source/ui/fldui/fldmgr.cxx +++ b/sw/source/ui/fldui/fldmgr.cxx @@ -31,9 +31,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" -#ifndef _CMDID_H #include <cmdid.h> -#endif #include <hintids.hxx> #include <svtools/stritem.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> @@ -63,21 +61,15 @@ #include <svtools/zforlist.hxx> #include <svtools/zformat.hxx> #include <vcl/mnemonic.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <wrtsh.hxx> // Actives Fenster #include <doc.hxx> // Actives Fenster -#ifndef _DOCSH_HXX #include <docsh.hxx> // Actives Fenster -#endif #include <swmodule.hxx> #include <charatr.hxx> #include <fmtinfmt.hxx> #include <cellatr.hxx> -#ifndef _DBMGR_HXX #include <dbmgr.hxx> -#endif #include <shellres.hxx> #include <fldbas.hxx> #include <docufld.hxx> @@ -92,9 +84,8 @@ #include <fldmgr.hxx> #include <crsskip.hxx> #include <flddropdown.hxx> -#ifndef _FLDUI_HRC #include <fldui.hrc> -#endif +#include <tox.hxx> using rtl::OUString; using namespace com::sun::star::uno; @@ -1552,6 +1543,27 @@ void SwFldMgr::UpdateCurFld(ULONG nFormat, bSetPar1 = bSetPar2 = FALSE; } break; + case TYP_AUTHORITY : + { + //#i99069# changes to a bibliography field should change the field type + SwAuthorityField* pAuthorityField = static_cast<SwAuthorityField*>(pTmpFld); + SwAuthorityFieldType* pAuthorityType = static_cast<SwAuthorityFieldType*>(pType); + SwAuthEntry aTempEntry; + for( USHORT i = 0; i < AUTH_FIELD_END; ++i ) + aTempEntry.SetAuthorField( (ToxAuthorityField)i, + rPar1.GetToken( i, TOX_STYLE_DELIMITER )); + if( pAuthorityType->ChangeEntryContent( &aTempEntry ) ) + { + pType->UpdateFlds(); + pSh->SetModified(); + } + + if( aTempEntry.GetAuthorField( AUTH_FIELD_IDENTIFIER ) == + pAuthorityField->GetFieldText( AUTH_FIELD_IDENTIFIER ) ) + bSetPar1 = FALSE; //otherwise it's a new or changed entry, the field needs to be updated + bSetPar2 = FALSE; + } + break; } // Format setzen |