VikasMahato

Untitled

Aug 2nd, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.18 KB | None | 0 0
  1. case DATETIME_TRANSFORMATION_TYPE::START_OF_YEAR:
  2.             {
  3.                 for (SCROW nRow = 0; nRow <= nEndRow; ++nRow)
  4.                 {
  5.                     CellType eType;
  6.                     rDoc.GetCellType(rCol, nRow, 0, eType);
  7.                     if (eType == CELLTYPE_VALUE)
  8.                     {
  9.                         double nVal = rDoc.GetValue(rCol, nRow, 0);
  10.                        
  11.                         SvNumberFormatter* pFormatter = rDoc.GetFormatTable();
  12.                         Date aDate = getDate(nVal, pFormatter);
  13.  
  14.                         nVal -= getDayOfYear(aDate.GetDay(), aDate.GetMonth(), aDate.GetYear()) + 1;
  15.                         SvNumFormatType nFormatType = SvNumFormatType::DATETIME;
  16.                         LanguageType        eLanguage = ScGlobal::eLnge;
  17.                          ScAddress aAddress(rCol, nRow, 0);
  18.                        
  19.                         sal_uLong nFormat = pFormatter->GetStandardFormat( nFormatType, eLanguage );
  20.      
  21.                         rDoc.SetValue(rCol, nRow, 0, nVal);
  22.  
  23.                         rDoc.SetNumberFormat(aAddress, nFormat);
  24.                     }
  25.                 }
  26.             }
Add Comment
Please, Sign In to add comment