[ooo-build-commit] Branch 'ooo/OOO310' - sw/inc sw/source

Jan Holesovsky kendy at kemper.freedesktop.org
Tue Jun 23 19:36:37 PDT 2009


 sw/inc/authfld.hxx                |    2 +-
 sw/source/core/fields/authfld.cxx |    5 ++++-
 sw/source/ui/fldui/fldmgr.cxx     |   32 ++++++++++++++++++++++----------
 3 files changed, 27 insertions(+), 12 deletions(-)

New commits:
commit 7dac09d20b62e44ae7d90b16291dad3cf3072c99
Author: Oliver Bolte <obo at openoffice.org>
Date:   Tue Jun 23 09:12:17 2009 +0000

    CWS-TOOLING: integrate CWS c17v006
    2009-05-26 14:54:33 +0200 os  r272304 : #i99069# modification of bibliography entries fixed

diff --git a/sw/inc/authfld.hxx b/sw/inc/authfld.hxx
index 5315806..cb8ac07 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 2914f3e..281de8b 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 d1d260b..289b4ab 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


More information about the ooo-build-commit mailing list