You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by or...@apache.org on 2014/03/24 10:11:02 UTC

svn commit: r1580788 - in /openoffice/branches/AOO410: ./ main/ main/sw/source/core/unocore/unofield.cxx

Author: orw
Date: Mon Mar 24 09:11:01 2014
New Revision: 1580788

URL: http://svn.apache.org/r1580788
Log:
124474: on change of User Field via UNO-API trigger update to get dependent Input Fields updated.

        cherry-picked from trunk


Modified:
    openoffice/branches/AOO410/   (props changed)
    openoffice/branches/AOO410/main/   (props changed)
    openoffice/branches/AOO410/main/sw/source/core/unocore/unofield.cxx

Propchange: openoffice/branches/AOO410/
------------------------------------------------------------------------------
  Merged /openoffice/trunk:r1579934

Propchange: openoffice/branches/AOO410/main/
------------------------------------------------------------------------------
  Merged /openoffice/trunk/main:r1579934

Modified: openoffice/branches/AOO410/main/sw/source/core/unocore/unofield.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/AOO410/main/sw/source/core/unocore/unofield.cxx?rev=1580788&r1=1580787&r2=1580788&view=diff
==============================================================================
--- openoffice/branches/AOO410/main/sw/source/core/unocore/unofield.cxx (original)
+++ openoffice/branches/AOO410/main/sw/source/core/unocore/unofield.cxx Mon Mar 24 09:11:01 2014
@@ -540,20 +540,31 @@ void SwXFieldMaster::setPropertyValue( c
 				}
 			}
 		}
-		if( bSetValue )
-		{
+        if ( bSetValue )
+        {
             // nothing special to be done here for the properties
             // UNO_NAME_DATA_BASE_NAME and UNO_NAME_DATA_BASE_URL.
             // We just call PutValue (empty string is allowed).
             // Thus the last property set will be used as Data Source.
 
-            sal_uInt16 nMId = GetFieldTypeMId( rPropertyName, *pType  );
-            if( USHRT_MAX != nMId )
-				pType->PutValue( rValue, nMId );
+            const sal_uInt16 nMemberValueId = GetFieldTypeMId( rPropertyName, *pType );
+            if ( USHRT_MAX != nMemberValueId )
+            {
+                pType->PutValue( rValue, nMemberValueId );
+                if ( pType->Which() == RES_USERFLD )
+                {
+                    // trigger update of User field in order to get depending Input Fields updated.
+                    pType->UpdateFlds();
+                }
+            }
             else
-                throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
-		}
-	}
+            {
+                throw beans::UnknownPropertyException(
+                    OUString( RTL_CONSTASCII_USTRINGPARAM( "Unknown property: " ) ) + rPropertyName,
+                    static_cast< cppu::OWeakObject * >( this ) );
+            }
+        }
+    }
 	else if(!pType && m_pDoc &&
         ( rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_NAME))) )
 	{