ITS_OPLibF.cpp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624
  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #include <DateUtils.hpp>
  4. #pragma hdrstop
  5. #include "ITS_OPLibF.h"
  6. #include "CDSCodeF.h"
  7. #include "CDSVmsCtlrF.h"
  8. #include "CDSVmsObjTypeF.h"
  9. //---------------------------------------------------------------------------
  10. #pragma package(smart_init)
  11. TITSLog *ITSLog = NULL;
  12. String g_sMapDir = "";
  13. ST_GISINFO g_GisInfo;
  14. ST_SELLINK g_SelLink;
  15. APP_CONFIG g_AppCfg;
  16. TColor g_DispColor[MAX_DISPCOLOR];
  17. void APP_InitDisplayColor()
  18. {
  19. #if 0
  20. g_DispColor[ 0] = Graphics::clBlue;
  21. g_DispColor[ 1] = Graphics::clRed;
  22. g_DispColor[ 2] = Graphics::clLime;
  23. g_DispColor[ 3] = Graphics::clMaroon;
  24. g_DispColor[ 4] = Graphics::clGreen;
  25. g_DispColor[ 5] = Graphics::clMenuHighlight;
  26. g_DispColor[ 6] = Graphics::clBackground;
  27. g_DispColor[ 7] = Graphics::clPurple;
  28. g_DispColor[ 8] = Graphics::clTeal;
  29. g_DispColor[ 9] = Graphics::clYellow;
  30. g_DispColor[10] = Graphics::clFuchsia;
  31. g_DispColor[11] = Graphics::clAqua;
  32. g_DispColor[12] = Graphics::clMoneyGreen;
  33. g_DispColor[13] = Graphics::clSkyBlue;
  34. g_DispColor[14] = Graphics::clRed;
  35. g_DispColor[15] = Graphics::clLime;
  36. g_DispColor[16] = Graphics::clYellow;
  37. g_DispColor[17] = Graphics::clBlue;
  38. g_DispColor[18] = Graphics::clFuchsia;
  39. g_DispColor[19] = Graphics::clAqua;
  40. g_DispColor[20] = Graphics::clMoneyGreen;
  41. g_DispColor[21] = Graphics::clActiveCaption;
  42. #else
  43. g_DispColor[ 0] = Graphics::clLime;
  44. g_DispColor[ 1] = (TColor)RGB(0xFF, 0x00, 0x00);
  45. g_DispColor[ 2] = (TColor)RGB(0x00, 0x00, 0xFF);
  46. g_DispColor[ 3] = (TColor)RGB(0xFF, 0x82, 0x00);
  47. g_DispColor[ 4] = (TColor)RGB(0x94, 0x00, 0xD3);
  48. g_DispColor[ 5] = (TColor)RGB(0x00, 0x00, 0x00);
  49. g_DispColor[ 6] = (TColor)RGB(0x82, 0x82, 0x82);
  50. g_DispColor[ 7] = (TColor)RGB(0x1E, 0x90, 0xFF);
  51. g_DispColor[ 8] = (TColor)RGB(0xB9, 0x06, 0x2F);
  52. g_DispColor[ 9] = (TColor)RGB(0x8c, 0x00, 0x8c);
  53. g_DispColor[10] = (TColor)RGB(0xFF, 0x82, 0x00);
  54. g_DispColor[11] = (TColor)RGB(0x94, 0x00, 0xD3);
  55. g_DispColor[12] = (TColor)RGB(0xB0, 0xC4, 0xDE);
  56. g_DispColor[13] = (TColor)RGB(0x00, 0xBF, 0xFF);
  57. g_DispColor[14] = (TColor)RGB(0x87, 0xCE, 0xEB);
  58. g_DispColor[15] = (TColor)RGB(0x87, 0xCE, 0xFA);
  59. g_DispColor[16] = (TColor)RGB(0xAD, 0xD8, 0xE6);
  60. g_DispColor[17] = (TColor)RGB(0xB0, 0xE0, 0xE6);
  61. g_DispColor[18] = (TColor)RGB(0xE6, 0xE6, 0xFA);
  62. g_DispColor[19] = (TColor)RGB(0xF0, 0xF8, 0xFF);
  63. #endif
  64. }
  65. //---------------------------------------------------------------------------
  66. TColor APP_GetDisplayColor(int ASeq)
  67. {
  68. return g_DispColor[ASeq % MAX_DISPCOLOR];
  69. }
  70. //---------------------------------------------------------------------------
  71. void APP_ImageClear(TCanvas *c, int offX, int offY, int w, int h, TColor color)
  72. {
  73. try
  74. {
  75. c->Pen->Color = clWhite;
  76. c->Pen->Width = 0;
  77. c->Pen->Style = psClear;
  78. c->Brush->Style = bsSolid;
  79. c->Brush->Color = color;
  80. c->Rectangle(offX, offY, w+offX+2, h+offY+2);
  81. }
  82. catch(...)
  83. {
  84. }
  85. }
  86. //---------------------------------------------------------------------------
  87. TDateTime APP_StrToDateTime(String AStrDateTime)
  88. {
  89. TDateTime dtReturnValue = NULL;
  90. if (AStrDateTime.IsEmpty()) return dtReturnValue;
  91. if (AStrDateTime.Length() != 14) return dtReturnValue;
  92. AnsiString sDateTime = AnsiString(AStrDateTime);
  93. try
  94. {
  95. #if 0
  96. sDateTime.printf(L"%s-%s-%s %s:%s:%s",
  97. AStrDateTime.SubString( 1, 4).c_str(),
  98. AStrDateTime.SubString( 5, 2).c_str(),
  99. AStrDateTime.SubString( 7, 2).c_str(),
  100. AStrDateTime.SubString( 9, 2).c_str(),
  101. AStrDateTime.SubString(11, 2).c_str(),
  102. AStrDateTime.SubString(13, 2).c_str());
  103. dtReturnValue = StrToDateTime(sDateTime);
  104. #endif
  105. // swscanf(sRgb.c_str(), L"%d,%d,%d", &r, &g, &b);
  106. int year, month, day, hour, minute, second;
  107. sscanf(sDateTime.c_str(), "%4d%2d%2d%2d%2d%2d", &year, &month, &day, &hour, &minute, &second);
  108. dtReturnValue = EncodeDateTime(year, month, day, hour, minute, second, 0);
  109. }
  110. catch(...)
  111. {
  112. }
  113. return dtReturnValue;
  114. }
  115. //---------------------------------------------------------------------------
  116. void APP_ShowErrorMsg(String ATitle, String AErrMsg)
  117. {
  118. Application->NormalizeTopMosts();
  119. Application->MessageBox(AErrMsg.c_str(), ATitle.c_str(), MB_OK|MB_ICONERROR|MB_APPLMODAL);
  120. Application->RestoreTopMosts();
  121. }
  122. //----------------------------------------------------------------------------
  123. String APP_FillCode(TcxComboBox *ACombo, String ACode)
  124. {
  125. String sReturn = "";
  126. ACombo->Properties->Items->Clear();
  127. TItsCode *FCodeRMF = ItsCodeManager->FLists.Find(ACode);
  128. if (FCodeRMF)
  129. {
  130. FOR_STL(TItsSubCode *, pSubCode, FCodeRMF->FSubLists)
  131. {
  132. if (pSubCode->USE_YN == "N") continue;
  133. ACombo->Properties->Items->Add(" [" + pSubCode->CMMN_CD + "] " + pSubCode->CMMN_CD_KOR_NM);
  134. if (sReturn == "")
  135. {
  136. sReturn = " [" + pSubCode->CMMN_CD + "] " + pSubCode->CMMN_CD_KOR_NM;
  137. }
  138. }
  139. }
  140. ACombo->ItemIndex = 0;
  141. return sReturn;
  142. }
  143. //----------------------------------------------------------------------------
  144. String APP_GetCode(TcxComboBox *ACombo)
  145. {
  146. String sReturn = "";
  147. if (ACombo->ItemIndex >= 0)
  148. {
  149. String sDesc = ACombo->Properties->Items->Strings[ACombo->ItemIndex];
  150. String sCode = sDesc.SubString(sDesc.Pos("[") + 1,
  151. sDesc.Pos("]") - (sDesc.Pos("[") + 1));
  152. sReturn = sCode;
  153. }
  154. return sReturn;
  155. }
  156. //----------------------------------------------------------------------------
  157. String APP_GetCodeName(TcxComboBox *ACombo, String ACode)
  158. {
  159. String sReturn = "";
  160. for (int ii = 0; ii < ACombo->Properties->Items->Count; ii++)
  161. {
  162. String sDesc = ACombo->Properties->Items->Strings[ii];
  163. String sName = sDesc.SubString(sDesc.Pos("]") + 1, sDesc.Length());
  164. String sCode = sDesc.SubString(sDesc.Pos("[") + 1,
  165. sDesc.Pos("]") - (sDesc.Pos("[") + 1));
  166. if (ACode == sCode)
  167. {
  168. sReturn = sName.Trim();
  169. break;
  170. }
  171. }
  172. return sReturn;
  173. }
  174. //----------------------------------------------------------------------------
  175. String APP_GetCodeIdByName(TcxComboBox *ACombo, String AName)
  176. {
  177. String sReturn = "3";
  178. for (int ii = 0; ii < ACombo->Properties->Items->Count; ii++)
  179. {
  180. String sDesc = ACombo->Properties->Items->Strings[ii];
  181. String sName = sDesc.SubString(sDesc.Pos("]") + 1, sDesc.Length());
  182. String sCode = sDesc.SubString(sDesc.Pos("[") + 1,
  183. sDesc.Pos("]") - (sDesc.Pos("[") + 1));
  184. if (sName.Trim() == AName.Trim())
  185. {
  186. sReturn = sCode;
  187. break;
  188. }
  189. }
  190. return sReturn;
  191. }
  192. //----------------------------------------------------------------------------
  193. String APP_GetCodeDesc(TcxComboBox *ACombo, String ACode)
  194. {
  195. String sReturn = "";
  196. for (int ii = 0; ii < ACombo->Properties->Items->Count; ii++)
  197. {
  198. String sDesc = ACombo->Properties->Items->Strings[ii];
  199. String sCode = sDesc.SubString(sDesc.Pos("[") + 1,
  200. sDesc.Pos("]") - (sDesc.Pos("[") + 1));
  201. if (ACode == sCode)
  202. {
  203. sReturn = sDesc;
  204. break;
  205. }
  206. }
  207. return sReturn;
  208. }
  209. //----------------------------------------------------------------------------
  210. String APP_GetCodeDefCode(TcxComboBox *ACombo)
  211. {
  212. String sReturn = "";
  213. if (ACombo->Properties->Items->Count > 0)
  214. {
  215. String sDesc = ACombo->Properties->Items->Strings[0];
  216. String sCode = sDesc.SubString(sDesc.Pos("[") + 1,
  217. sDesc.Pos("]") - (sDesc.Pos("[") + 1));
  218. sReturn = sCode;
  219. }
  220. return sReturn;
  221. }
  222. //----------------------------------------------------------------------------
  223. String APP_GetCodeDefDesc(TcxComboBox *ACombo)
  224. {
  225. String sReturn = "";
  226. if (ACombo->Properties->Items->Count > 0)
  227. {
  228. String sDesc = ACombo->Properties->Items->Strings[0];
  229. sReturn = sDesc;
  230. }
  231. return sReturn;
  232. }
  233. //----------------------------------------------------------------------------
  234. int APP_SetCode(TcxComboBox *ACombo, String ACode)
  235. {
  236. int nItemIndex = -1;
  237. for (int ii = 0; ii < ACombo->Properties->Items->Count; ii++)
  238. {
  239. String sDesc = ACombo->Properties->Items->Strings[ii];
  240. String sCode = sDesc.SubString(sDesc.Pos("[") + 1,
  241. sDesc.Pos("]") - (sDesc.Pos("[") + 1));
  242. if (ACode == sCode)
  243. {
  244. nItemIndex = ii;
  245. break;
  246. }
  247. }
  248. ACombo->ItemIndex = nItemIndex;
  249. return nItemIndex;
  250. }
  251. //----------------------------------------------------------------------------
  252. void APP_DelVmsSizeCombo(TcxComboBox *cboBox)
  253. {
  254. TStrings *pStrItems;
  255. TVmsSizeType *Ov;
  256. pStrItems = ((TcxComboBox *)cboBox)->Properties->Items;
  257. for (int ii = pStrItems->Count-1; ii >= 0; ii--)
  258. {
  259. Ov = (TVmsSizeType *)pStrItems->Objects[ii];
  260. if (Ov != NULL)
  261. {
  262. delete Ov;
  263. Ov = NULL;
  264. }
  265. }
  266. }
  267. //---------------------------------------------------------------------------
  268. void APP_FillVmsSizeType(TcxComboBox *cboBox, bool bAddAll/*=false*/)
  269. {
  270. String sQry;
  271. TStrings *pStrItems;
  272. TADOQuery *pADO = NULL;
  273. APP_DelVmsSizeCombo(cboBox);
  274. if (!VmsTypeManager) {
  275. VmsTypeManager = new TVmsTypeManager();
  276. VmsTypeManager->LoadFromDb();
  277. }
  278. pStrItems = ((TcxComboBox *)cboBox)->Properties->Items;
  279. ((TcxComboBox *)cboBox)->Properties->Items->Clear();
  280. FOR_STL(TVmsType*, pObj, VmsTypeManager->FLists)
  281. {
  282. String sTypeCd = pObj->VMS_TYPE_CD;
  283. String sTypeNm = pObj->VMS_TYPE_NM;
  284. int nW = pObj->VMS_WDTH;
  285. int nH = pObj->VMS_HGHT;
  286. pStrItems->AddObject(" [" + sTypeCd + "] " + sTypeNm + " (" + String(nW) + "x" + String(nH) + ")", new TVmsSizeType(sTypeCd, sTypeNm, nW, nH) );
  287. }
  288. if (bAddAll)
  289. {
  290. String sAllName = "전체";
  291. pStrItems->AddObject(" [ALL] 전체" , new TVmsSizeType("ALL", sAllName, 384, 64));
  292. }
  293. cboBox->ItemIndex = 0;
  294. }
  295. //---------------------------------------------------------------------------
  296. TVmsSizeType* APP_GetVmsSizeTypeObject(TcxComboBox *cboBox)
  297. {
  298. TStrings *pStrItems;
  299. TVmsSizeType *Ov = NULL;
  300. int nItemIndex;
  301. pStrItems = ((TcxComboBox *)cboBox)->Properties->Items;
  302. nItemIndex= ((TcxComboBox *)cboBox)->ItemIndex;
  303. if (nItemIndex < 0)
  304. {
  305. return Ov;
  306. }
  307. Ov = (TVmsSizeType *)pStrItems->Objects[nItemIndex];
  308. if (Ov == NULL)
  309. {
  310. Ov = NULL;
  311. }
  312. return Ov;
  313. }
  314. //---------------------------------------------------------------------------
  315. bool APP_WriteConfigInfo(String sCfgFile, String sTitle, String sItem, String sValue)
  316. {
  317. String ConfigFile;
  318. TIniFile *pIniFile = NULL;
  319. ConfigFile = sCfgFile;
  320. try
  321. {
  322. pIniFile = new TIniFile(ConfigFile);
  323. if (pIniFile == NULL)
  324. {
  325. return false;
  326. }
  327. pIniFile->WriteString(sTitle, sItem, sValue);
  328. }
  329. catch(...)
  330. {
  331. }
  332. if (pIniFile)
  333. {
  334. pIniFile->Free();
  335. pIniFile = NULL;
  336. }
  337. return true;
  338. }
  339. //---------------------------------------------------------------------------
  340. String APP_FormatStr(String AStrDateTime, String AFormat)
  341. {
  342. #define SYEAR "-"
  343. #define STIME ":"
  344. #define SPACE " "
  345. String sDateTime = "";
  346. String sInData = AStrDateTime;//AnsiString(AStrDateTime);
  347. String sFormat = AFormat;
  348. if (sInData.IsEmpty())
  349. return sInData;
  350. try
  351. {
  352. if (sFormat == STR_DATETIME)
  353. {
  354. if (sInData.Length() < 14) return sInData;
  355. sDateTime = sInData.SubString( 1, 4) + SYEAR +
  356. sInData.SubString( 5, 2) + SYEAR +
  357. sInData.SubString( 7, 2) + SPACE +
  358. sInData.SubString( 9, 2) + STIME +
  359. sInData.SubString(11, 2) + STIME +
  360. sInData.SubString(13, 2);
  361. }
  362. else
  363. if (sFormat == STR_HHNN)
  364. {
  365. if (sInData.Length() < 12) return sInData;
  366. sDateTime = sInData.SubString( 1, 4) + SYEAR +
  367. sInData.SubString( 5, 2) + SYEAR +
  368. sInData.SubString( 7, 2) + SPACE +
  369. sInData.SubString( 9, 2) + STIME +
  370. sInData.SubString(11, 2);
  371. }
  372. else
  373. if (sFormat == STR_DATEHOUR)
  374. {
  375. if (sInData.Length() < 10) return sInData;
  376. sDateTime = sInData.SubString( 1, 4) + SYEAR +
  377. sInData.SubString( 5, 2) + SYEAR +
  378. sInData.SubString( 7, 2) + SPACE +
  379. sInData.SubString( 9, 2);
  380. }
  381. else
  382. if (sFormat == STR_DATE)
  383. {
  384. if (sInData.Length() < 8) return sInData;
  385. sDateTime = sInData.SubString( 1, 4) + SYEAR +
  386. sInData.SubString( 5, 2) + SYEAR +
  387. sInData.SubString( 7, 2);
  388. }
  389. else
  390. if (sFormat == STR_MM)
  391. {
  392. if (sInData.Length() < 6) return sInData;
  393. sDateTime = sInData.SubString( 1, 4) + SYEAR +
  394. sInData.SubString( 5, 2);
  395. }
  396. else
  397. {
  398. sDateTime = sInData;
  399. }
  400. }
  401. catch(Exception &E)
  402. {
  403. throw Exception(String(E.ClassName()) + E.Message);
  404. }
  405. return sDateTime;
  406. }
  407. //---------------------------------------------------------------------------
  408. void APP_SetSummaryItemKind(TcxSummaryEventArguments &Arguments,
  409. TcxSummaryEventOutArguments &OutArguments,
  410. int pKind,
  411. bool pCaptionDisplay,
  412. bool pPointDisplay)
  413. {
  414. #if 0
  415. String sAvgCaption, sSumCaption, sMinCaption, sMaxCaption, sCntCaption;
  416. sAvgCaption = "";
  417. sMinCaption = "";
  418. sMaxCaption = "";
  419. //sCntCaption = "";
  420. sSumCaption = "";
  421. if (pCaptionDisplay)
  422. {
  423. sAvgCaption = "";//"평균: ";
  424. sMinCaption = "최소: ";
  425. sMaxCaption = "최대: ";
  426. if (pKind == 1)
  427. {
  428. sSumCaption = "소계: ";
  429. }
  430. else
  431. {
  432. sSumCaption = "합계: ";
  433. }
  434. }
  435. //sCntCaption = " 건";
  436. #endif
  437. #if 0
  438. if (VarIsNull(OutArguments.Value))
  439. {
  440. OutArguments.Done = true;
  441. return;
  442. }
  443. #endif
  444. #if 0
  445. if (Arguments.SummaryItem->Kind == skSum)
  446. {
  447. if (!VarIsNull(OutArguments.Value))
  448. {
  449. if (!VarSameValue(OutArguments.Value, Variant(0)))
  450. {
  451. OutArguments.CountValue++;
  452. OutArguments.SummaryValue += OutArguments.Value;
  453. OutArguments.Done = true;
  454. }
  455. else
  456. {
  457. //OutArguments.CountValue--;
  458. OutArguments.Done = true;
  459. }
  460. }
  461. else
  462. {
  463. //OutArguments.CountValue--;
  464. OutArguments.Done = true;
  465. }
  466. }
  467. else
  468. #endif
  469. if (Arguments.SummaryItem->Kind == skAverage)
  470. {
  471. if (!VarIsNull(OutArguments.Value))
  472. {
  473. if (!VarSameValue(OutArguments.Value, Variant(0)))
  474. {
  475. OutArguments.CountValue++;
  476. //OutArguments.Value = Variant(0);
  477. OutArguments.SummaryValue += OutArguments.Value;
  478. OutArguments.Done = true;
  479. }
  480. else
  481. {
  482. //OutArguments.CountValue--;
  483. OutArguments.Done = true;
  484. }
  485. }
  486. else
  487. {
  488. //OutArguments.CountValue--;
  489. OutArguments.Done = true;
  490. }
  491. #if 0
  492. if (pPointDisplay)
  493. Arguments.SummaryItem->Format = sAvgCaption + "#,##0.0";
  494. else
  495. Arguments.SummaryItem->Format = sAvgCaption + "#,##0";
  496. #endif
  497. }
  498. #if 0
  499. else if (Arguments.SummaryItem->Kind == skSum)
  500. Arguments.SummaryItem->Format = sSumCaption + "#,##0.##";
  501. else if (Arguments.SummaryItem->Kind == skMin)
  502. Arguments.SummaryItem->Format = sMinCaption + "#,##0.##";
  503. else if (Arguments.SummaryItem->Kind == skMax)
  504. Arguments.SummaryItem->Format = sMaxCaption + "#,##0.##";
  505. else if (Arguments.SummaryItem->Kind == skCount)
  506. Arguments.SummaryItem->Format = "#,##0" + sCntCaption;
  507. #endif
  508. }
  509. //---------------------------------------------------------------------------
  510. ULONG ProcIDFromWnd(HWND hwnd) // 윈도우 핸들로 프로세스 아이디 얻기
  511. {
  512. ULONG idProc;
  513. GetWindowThreadProcessId( hwnd, &idProc );
  514. return idProc;
  515. }
  516. //----------------------------------------------------------------------------
  517. HWND GetWinHandle(ULONG pid) // 프로세스 아이디로 윈도우 핸들 얻기
  518. {
  519. HWND tempHwnd = FindWindow(NULL,NULL); // 최상위 윈도우 핸들 찾기
  520. while( tempHwnd != NULL )
  521. {
  522. if( GetParent(tempHwnd) == NULL ) // 최상위 핸들인지 체크, 버튼 등도 핸들을 가질 수 있으므로 무시하기 위해
  523. if( pid == ProcIDFromWnd(tempHwnd) )
  524. return tempHwnd;
  525. tempHwnd = GetWindow(tempHwnd, GW_HWNDNEXT); // 다음 윈도우 핸들 찾기
  526. }
  527. return NULL;
  528. }
  529. //----------------------------------------------------------------------------
  530. //DeleteLogFiles((PTCHAR)g_sLogDir.c_str(), 30, (PTCHAR)"*.*");
  531. //bool DeleteLogFiles(PTCHAR pszPath, int nDays, PTCHAR pszFile);
  532. #include <windows.h>
  533. #include <shlwapi.h>
  534. #pragma comment (lib, "shlwapi.lib")
  535. bool APP_IsDirectoryExists(LPCTSTR path)
  536. {
  537. return PathFileExists(path);
  538. #if 0
  539. struct _stat buffer;
  540. int iRetTemp = 0;
  541. memset((void*)&buffer, 0, sizeof(buffer));
  542. iRetTemp = _stat(path, &buffer);
  543. if (iRetTemp == 0)
  544. {
  545. if (buffer.st_mode & _S_IFDIR)
  546. {
  547. return true;
  548. }
  549. }
  550. return false;
  551. #endif
  552. }
  553. //---------------------------------------------------------------------------