Changeset 581


Ignore:
Timestamp:
07/17/14 15:59:23 (4 years ago)
Author:
jls17
Message:
  • replaced code in CDocCurrencyField and CDocStatusHistoryField with a call to CDocBasicField
  • CDocBasicField is now the base class for CDocCurrencyField and CDocStatusHistoryField
Location:
branches/work_311/doc
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/work_311/doc/DocBasicField.h

    r580 r581  
    2525        void GetResolvedAndLinkedField(std::ostream &strm, const CRefItem *refItem, int rootLevel); 
    2626 
    27 private: 
     27protected: 
    2828        int schemaId; 
    2929        int fieldId; 
  • branches/work_311/doc/DocCurrencyField.cpp

    r579 r581  
    2121 
    2222CDocCurrencyField::CDocCurrencyField(int schemaInsideId, const ARCurrencyPartStruct &field) 
    23 : currencyField(field) 
     23: CDocBasicField(schemaInsideId, field.fieldId), currencyField(field) 
    2424{ 
    25         schemaId = schemaInsideId; 
    2625} 
    2726 
    2827void CDocCurrencyField::GetResolvedAndLinkedField(std::ostream &strm, const CRefItem *refItem, int rootLevel) 
    2928{ 
    30         CARField currencyFieldObj(schemaId, currencyField.fieldId); 
    31         CARInside* arIn = CARInside::GetInstance(); 
    32  
    33         if (currencyFieldObj.Exists()) 
    34         { 
    35                 strm << URLLink(currencyFieldObj, rootLevel); 
    36                  
    37                 if (refItem) 
    38                         arIn->AddFieldReference(schemaId, currencyField.fieldId, *refItem); 
    39         } 
    40         else 
    41                 strm << currencyField.fieldId;  // TODO: missing fields are normally maked red (see CARInside::LinkToField) 
     29        CDocBasicField::GetResolvedAndLinkedField(strm, refItem, rootLevel); 
    4230 
    4331        unsigned int currencyFieldPart = currencyField.partTag; 
  • branches/work_311/doc/DocCurrencyField.h

    r579 r581  
    1717#pragma once 
    1818 
    19 class CRefItem; 
     19#include "DocBasicField.h" 
    2020 
    21 class CDocCurrencyField 
     21class CDocCurrencyField : CDocBasicField 
    2222{ 
    2323public: 
     
    2626 
    2727private: 
    28         int schemaId; 
    2928        const ARCurrencyPartStruct &currencyField; 
    3029}; 
  • branches/work_311/doc/DocStatusHistoryField.cpp

    r579 r581  
    2121 
    2222CDocStatusHistoryField::CDocStatusHistoryField(int schemaInsideId, const ARStatHistoryValue& statHistValue) 
    23 : schemaId(schemaInsideId), statusHistory(statHistValue) 
     23: CDocBasicField(schemaInsideId, AR_CORE_STATUS_HISTORY), statusHistory(statHistValue) 
    2424{ 
    2525} 
     
    2727void CDocStatusHistoryField::GetResolvedAndLinkedField(std::ostream &strm, const CRefItem *refItem, int rootLevel) 
    2828{ 
    29         const int fieldId = AR_CORE_STATUS_HISTORY; 
     29        CDocBasicField::GetResolvedAndLinkedField(strm, refItem, rootLevel); 
    3030 
    31         CARField statHistoryField(schemaId, fieldId); 
    3231        CARInside* arIn = CARInside::GetInstance(); 
    33  
    34         if (statHistoryField.Exists()) 
    35         { 
    36                 strm << URLLink(statHistoryField, rootLevel); 
    37                 if (refItem) 
    38                         arIn->AddFieldReference(schemaId, fieldId, *refItem); 
    39         } 
    40         else 
    41                 strm << fieldId;  // TODO: missing fields are normally maked red (see CARInside::LinkToField) 
    42  
    4332        int enumId = statusHistory.enumVal; 
    4433        string enumValue = arIn->GetFieldEnumValue(schemaId, 7, enumId); 
  • branches/work_311/doc/DocStatusHistoryField.h

    r579 r581  
    1717#pragma once 
    1818#include "../ARApi.h" 
     19#include "DocBasicField.h" 
    1920 
    20 class CRefItem; 
    21  
    22 class CDocStatusHistoryField 
     21class CDocStatusHistoryField : CDocBasicField 
    2322{ 
    2423public: 
     
    2726 
    2827private: 
    29         int schemaId; 
    3028        ARStatHistoryValue statusHistory; 
    3129}; 
Note: See TracChangeset for help on using the changeset viewer.