Permalink
Browse files

fixed: sync simple attachment value field

git-svn-id: https://external.lite3d.com/opensg/svn_repo/trunk@2301 4683daeb-ad0f-0410-a623-93161e962ae5
  • Loading branch information...
1 parent 1eead5a commit 5efd6c29f60fc5a065abe21cb862e6e1391022cb cneumann committed Feb 22, 2010
@@ -92,6 +92,12 @@ class SimpleAttachment : public Attachment
static EditFieldHandlePtr editHandleField(StoredFieldType *pField,
SimpleAttachment *pThis);
+
+ static void syncField(StoredFieldType *pField,
+ StoredFieldType *pSourceField,
+ ConstFieldMaskArg syncMode,
+ UInt32 uiSyncInfo,
+ AspectOffsetStore &oOffsets );
};
/*! \nohierarchy */
@@ -103,6 +109,12 @@ class SimpleAttachment : public Attachment
static EditFieldHandlePtr editHandleField(StoredFieldType *pField,
SimpleAttachment *pThis);
+
+ static void syncField(StoredFieldType *pField,
+ StoredFieldType *pSourceField,
+ ConstFieldMaskArg syncMode,
+ UInt32 uiSyncInfo,
+ AspectOffsetStore &oOffsets );
};
/*! \nohierarchy */
@@ -114,17 +126,29 @@ class SimpleAttachment : public Attachment
static EditFieldHandlePtr editHandleField(StoredFieldType *pField,
SimpleAttachment *pThis);
+
+ static void syncField(StoredFieldType *pField,
+ StoredFieldType *pSourceField,
+ ConstFieldMaskArg syncMode,
+ UInt32 uiSyncInfo,
+ AspectOffsetStore &oOffsets );
};
/*! \nohierarchy */
struct MFieldPtrFunctions
{
- static StoredFieldType *editFieldPtr (StoredFieldType *pField,
- SimpleAttachment *pThis );
+ static StoredFieldType *editFieldPtr (StoredFieldType *pField,
+ SimpleAttachment *pThis );
- static EditFieldHandlePtr editHandleField(StoredFieldType *pField,
- SimpleAttachment *pThis);
+ static EditFieldHandlePtr editHandleField(StoredFieldType *pField,
+ SimpleAttachment *pThis);
+
+ static void syncField(StoredFieldType *pField,
+ StoredFieldType *pSourceField,
+ ConstFieldMaskArg syncMode,
+ UInt32 uiSyncInfo,
+ AspectOffsetStore &oOffsets );
};
@@ -69,6 +69,18 @@ EditFieldHandlePtr
return returnValue;
}
+template <class AttachmentDescT> inline
+void
+SimpleAttachment<AttachmentDescT>::SFieldValFunctions::syncField(
+ StoredFieldType *pField,
+ StoredFieldType *pSourceField,
+ ConstFieldMaskArg syncMode,
+ UInt32 uiSyncInfo,
+ AspectOffsetStore &oOffsets )
+{
+ pField->syncWith(*pSourceField);
+}
+
template <class AttachmentDescT> inline
typename SimpleAttachment<AttachmentDescT>::StoredFieldType *
@@ -99,6 +111,19 @@ EditFieldHandlePtr
return returnValue;
}
+template <class AttachmentDescT> inline
+void
+SimpleAttachment<AttachmentDescT>::SFieldPtrFunctions::syncField(
+ StoredFieldType *pField,
+ StoredFieldType *pSourceField,
+ ConstFieldMaskArg syncMode,
+ UInt32 uiSyncInfo,
+ AspectOffsetStore &oOffsets )
+{
+ pField->syncWith(*pSourceField);
+}
+
+
template <class AttachmentDescT> inline
typename SimpleAttachment<AttachmentDescT>::StoredFieldType *
@@ -128,6 +153,17 @@ EditFieldHandlePtr
return returnValue;
}
+template <class AttachmentDescT> inline
+void
+SimpleAttachment<AttachmentDescT>::MFieldValFunctions::syncField(
+ StoredFieldType *pField,
+ StoredFieldType *pSourceField,
+ ConstFieldMaskArg syncMode,
+ UInt32 uiSyncInfo,
+ AspectOffsetStore &oOffsets )
+{
+ pField->syncWith(*pSourceField, syncMode, uiSyncInfo, oOffsets);
+}
template <class AttachmentDescT> inline
typename SimpleAttachment<AttachmentDescT>::StoredFieldType *
@@ -158,6 +194,18 @@ EditFieldHandlePtr
return returnValue;
}
+template <class AttachmentDescT> inline
+void
+SimpleAttachment<AttachmentDescT>::MFieldPtrFunctions::syncField(
+ StoredFieldType *pField,
+ StoredFieldType *pSourceField,
+ ConstFieldMaskArg syncMode,
+ UInt32 uiSyncInfo,
+ AspectOffsetStore &oOffsets )
+{
+ pField->syncWith(*pSourceField, syncMode, uiSyncInfo, oOffsets);
+}
+
template <class AttachmentDescT> inline
typename SimpleAttachment<AttachmentDescT>::StoredFieldType *
@@ -222,6 +270,15 @@ void SimpleAttachment<AttachmentDescT>::execSync(
oOffsets,
syncMode,
uiSyncInfo);
+
+ if(FieldBits::NoField != (SimpleFieldMask & whichField))
+ {
+ FieldFunctions::syncField(&_field,
+ &(pFrom->_field),
+ syncMode,
+ uiSyncInfo,
+ oOffsets );
+ }
}
template <class AttachmentDescT> inline

0 comments on commit 5efd6c2

Please sign in to comment.