00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109 #include "camtypes.h"
00110
00111 #ifdef DO_EXPORT
00112
00113 #include "fontman.h"
00114 #include "nodetext.h"
00115 #include "nodetxtl.h"
00116 #include "nodetxts.h"
00117 #include "cxftags.h"
00118
00119
00120
00121 #include "cxftext.h"
00122 #include "keypress.h"
00123 #include "vkextra.h"
00124
00125
00126 #include "attrmap.h"
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168 #define new CAM_DEBUG_NEW
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372 BOOL CXaraFileTxtStory::IsGuaranteedFont(BaseCamelotFilter *pFilter,String_64* pFontName)
00373 {
00374 #ifdef DO_EXPORT
00375 ERROR2IF(pFontName == NULL,FALSE,"NULL font name ptr");
00376
00377 String_256 GuaranteedFonts = pFilter->GetDontConvertTheseFontsToOutlinesString();
00378 String_64 GuaranteedFontName;
00379 String_64 Delimiters = _T(";");
00380 String_64 Str;
00381
00382 TCHAR* pTchar = cc_lstrtok(GuaranteedFonts,Delimiters);
00383 while (pTchar != NULL)
00384 {
00385 Str = pTchar;
00386 if (*pFontName == Str)
00387 return TRUE;
00388
00389 pTchar = cc_lstrtok(NULL,Delimiters);
00390 }
00391
00392 return FALSE;
00393 #else
00394 return FALSE;
00395 #endif
00396 }
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419 BOOL CXaraFileTxtStory::SiblingAndChildTypefaceAttrsAllGuaranteedFonts(BaseCamelotFilter *pFilter,Node* pNode)
00420 {
00421 #ifdef DO_EXPORT
00422 if (pNode == NULL)
00423 return TRUE;
00424
00425 String_64 FontName;
00426
00427 while (pNode != NULL)
00428 {
00429
00430 if (!IS_A(pNode,CaretNode) && !IS_A(pNode,EOLNode))
00431 {
00432 if (!SiblingAndChildTypefaceAttrsAllGuaranteedFonts(pFilter,pNode->FindFirstChild()))
00433 return FALSE;
00434 }
00435
00436 if (IS_A(pNode,AttrTxtFontTypeface))
00437 {
00438 AttrTxtFontTypeface* pTypefaceAttr = (AttrTxtFontTypeface*)pNode;
00439
00440 if (FONTMANAGER->GetFontName(pTypefaceAttr->Value.HTypeface, FontName))
00441 {
00442 if (!IsGuaranteedFont(pFilter,&FontName))
00443 return FALSE;
00444 }
00445 }
00446
00447 pNode = pNode->FindNext();
00448 }
00449
00450 return TRUE;
00451 #else
00452 return FALSE;
00453 #endif
00454 }
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475
00476
00477
00478
00479 BOOL CXaraFileTxtStory::MustConvertToOutlines(BaseCamelotFilter *pFilter, TextStory *pStory)
00480 {
00481 #ifdef DO_EXPORT
00482 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
00483 ERROR2IF(pStory==NULL, FALSE, "Parameter pFilter == NULL.");
00484
00485
00486
00487 String_256 GuaranteedFonts = pFilter->GetDontConvertTheseFontsToOutlinesString();
00488 if (GuaranteedFonts.IsEmpty())
00489 return TRUE;
00490
00491 BOOL Must = FALSE;
00492
00493 String_64 FontName;
00494
00495 CCAttrMap* pAttrMap = CCAttrMap::MakeAppliedAttrMap(pStory);
00496
00497 if (pAttrMap != NULL)
00498 {
00499 void* pValue=NULL;
00500 pAttrMap->Lookup(CC_RUNTIME_CLASS(AttrTxtFontTypeface),pValue);
00501 if (pValue != NULL)
00502 {
00503 AttrTxtFontTypeface* pTypefaceAttr = (AttrTxtFontTypeface*)pValue;
00504
00505 if (IS_A(pTypefaceAttr,AttrTxtFontTypeface))
00506 {
00507 if (FONTMANAGER->GetFontName(pTypefaceAttr->Value.HTypeface, FontName))
00508 {
00509 if (!IsGuaranteedFont(pFilter,&FontName))
00510 Must = TRUE;
00511 }
00512 }
00513 }
00514
00515
00516 delete pAttrMap;
00517 pAttrMap = NULL;
00518 }
00519
00520 if (!Must)
00521 Must = !SiblingAndChildTypefaceAttrsAllGuaranteedFonts(pFilter,pStory->FindFirstChild());
00522
00523 return Must;
00524 #else
00525 return FALSE;
00526 #endif
00527 }
00528
00529
00530
00531
00532
00533
00534
00535
00536
00537
00538
00539
00540
00541
00542
00543
00544
00545
00546
00547
00548
00549
00550
00551
00552
00553
00554
00555
00556 BOOL CXaraFileTxtStory::WritePreChildrenWeb(BaseCamelotFilter *pFilter, TextStory *pStory)
00557 {
00558 #ifdef DO_EXPORT
00559 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
00560 ERROR2IF(pStory==NULL, FALSE, "Parameter pFilter == NULL.");
00561
00562
00563
00564 if (!pStory->OKToExport())
00565 return FALSE;
00566
00567
00568
00569 if (pFilter->GetConvertTextToOutlines() && MustConvertToOutlines(pFilter,pStory))
00570 return pFilter->WriteNodeAsOutlines(pStory);
00571
00572
00573
00574
00575 return WriteTextStory(pFilter, pStory);
00576 #else
00577 return FALSE;
00578 #endif
00579 }
00580
00581 BOOL CXaraFileTxtStory::WritePreChildrenNative(BaseCamelotFilter *pFilter, TextStory *pStory)
00582 {
00583 #ifdef DO_EXPORT
00584 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
00585 ERROR2IF(pStory==NULL, FALSE, "Parameter pFilter == NULL.");
00586
00587
00588
00589 if (!pStory->OKToExport())
00590 return FALSE;
00591
00592 if (pFilter->IsCompactNativeFilter())
00593 {
00594
00595
00596 if (pFilter->GetConvertTextToOutlines() && MustConvertToOutlines(pFilter,pStory))
00597 return pFilter->WriteNodeAsOutlines(pStory);
00598
00599
00600
00601 }
00602
00603 return WriteTextStory(pFilter, pStory);
00604 #else
00605 return FALSE;
00606 #endif
00607 }
00608
00609 BOOL CXaraFileTxtStory::CanWriteChildrenWeb(BaseCamelotFilter* pFilter,TextStory *pStory)
00610 {
00611 #ifdef DO_EXPORT
00612 if (!pStory->OKToExport())
00613 return FALSE;
00614
00615 if (pFilter->GetConvertTextToOutlines() && MustConvertToOutlines(pFilter,pStory))
00616 return FALSE;
00617
00618 return TRUE;
00619 #else
00620 return FALSE;
00621 #endif
00622 }
00623
00624 BOOL CXaraFileTxtStory::CanWriteChildrenNative(BaseCamelotFilter* pFilter,TextStory *pStory)
00625 {
00626 #ifdef DO_EXPORT
00627 if (!pStory->OKToExport())
00628 return FALSE;
00629
00630 if (pFilter->IsCompactNativeFilter())
00631 {
00632 if (pFilter->GetConvertTextToOutlines() && MustConvertToOutlines(pFilter,pStory))
00633 return FALSE;
00634 }
00635
00636 return TRUE;
00637 #else
00638 return FALSE;
00639 #endif
00640 }
00641
00642 BOOL CXaraFileTxtStory::WriteTextStory(BaseCamelotFilter *pFilter, TextStory *pStory)
00643 {
00644 #ifdef DO_EXPORT
00645 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
00646 ERROR2IF(pStory==NULL, FALSE, "Parameter pFilter == NULL.");
00647
00648 BOOL ok;
00649
00650
00651
00652
00653
00654 if (pStory->GetTextPath() == NULL)
00655 {
00656
00657
00658 Matrix MyMatrix = pStory->GetStoryMatrix();
00659
00660 if (MyMatrix.IsTranslation(mEpsilon))
00661 {
00662 ok = WriteTextStorySimple(pFilter, pStory);
00663 }
00664 else
00665 {
00666 ok = WriteTextStoryComplex(pFilter, pStory);
00667 }
00668 }
00669 else
00670 {
00671 const INT32 COMPLEX = 0x1;
00672 const INT32 REVERSED = 0x2;
00673 const INT32 Y_REFLECTED = 0x4;
00674
00675 INT32 TextStoryType = 0;
00676
00677 {
00678 Matrix MyMatrix = pStory->GetStoryMatrix();
00679 ANGLE MyRotation = pStory->GetCharsRotation();
00680 ANGLE MyShear = pStory->GetCharsShear();
00681
00682 if (MyMatrix.IsTranslation(mEpsilon)==FALSE
00683 || MyRotation!=0
00684 || MyShear!=0) TextStoryType |= COMPLEX;
00685 }
00686
00687 if (pStory->IsTextOnPathReversed()) TextStoryType |= REVERSED;
00688
00689 if (pStory->GetCharsScale() < 0) TextStoryType |= Y_REFLECTED;
00690
00691 switch (TextStoryType)
00692 {
00693 case 0 : ok = WriteTextStorySimpleStartLeft(pFilter, pStory); break;
00694 case REVERSED : ok = WriteTextStorySimpleEndRight(pFilter, pStory); break;
00695 case Y_REFLECTED : ok = WriteTextStorySimpleStartRight(pFilter, pStory); break;
00696 case REVERSED|Y_REFLECTED : ok = WriteTextStorySimpleEndLeft(pFilter, pStory); break;
00697 case COMPLEX : ok = WriteTextStoryComplexStartLeft(pFilter, pStory); break;
00698 case COMPLEX|REVERSED : ok = WriteTextStoryComplexEndRight(pFilter, pStory); break;
00699 case COMPLEX|Y_REFLECTED : ok = WriteTextStoryComplexStartRight(pFilter, pStory); break;
00700 case COMPLEX|REVERSED|Y_REFLECTED : ok = WriteTextStoryComplexEndLeft(pFilter, pStory); break;
00701 default : ok = WriteTextStoryInvalid(pFilter, pStory); break;
00702 }
00703 }
00704
00705 return ok;
00706 #else
00707 return FALSE;
00708 #endif
00709 }
00710
00711 BOOL CXaraFileTxtStory::WriteTextStorySimple(BaseCamelotFilter *pFilter, TextStory *pStory)
00712 {
00713 #ifdef DO_EXPORT
00714 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
00715 ERROR2IF(pStory==NULL, FALSE, "Parameter pFilter == NULL.");
00716
00717 BOOL ok;
00718
00719 Matrix MyMatrix;
00720 DocCoord MyTranslation;
00721
00722 MyMatrix = pStory->GetStoryMatrix();
00723 MyMatrix.GetTranslation(MyTranslation);
00724
00725 CamelotFileRecord Rec(pFilter, TAG_TEXT_STORY_SIMPLE, TAG_TEXT_STORY_SIMPLE_SIZE);
00726 ok = Rec.Init();
00727 if (ok) ok = Rec.WriteCoord(MyTranslation);
00728 if (ok) ok = Rec.WriteINT32 ((INT32) pStory->IsAutoKerning ());
00729 if (ok) ok = pFilter->Write(&Rec);
00730
00731 return ok;
00732 #else
00733 return FALSE;
00734 #endif
00735 }
00736
00737 BOOL CXaraFileTxtStory::WriteTextStoryComplex(BaseCamelotFilter *pFilter, TextStory *pStory)
00738 {
00739 #ifdef DO_EXPORT
00740 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
00741 ERROR2IF(pStory==NULL, FALSE, "Parameter pFilter == NULL.");
00742
00743 BOOL ok;
00744
00745 CamelotFileRecord Rec(pFilter, TAG_TEXT_STORY_COMPLEX, TAG_TEXT_STORY_COMPLEX_SIZE);
00746 ok = Rec.Init();
00747 if (ok) ok = Rec.WriteMatrix(pStory->GetStoryMatrix());
00748 if (ok) ok = Rec.WriteINT32 ((INT32) pStory->IsAutoKerning ());
00749 if (ok) ok = pFilter->Write(&Rec);
00750
00751 return ok;
00752 #else
00753 return FALSE;
00754 #endif
00755 }
00756
00757 BOOL CXaraFileTxtStory::WriteTextStorySimpleStartLeft(BaseCamelotFilter *pFilter, TextStory *pStory)
00758 {
00759 #ifdef DO_EXPORT
00760 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
00761 ERROR2IF(pStory==NULL, FALSE, "Parameter pFilter == NULL.");
00762
00763 BOOL ok;
00764
00765 Matrix MyMatrix;
00766 DocCoord MyTranslation;
00767
00768 MyMatrix = pStory->GetStoryMatrix();
00769 MyMatrix.GetTranslation(MyTranslation);
00770
00771 CamelotFileRecord Rec(pFilter, TAG_TEXT_STORY_SIMPLE_START_LEFT, TAG_TEXT_STORY_SIMPLE_START_LEFT_SIZE);
00772 ok = Rec.Init();
00773
00774 if (ok) ok = Rec.WriteCoord(MyTranslation);
00775 if (ok) ok = Rec.WriteINT32 ((INT32) pStory->IsAutoKerning ());
00776 if (ok) ok = pFilter->Write(&Rec);
00777
00778 return ok;
00779 #else
00780 return FALSE;
00781 #endif
00782 }
00783
00784 BOOL CXaraFileTxtStory::WriteTextStorySimpleStartRight(BaseCamelotFilter *pFilter, TextStory *pStory)
00785 {
00786 #ifdef DO_EXPORT
00787 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
00788 ERROR2IF(pStory==NULL, FALSE, "Parameter pFilter == NULL.");
00789
00790 BOOL ok;
00791
00792 Matrix MyMatrix;
00793 DocCoord MyTranslation;
00794
00795 MyMatrix = pStory->GetStoryMatrix();
00796 MyMatrix.GetTranslation(MyTranslation);
00797
00798 CamelotFileRecord Rec(pFilter, TAG_TEXT_STORY_SIMPLE_START_RIGHT, TAG_TEXT_STORY_SIMPLE_START_RIGHT_SIZE);
00799 ok = Rec.Init();
00800
00801 if (ok) ok = Rec.WriteCoord(MyTranslation);
00802 if (ok) ok = Rec.WriteINT32 ((INT32) pStory->IsAutoKerning ());
00803 if (ok) ok = pFilter->Write(&Rec);
00804
00805 return ok;
00806 #else
00807 return FALSE;
00808 #endif
00809 }
00810
00811 BOOL CXaraFileTxtStory::WriteTextStorySimpleEndLeft(BaseCamelotFilter *pFilter, TextStory *pStory)
00812 {
00813 #ifdef DO_EXPORT
00814 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
00815 ERROR2IF(pStory==NULL, FALSE, "Parameter pFilter == NULL.");
00816
00817 BOOL ok;
00818
00819 Matrix MyMatrix;
00820 DocCoord MyTranslation;
00821
00822 MyMatrix = pStory->GetStoryMatrix();
00823 MyMatrix.GetTranslation(MyTranslation);
00824
00825 CamelotFileRecord Rec(pFilter, TAG_TEXT_STORY_SIMPLE_END_LEFT, TAG_TEXT_STORY_SIMPLE_END_LEFT_SIZE);
00826 ok = Rec.Init();
00827
00828 if (ok) ok = Rec.WriteCoord(MyTranslation);
00829 if (ok) ok = Rec.WriteINT32 ((INT32) pStory->IsAutoKerning ());
00830 if (ok) ok = pFilter->Write(&Rec);
00831
00832 return ok;
00833 #else
00834 return FALSE;
00835 #endif
00836 }
00837
00838 BOOL CXaraFileTxtStory::WriteTextStorySimpleEndRight(BaseCamelotFilter *pFilter, TextStory *pStory)
00839 {
00840 #ifdef DO_EXPORT
00841 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
00842 ERROR2IF(pStory==NULL, FALSE, "Parameter pFilter == NULL.");
00843
00844 BOOL ok;
00845
00846 Matrix MyMatrix;
00847 DocCoord MyTranslation;
00848
00849 MyMatrix = pStory->GetStoryMatrix();
00850 MyMatrix.GetTranslation(MyTranslation);
00851
00852 CamelotFileRecord Rec(pFilter, TAG_TEXT_STORY_SIMPLE_END_RIGHT, TAG_TEXT_STORY_SIMPLE_END_RIGHT_SIZE);
00853 ok = Rec.Init();
00854
00855 if (ok) ok = Rec.WriteCoord(MyTranslation);
00856 if (ok) ok = Rec.WriteINT32 ((INT32) pStory->IsAutoKerning ());
00857 if (ok) ok = pFilter->Write(&Rec);
00858
00859 return ok;
00860 #else
00861 return FALSE;
00862 #endif
00863 }
00864
00865 BOOL CXaraFileTxtStory::WriteTextStoryComplexStartLeft(BaseCamelotFilter *pFilter, TextStory *pStory)
00866 {
00867 #ifdef DO_EXPORT
00868 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
00869 ERROR2IF(pStory==NULL, FALSE, "Parameter pFilter == NULL.");
00870
00871 BOOL ok;
00872
00873 CamelotFileRecord Rec(pFilter, TAG_TEXT_STORY_COMPLEX_START_LEFT, TAG_TEXT_STORY_COMPLEX_START_LEFT_SIZE);
00874 ok = Rec.Init();
00875
00876 if (ok) ok = Rec.WriteMatrix(pStory->GetStoryMatrix());
00877 if (ok) ok = Rec.WriteANGLE(pStory->GetCharsRotation());
00878 if (ok) ok = Rec.WriteANGLE(pStory->GetCharsShear());
00879 if (ok) ok = Rec.WriteINT32 ((INT32) pStory->IsAutoKerning ());
00880
00881 if (ok) ok = pFilter->Write(&Rec);
00882
00883 return ok;
00884 #else
00885 return FALSE;
00886 #endif
00887 }
00888
00889 BOOL CXaraFileTxtStory::WriteTextStoryComplexStartRight(BaseCamelotFilter *pFilter, TextStory *pStory)
00890 {
00891 #ifdef DO_EXPORT
00892 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
00893 ERROR2IF(pStory==NULL, FALSE, "Parameter pFilter == NULL.");
00894
00895 BOOL ok;
00896
00897 CamelotFileRecord Rec(pFilter, TAG_TEXT_STORY_COMPLEX_START_RIGHT, TAG_TEXT_STORY_COMPLEX_START_RIGHT_SIZE);
00898 ok = Rec.Init();
00899
00900 if (ok) ok = Rec.WriteMatrix(pStory->GetStoryMatrix());
00901 if (ok) ok = Rec.WriteANGLE(pStory->GetCharsRotation());
00902 if (ok) ok = Rec.WriteANGLE(pStory->GetCharsShear());
00903 if (ok) ok = Rec.WriteINT32 ((INT32) pStory->IsAutoKerning ());
00904
00905 if (ok) ok = pFilter->Write(&Rec);
00906
00907 return ok;
00908 #else
00909 return FALSE;
00910 #endif
00911 }
00912
00913 BOOL CXaraFileTxtStory::WriteTextStoryComplexEndLeft(BaseCamelotFilter *pFilter, TextStory *pStory)
00914 {
00915 #ifdef DO_EXPORT
00916 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
00917 ERROR2IF(pStory==NULL, FALSE, "Parameter pFilter == NULL.");
00918
00919 BOOL ok;
00920
00921 CamelotFileRecord Rec(pFilter, TAG_TEXT_STORY_COMPLEX_END_LEFT, TAG_TEXT_STORY_COMPLEX_END_LEFT_SIZE);
00922 ok = Rec.Init();
00923
00924 if (ok) ok = Rec.WriteMatrix(pStory->GetStoryMatrix());
00925 if (ok) ok = Rec.WriteANGLE(pStory->GetCharsRotation());
00926 if (ok) ok = Rec.WriteANGLE(pStory->GetCharsShear());
00927 if (ok) ok = Rec.WriteINT32 ((INT32) pStory->IsAutoKerning ());
00928
00929 if (ok) ok = pFilter->Write(&Rec);
00930
00931 return ok;
00932 #else
00933 return FALSE;
00934 #endif
00935 }
00936
00937 BOOL CXaraFileTxtStory::WriteTextStoryComplexEndRight(BaseCamelotFilter *pFilter, TextStory *pStory)
00938 {
00939 #ifdef DO_EXPORT
00940 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
00941 ERROR2IF(pStory==NULL, FALSE, "Parameter pFilter == NULL.");
00942
00943 BOOL ok;
00944
00945 CamelotFileRecord Rec(pFilter, TAG_TEXT_STORY_COMPLEX_END_RIGHT, TAG_TEXT_STORY_COMPLEX_END_RIGHT_SIZE);
00946 ok = Rec.Init();
00947
00948 if (ok) ok = Rec.WriteMatrix(pStory->GetStoryMatrix());
00949 if (ok) ok = Rec.WriteANGLE(pStory->GetCharsRotation());
00950 if (ok) ok = Rec.WriteANGLE(pStory->GetCharsShear());
00951 if (ok) ok = Rec.WriteINT32 ((INT32) pStory->IsAutoKerning ());
00952
00953 if (ok) ok = pFilter->Write(&Rec);
00954
00955 return ok;
00956 #else
00957 return FALSE;
00958 #endif
00959 }
00960
00961 BOOL CXaraFileTxtStory::WriteTextStoryWordWrapInfo(BaseCamelotFilter *pFilter, TextStory *pStory)
00962 {
00963 #ifdef DO_EXPORT
00964 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
00965 ERROR2IF(pStory==NULL, FALSE, "Parameter pFilter == NULL.");
00966
00967 CamelotFileRecord Rec(pFilter, TAG_TEXT_STORY_WORD_WRAP_INFO, TAG_TEXT_STORY_WORD_WRAP_INFO_SIZE);
00968
00969 BOOL ok = Rec.Init();
00970 if (ok) ok = Rec.WriteINT32(pStory->GetStoryWidth());
00971 if (ok) ok = Rec.WriteBYTE(BYTE(pStory->IsWordWrapping() != 0));
00972 if (ok) ok = pFilter->Write(&Rec);
00973
00974 return ok;
00975 #else
00976 return FALSE;
00977 #endif
00978 }
00979
00980 BOOL CXaraFileTxtStory::WriteTextStoryIndentInfo(BaseCamelotFilter *pFilter, TextStory *pStory)
00981 {
00982 #ifdef DO_EXPORT
00983 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
00984 ERROR2IF(pStory==NULL, FALSE, "Parameter pFilter == NULL.");
00985
00986 CamelotFileRecord Rec(pFilter, TAG_TEXT_STORY_INDENT_INFO, TAG_TEXT_STORY_INDENT_INFO_SIZE);
00987
00988 MILLIPOINT LeftIndent = pStory->GetLeftIndent();
00989 MILLIPOINT RightIndent = pStory->GetRightIndent();
00990
00991 BOOL ok = Rec.Init();
00992 if (ok) ok = Rec.WriteINT32(LeftIndent);
00993 if (ok) ok = Rec.WriteINT32(RightIndent);
00994 if (ok) ok = pFilter->Write(&Rec);
00995
00996 return ok;
00997 #else
00998 return FALSE;
00999 #endif
01000 }
01001
01002 BOOL CXaraFileTxtStory::WriteTextStoryInvalid(BaseCamelotFilter *pFilter, TextStory *pStory)
01003 {
01004 #ifdef DO_EXPORT
01005 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
01006 ERROR2IF(pStory==NULL, FALSE, "Parameter pFilter == NULL.");
01007
01008 ERROR3("Unable to determine type of text story to write out - help!");
01009
01010 return FALSE;
01011 #else
01012 return FALSE;
01013 #endif
01014 }
01015
01016
01017
01018 BOOL CXaraFileTxtStory::WriteBeginChildRecordsWeb(BaseCamelotFilter *pFilter, TextStory *pStory)
01019 {
01020 #ifdef DO_EXPORT
01021 return WriteBeginChildRecordsNative(pFilter, pStory);
01022 #else
01023 return FALSE;
01024 #endif
01025 }
01026
01027 BOOL CXaraFileTxtStory::WriteBeginChildRecordsNative(BaseCamelotFilter *pFilter, TextStory *pStory)
01028 {
01029 #ifdef DO_EXPORT
01030 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
01031 ERROR2IF(pStory==NULL, FALSE, "Parameter pFilter == NULL.");
01032
01033
01034 BOOL ok = (pFilter->WriteZeroSizedRecord(TAG_DOWN));
01035 if (ok) ok = WriteTextStoryWordWrapInfo(pFilter,pStory);
01036 if (ok) ok = WriteTextStoryIndentInfo(pFilter,pStory);
01037
01038
01039 if (ok && pFilter->GetBoundsWriteLevel() >= BWL_COMPOUND)
01040 {
01041 DocRect Rect = pStory->GetBoundingRect();
01042
01043 CamelotFileRecord Rec(pFilter, TAG_OBJECTBOUNDS, TAG_OBJECTBOUNDS_SIZE);
01044 ok = Rec.Init();
01045 if (ok) ok = Rec.WriteCoord(Rect.lo);
01046 if (ok) ok = Rec.WriteCoord(Rect.hi);
01047 if (ok) ok = pFilter->Write(&Rec);
01048 }
01049
01050
01051 if (ok && pFilter->GetBoundsWriteLevel() >= BWL_COMPOUND)
01052 {
01053 DocRect Rect = pStory->GetBoundingRect();
01054
01055 CamelotFileRecord Rec(pFilter, TAG_OBJECTBOUNDS, TAG_OBJECTBOUNDS_SIZE);
01056 ok = Rec.Init();
01057 if (ok) ok = Rec.WriteCoord(Rect.lo);
01058 if (ok) ok = Rec.WriteCoord(Rect.hi);
01059 if (ok) ok = pFilter->Write(&Rec);
01060 }
01061
01062 return ok;
01063 #else
01064 return FALSE;
01065 #endif
01066 }
01067
01068 BOOL CXaraFileTxtStory::WriteEndChildRecordsWeb(BaseCamelotFilter *pFilter, TextStory *pStory)
01069 {
01070 #ifdef DO_EXPORT
01071 return WriteEndChildRecordsNative(pFilter, pStory);
01072 #else
01073 return FALSE;
01074 #endif
01075 }
01076
01077 BOOL CXaraFileTxtStory::WriteEndChildRecordsNative(BaseCamelotFilter *pFilter, TextStory *pStory)
01078 {
01079 #ifdef DO_EXPORT
01080 ERROR2IF(pFilter == NULL,FALSE,"NULL filter param");
01081 return pFilter->WriteZeroSizedRecord(TAG_UP);
01082 #else
01083 return FALSE;
01084 #endif
01085 }
01086
01087
01088
01089
01090
01091
01092
01093
01094
01095
01096
01097 const double CXaraFileTxtStory::mEpsilon = 0.000016;
01098
01099
01100
01101
01102
01103
01104
01105
01106
01107
01108
01109
01110
01111
01112
01113
01114 BOOL CXaraFileTxtLine::WritePreChildrenWeb(BaseCamelotFilter *pFilter, TextLine *pLine)
01115 {
01116 #ifdef DO_EXPORT
01117 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter==NULL");
01118 ERROR2IF(pLine==NULL, FALSE, "Parameter pLine==NULL");
01119
01120 return WriteTextLine(pFilter, pLine);
01121 #else
01122 return FALSE;
01123 #endif
01124 }
01125
01126 BOOL CXaraFileTxtLine::WritePreChildrenNative(BaseCamelotFilter *pFilter, TextLine *pLine)
01127 {
01128 #ifdef DO_EXPORT
01129 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter==NULL");
01130 ERROR2IF(pLine==NULL, FALSE, "Parameter pLine==NULL");
01131
01132 return WriteTextLine(pFilter, pLine);
01133 #else
01134 return FALSE;
01135 #endif
01136 }
01137
01138 BOOL CXaraFileTxtLine::WriteTextLine(BaseCamelotFilter *pFilter, TextLine *pLine)
01139 {
01140 #ifdef DO_EXPORT
01141 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter==NULL");
01142 ERROR2IF(pLine==NULL, FALSE, "Parameter pLine==NULL");
01143
01144
01145
01146
01147 BOOL ok;
01148
01149 CamelotFileRecord Rec(pFilter, TAG_TEXT_LINE, TAG_TEXT_LINE_SIZE);
01150 ok = Rec.Init();
01151 if (ok) ok = pFilter->Write(&Rec);
01152
01153 return ok;
01154 #else
01155 return FALSE;
01156 #endif
01157 }
01158
01159
01160
01161 BOOL CXaraFileTxtLine::WriteBeginChildRecordsWeb(BaseCamelotFilter *pFilter, TextLine *pLine)
01162 {
01163 #ifdef DO_EXPORT
01164 return WriteBeginChildRecordsNative(pFilter,pLine);
01165 #else
01166 return FALSE;
01167 #endif
01168 }
01169
01170 BOOL CXaraFileTxtLine::WriteBeginChildRecordsNative(BaseCamelotFilter *pFilter, TextLine *pLine)
01171 {
01172 #ifdef DO_EXPORT
01173 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter==NULL");
01174 ERROR2IF(pLine==NULL, FALSE, "Parameter pLine==NULL");
01175
01176
01177 BOOL ok = (pFilter->WriteZeroSizedRecord(TAG_DOWN));
01178
01179
01180 MILLIPOINT DistFromPreviousLine = pLine->GetPosInStory();
01181 TextLine* pPrevLine = pLine->FindPrevLine();
01182 if (pPrevLine != NULL)
01183 DistFromPreviousLine -= pPrevLine->GetPosInStory();
01184
01185 DocRect Rect = pLine->GetBoundingRect();
01186
01187 CamelotFileRecord Rec(pFilter,TAG_TEXT_LINE_INFO,TAG_TEXT_LINE_INFO_SIZE);
01188
01189 if (ok) ok = Rec.Init();
01190 if (ok) ok = Rec.WriteINT32(Rect.Width());
01191 if (ok) ok = Rec.WriteINT32(Rect.Height());
01192 if (ok) ok = Rec.WriteINT32(DistFromPreviousLine);
01193 if (ok) ok = pFilter->Write(&Rec);
01194
01195 return ok;
01196 #else
01197 return FALSE;
01198 #endif
01199 }
01200
01201 BOOL CXaraFileTxtLine::WriteEndChildRecordsWeb(BaseCamelotFilter *pFilter, TextLine *pLine)
01202 {
01203 #ifdef DO_EXPORT
01204 return WriteEndChildRecordsNative(pFilter,pLine);
01205 #else
01206 return FALSE;
01207 #endif
01208 }
01209
01210 BOOL CXaraFileTxtLine::WriteEndChildRecordsNative(BaseCamelotFilter *pFilter, TextLine *pLine)
01211 {
01212 #ifdef DO_EXPORT
01213 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter==NULL");
01214 return (pFilter->WriteZeroSizedRecord(TAG_UP));
01215 #else
01216 return FALSE;
01217 #endif
01218 }
01219
01220
01221
01222
01223
01224
01225
01226
01227
01228
01229
01230
01231
01232
01233
01234
01235
01236 BOOL CXaraFileTxtChar::WritePreChildrenWeb(BaseCamelotFilter *pFilter, TextChar *pChar)
01237 {
01238 #ifdef DO_EXPORT
01239 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter==NULL");
01240 ERROR2IF(pChar==NULL, FALSE, "Parameter pChar==NULL");
01241
01242 return WriteTextChar(pFilter, pChar);
01243 #else
01244 return FALSE;
01245 #endif
01246 }
01247
01248 BOOL CXaraFileTxtChar::WritePreChildrenNative(BaseCamelotFilter *pFilter, TextChar *pChar)
01249 {
01250 #ifdef DO_EXPORT
01251 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter==NULL");
01252 ERROR2IF(pChar==NULL, FALSE, "Parameter pChar==NULL");
01253
01254 return WriteTextChar(pFilter, pChar);
01255 #else
01256 return FALSE;
01257 #endif
01258 }
01259
01260 BOOL CXaraFileTxtChar::WriteTextChar(BaseCamelotFilter *pFilter, TextChar *pChar)
01261 {
01262 #ifdef DO_EXPORT
01263 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter==NULL");
01264 ERROR2IF(pChar==NULL, FALSE, "Parameter pChar==NULL");
01265
01266 BOOL ok = TRUE;
01267 BOOL TryAString = TRUE;
01268
01269
01270
01271
01272
01273
01274
01275 if (pChar->AlreadyWritten())
01276 return FALSE;
01277
01278
01279 CamelotFileRecord Rec(pFilter, TAG_TEXT_STRING, TAG_TEXT_STRING_SIZE);
01280 if (ok) ok = Rec.Init();
01281 if (ok) ok = Rec.WriteWCHAR(pChar->GetUnicodeValue());
01282
01283
01284
01285 #ifdef _DEBUG
01286 if (KeyPress::IsKeyPressed(CAMKEY(S)))
01287 TryAString = FALSE;
01288 #endif
01289
01290
01291 if (ok && TryAString)
01292 {
01293
01294 UINT32 ChildCount, ChildAttrCount;
01295 pChar->CountChildNodes(&ChildCount,&ChildAttrCount);
01296
01297
01298
01299 if (ChildCount == ChildAttrCount)
01300 {
01301 BOOL CharWritten = TRUE;
01302 Node* pNextNode = pChar->FindNext();
01303
01304
01305
01306
01307
01308
01309 while (ok && CharWritten && pNextNode != NULL && pNextNode->IsATextChar())
01310 {
01311 CharWritten = FALSE;
01312 TextChar* pNextChar = (TextChar*)pNextNode;
01313
01314
01315 UINT32 NextChildCount, NextChildAttrCount;
01316 pNextChar->CountChildNodes(&NextChildCount,&NextChildAttrCount);
01317
01318
01319
01320
01321 if (NextChildCount == NextChildAttrCount && NextChildAttrCount == ChildAttrCount)
01322 {
01323
01324
01325 if (pChar->AreChildAttrsIdentical(pNextChar))
01326 {
01327
01328 CharWritten = ok = Rec.WriteWCHAR(pNextChar->GetUnicodeValue());
01329
01330
01331 pNextChar->SetAlreadyWritten(CharWritten);
01332 }
01333 }
01334
01335
01336 pNextNode = pNextChar->FindNext();
01337 }
01338 }
01339 }
01340
01341
01342
01343
01344
01345 if (ok && Rec.GetSize() == 2)
01346 {
01347 ok = Rec.Reinit(TAG_TEXT_CHAR,TAG_TEXT_CHAR_SIZE);
01348 if (ok) ok = Rec.WriteWCHAR(pChar->GetUnicodeValue());
01349 }
01350
01351 if (ok) ok = (pFilter->Write(&Rec) != 0);
01352
01353 return ok;
01354 #else
01355 return FALSE;
01356 #endif
01357 }
01358
01359
01360
01361
01362
01363
01364
01365
01366
01367
01368
01369
01370
01371
01372
01373
01374 BOOL CXaraFileTxtKern::WritePreChildrenWeb(BaseCamelotFilter *pFilter, KernCode *pKern)
01375 {
01376 #ifdef DO_EXPORT
01377 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter==NULL");
01378 ERROR2IF(pKern==NULL, FALSE, "Parameter pKern==NULL");
01379
01380 return WriteTextKern(pFilter, pKern);
01381 #else
01382 return FALSE;
01383 #endif
01384 }
01385
01386 BOOL CXaraFileTxtKern::WritePreChildrenNative(BaseCamelotFilter *pFilter, KernCode *pKern)
01387 {
01388 #ifdef DO_EXPORT
01389 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter==NULL");
01390 ERROR2IF(pKern==NULL, FALSE, "Parameter pKern==NULL");
01391
01392 return WriteTextKern(pFilter, pKern);
01393 #else
01394 return FALSE;
01395 #endif
01396 }
01397
01398 BOOL CXaraFileTxtKern::WriteTextKern(BaseCamelotFilter *pFilter, KernCode *pKern)
01399 {
01400 #ifdef DO_EXPORT
01401 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter==NULL");
01402 ERROR2IF(pKern==NULL, FALSE, "Parameter pChar==NULL");
01403
01404 BOOL ok;
01405
01406 CamelotFileRecord Rec(pFilter, TAG_TEXT_KERN, TAG_TEXT_KERN_SIZE);
01407 ok = Rec.Init();
01408 if (ok) ok = Rec.WriteCoordTrans(pKern->GetValue(),0,0);
01409 if (ok) ok = pFilter->Write(&Rec);
01410
01411 return ok;
01412 #else
01413 return FALSE;
01414 #endif
01415 }
01416
01417
01418
01419
01420
01421
01422
01423
01424
01425
01426
01427
01428
01429
01430
01431
01432 BOOL CXaraFileTxtTab::WritePreChildrenWeb(BaseCamelotFilter *pFilter, HorizontalTab *pTab)
01433 {
01434 #ifdef DO_EXPORT
01435 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter==NULL");
01436 ERROR2IF(pTab==NULL, FALSE, "Parameter pTab==NULL");
01437
01438 return WriteTextTab(pFilter, pTab);
01439 #else
01440 return FALSE;
01441 #endif
01442 }
01443
01444 BOOL CXaraFileTxtTab::WritePreChildrenNative(BaseCamelotFilter *pFilter, HorizontalTab *pTab)
01445 {
01446 #ifdef DO_EXPORT
01447 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter==NULL");
01448 ERROR2IF(pTab==NULL, FALSE, "Parameter pTab==NULL");
01449
01450 return WriteTextTab(pFilter, pTab);
01451 #else
01452 return FALSE;
01453 #endif
01454 }
01455
01456 BOOL CXaraFileTxtTab::WriteTextTab(BaseCamelotFilter *pFilter, HorizontalTab *pTab)
01457 {
01458 #ifdef DO_EXPORT
01459 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter==NULL");
01460 ERROR2IF(pTab==NULL, FALSE, "Parameter pChar==NULL");
01461
01462 BOOL ok;
01463
01464 CamelotFileRecord Rec(pFilter, TAG_TEXT_TAB, TAG_TEXT_TAB_SIZE);
01465 ok = Rec.Init();
01466 if (ok) ok = pFilter->Write(&Rec);
01467
01468 return ok;
01469 #else
01470 return FALSE;
01471 #endif
01472 }
01473
01474
01475
01476
01477
01478
01479
01480
01481
01482
01483
01484
01485
01486
01487
01488
01489 BOOL CXaraFileTxtCaret::WritePreChildrenWeb(BaseCamelotFilter *pFilter, CaretNode *pCaret)
01490 {
01491
01492
01493
01494
01495
01496
01497 return FALSE;
01498 }
01499
01500 BOOL CXaraFileTxtCaret::WritePreChildrenNative(BaseCamelotFilter *pFilter, CaretNode *pCaret)
01501 {
01502
01503
01504
01505
01506
01507
01508 return FALSE;
01509 }
01510
01511 BOOL CXaraFileTxtCaret::WriteTextCaret(BaseCamelotFilter *pFilter, CaretNode *pCaret)
01512 {
01513
01514
01515
01516
01517
01518
01519
01520
01521
01522
01523
01524
01525 return FALSE;
01526 }
01527
01528
01529
01530
01531
01532
01533
01534
01535
01536
01537
01538
01539
01540
01541
01542
01543 BOOL CXaraFileTxtEOL::WritePreChildrenWeb(BaseCamelotFilter *pFilter, EOLNode *pEOL)
01544 {
01545 #ifdef DO_EXPORT
01546 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter==NULL");
01547 ERROR2IF(pEOL==NULL, FALSE, "Parameter pEOL==NULL");
01548
01549 return WriteTextEOL(pFilter, pEOL);
01550 #else
01551 return FALSE;
01552 #endif
01553 }
01554
01555 BOOL CXaraFileTxtEOL::WritePreChildrenNative(BaseCamelotFilter *pFilter, EOLNode *pEOL)
01556 {
01557 #ifdef DO_EXPORT
01558 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter==NULL");
01559 ERROR2IF(pEOL==NULL, FALSE, "Parameter pEOL==NULL");
01560
01561 return WriteTextEOL(pFilter, pEOL);
01562 #else
01563 return FALSE;
01564 #endif
01565 }
01566
01567 BOOL CXaraFileTxtEOL::WriteTextEOL(BaseCamelotFilter *pFilter, EOLNode *pEOL)
01568 {
01569 #ifdef DO_EXPORT
01570 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter==NULL");
01571 ERROR2IF(pEOL==NULL, FALSE, "Parameter pEOL==NULL");
01572
01573 BOOL ok;
01574
01575 CamelotFileRecord Rec(pFilter, TAG_TEXT_EOL, TAG_TEXT_EOL_SIZE);
01576 ok = Rec.Init();
01577 if (ok) ok = pFilter->Write(&Rec);
01578
01579
01580
01581
01582
01583 return ok;
01584 #else
01585 return FALSE;
01586 #endif
01587 }
01588
01589
01590
01591
01592
01593
01594
01595
01596
01597
01598
01599
01600
01601
01602
01603
01604 BOOL CXaraFileTxtBold::WritePreChildrenWeb(BaseCamelotFilter *pFilter, AttrTxtBold *pAttr)
01605 {
01606 #ifdef DO_EXPORT
01607 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
01608 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
01609
01610 return WritePreChildrenAux(pFilter, pAttr);
01611 #else
01612 return FALSE;
01613 #endif
01614 }
01615
01616 BOOL CXaraFileTxtBold::WritePreChildrenNative(BaseCamelotFilter *pFilter, AttrTxtBold *pAttr)
01617 {
01618 #ifdef DO_EXPORT
01619 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
01620 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
01621
01622 return WritePreChildrenAux(pFilter, pAttr);
01623 #else
01624 return FALSE;
01625 #endif
01626 }
01627
01628 BOOL CXaraFileTxtBold::WritePreChildrenAux(BaseCamelotFilter *pFilter, AttrTxtBold *pAttr)
01629 {
01630 #ifdef DO_EXPORT
01631 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
01632 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
01633
01634 BOOL ok;
01635
01636 if (pAttr->Value.BoldOn != FALSE)
01637 {
01638 CamelotFileRecord Rec(pFilter, TAG_TEXT_BOLD_ON, TAG_TEXT_BOLD_ON_SIZE);
01639 ok = Rec.Init();
01640 if (ok) ok = pFilter->Write(&Rec);
01641 }
01642 else
01643 {
01644 CamelotFileRecord Rec(pFilter, TAG_TEXT_BOLD_OFF, TAG_TEXT_BOLD_OFF_SIZE);
01645 ok = Rec.Init();
01646 if (ok) ok = pFilter->Write(&Rec);
01647 }
01648
01649 return ok;
01650 #else
01651 return FALSE;
01652 #endif
01653 }
01654
01655
01656
01657
01658
01659
01660
01661
01662
01663
01664
01665
01666
01667
01668
01669
01670 BOOL CXaraFileTxtFontTypeface::WritePreChildrenWeb(BaseCamelotFilter *pFilter, AttrTxtFontTypeface *pAttr)
01671 {
01672 #ifdef DO_EXPORT
01673 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
01674 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
01675
01676 return WritePreChildrenAux(pFilter, pAttr);
01677 #else
01678 return FALSE;
01679 #endif
01680 }
01681
01682 BOOL CXaraFileTxtFontTypeface::WritePreChildrenNative(BaseCamelotFilter *pFilter, AttrTxtFontTypeface *pAttr)
01683 {
01684 #ifdef DO_EXPORT
01685 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
01686 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
01687
01688 return WritePreChildrenAux(pFilter, pAttr);
01689 #else
01690 return FALSE;
01691 #endif
01692 }
01693
01694 BOOL CXaraFileTxtFontTypeface::WritePreChildrenAux(BaseCamelotFilter *pFilter, AttrTxtFontTypeface *pAttr)
01695 {
01696 #ifdef DO_EXPORT
01697 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
01698 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
01699
01700 BOOL ok;
01701
01702 INT32 FontRecordRef = pFilter->WriteFontDefinition(pAttr->Value.HTypeface, pAttr->Value.IsBold, pAttr->Value.IsItalic);
01703
01704 if (FontRecordRef == 0)
01705 {
01706 ok = FALSE;
01707 }
01708 else
01709 {
01710 CamelotFileRecord Rec(pFilter, TAG_TEXT_FONT_TYPEFACE, TAG_TEXT_FONT_TYPEFACE_SIZE);
01711 ok = Rec.Init();
01712 if (ok) ok = Rec.WriteReference(FontRecordRef);
01713 if (ok) ok = pFilter->Write(&Rec);
01714 }
01715
01716 return ok;
01717 #else
01718 return FALSE;
01719 #endif
01720 }
01721
01722
01723
01724
01725
01726
01727
01728
01729
01730
01731
01732
01733
01734
01735
01736
01737 BOOL CXaraFileTxtItalic::WritePreChildrenWeb(BaseCamelotFilter *pFilter, AttrTxtItalic *pAttr)
01738 {
01739 #ifdef DO_EXPORT
01740 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
01741 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
01742
01743 return WritePreChildrenAux(pFilter, pAttr);
01744 #else
01745 return FALSE;
01746 #endif
01747 }
01748
01749 BOOL CXaraFileTxtItalic::WritePreChildrenNative(BaseCamelotFilter *pFilter, AttrTxtItalic *pAttr)
01750 {
01751 #ifdef DO_EXPORT
01752 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
01753 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
01754
01755 return WritePreChildrenAux(pFilter, pAttr);
01756 #else
01757 return FALSE;
01758 #endif
01759 }
01760
01761 BOOL CXaraFileTxtItalic::WritePreChildrenAux(BaseCamelotFilter *pFilter, AttrTxtItalic *pAttr)
01762 {
01763 #ifdef DO_EXPORT
01764 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
01765 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
01766
01767 BOOL ok;
01768
01769 if (pAttr->Value.ItalicOn != FALSE)
01770 {
01771 CamelotFileRecord Rec(pFilter, TAG_TEXT_ITALIC_ON, TAG_TEXT_ITALIC_ON_SIZE);
01772 ok = Rec.Init();
01773 if (ok) ok = pFilter->Write(&Rec);
01774 }
01775 else
01776 {
01777 CamelotFileRecord Rec(pFilter, TAG_TEXT_ITALIC_OFF, TAG_TEXT_ITALIC_OFF_SIZE);
01778 ok = Rec.Init();
01779 if (ok) ok = pFilter->Write(&Rec);
01780 }
01781
01782 return ok;
01783 #else
01784 return FALSE;
01785 #endif
01786 }
01787
01788
01789
01790
01791
01792
01793
01794
01795
01796
01797
01798
01799
01800
01801
01802
01803 BOOL CXaraFileTxtUnderline::WritePreChildrenWeb(BaseCamelotFilter *pFilter, AttrTxtUnderline *pAttr)
01804 {
01805 #ifdef DO_EXPORT
01806 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
01807 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
01808
01809 return WritePreChildrenAux(pFilter, pAttr);
01810 #else
01811 return FALSE;
01812 #endif
01813 }
01814
01815 BOOL CXaraFileTxtUnderline::WritePreChildrenNative(BaseCamelotFilter *pFilter, AttrTxtUnderline *pAttr)
01816 {
01817 #ifdef DO_EXPORT
01818 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
01819 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
01820
01821 return WritePreChildrenAux(pFilter, pAttr);
01822 #else
01823 return FALSE;
01824 #endif
01825 }
01826
01827 BOOL CXaraFileTxtUnderline::WritePreChildrenAux(BaseCamelotFilter *pFilter, AttrTxtUnderline *pAttr)
01828 {
01829 #ifdef DO_EXPORT
01830 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
01831 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
01832
01833
01834
01835
01836
01837
01838
01839
01840
01841
01842
01843
01844
01845
01846
01847
01848
01849
01850
01851
01852
01853 return TRUE;
01854 #else
01855 return FALSE;
01856 #endif
01857 }
01858
01859
01860
01861
01862
01863
01864
01865
01866
01867
01868
01869
01870
01871
01872
01873
01874 BOOL CXaraFileTxtAspectRatio::WritePreChildrenWeb(BaseCamelotFilter *pFilter, AttrTxtAspectRatio *pAttr)
01875 {
01876 #ifdef DO_EXPORT
01877 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
01878 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
01879
01880 return WritePreChildrenAux(pFilter, pAttr);
01881 #else
01882 return FALSE;
01883 #endif
01884 }
01885
01886 BOOL CXaraFileTxtAspectRatio::WritePreChildrenNative(BaseCamelotFilter *pFilter, AttrTxtAspectRatio *pAttr)
01887 {
01888 #ifdef DO_EXPORT
01889 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
01890 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
01891
01892 return WritePreChildrenAux(pFilter, pAttr);
01893 #else
01894 return FALSE;
01895 #endif
01896 }
01897
01898 BOOL CXaraFileTxtAspectRatio::WritePreChildrenAux(BaseCamelotFilter *pFilter, AttrTxtAspectRatio *pAttr)
01899 {
01900 #ifdef DO_EXPORT
01901 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
01902 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
01903
01904 BOOL ok;
01905
01906 CamelotFileRecord Rec(pFilter, TAG_TEXT_ASPECT_RATIO, TAG_TEXT_ASPECT_RATIO_SIZE);
01907 ok = Rec.Init();
01908 if (ok) ok = Rec.WriteFIXED16(pAttr->Value.AspectRatio);
01909 if (ok) ok = pFilter->Write(&Rec);
01910
01911 return ok;
01912 #else
01913 return FALSE;
01914 #endif
01915 }
01916
01917
01918
01919
01920
01921
01922
01923
01924
01925
01926
01927
01928
01929
01930
01931
01932 BOOL CXaraFileTxtJustification::WritePreChildrenWeb(BaseCamelotFilter *pFilter, AttrTxtJustification *pAttr)
01933 {
01934 #ifdef DO_EXPORT
01935 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
01936 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
01937
01938 return WritePreChildrenAux(pFilter, pAttr);
01939 #else
01940 return FALSE;
01941 #endif
01942 }
01943
01944 BOOL CXaraFileTxtJustification::WritePreChildrenNative(BaseCamelotFilter *pFilter, AttrTxtJustification *pAttr)
01945 {
01946 #ifdef DO_EXPORT
01947 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
01948 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
01949
01950 return WritePreChildrenAux(pFilter, pAttr);
01951 #else
01952 return FALSE;
01953 #endif
01954 }
01955
01956 BOOL CXaraFileTxtJustification::WritePreChildrenAux(BaseCamelotFilter *pFilter, AttrTxtJustification *pAttr)
01957 {
01958 #ifdef DO_EXPORT
01959 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
01960 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
01961
01962 BOOL ok;
01963
01964 switch (pAttr->Value.justification)
01965 {
01966 case JLEFT :
01967 {
01968 CamelotFileRecord Rec(pFilter, TAG_TEXT_JUSTIFICATION_LEFT, TAG_TEXT_JUSTIFICATION_LEFT_SIZE);
01969 ok = Rec.Init();
01970 if (ok) ok = pFilter->Write(&Rec);
01971 }
01972 break;
01973 case JRIGHT :
01974 {
01975 CamelotFileRecord Rec(pFilter, TAG_TEXT_JUSTIFICATION_RIGHT, TAG_TEXT_JUSTIFICATION_RIGHT_SIZE);
01976 ok = Rec.Init();
01977 if (ok) ok = pFilter->Write(&Rec);
01978 }
01979 break;
01980 case JCENTRE :
01981 {
01982 CamelotFileRecord Rec(pFilter, TAG_TEXT_JUSTIFICATION_CENTRE, TAG_TEXT_JUSTIFICATION_CENTRE_SIZE);
01983 ok = Rec.Init();
01984 if (ok) ok = pFilter->Write(&Rec);
01985 }
01986 break;
01987 case JFULL :
01988 {
01989 CamelotFileRecord Rec(pFilter, TAG_TEXT_JUSTIFICATION_FULL, TAG_TEXT_JUSTIFICATION_FULL_SIZE);
01990 ok = Rec.Init();
01991 if (ok) ok = pFilter->Write(&Rec);
01992 }
01993 break;
01994 default :
01995 ERROR3("Unknown justification attribute.");
01996 ok = FALSE;
01997 break;
01998 }
01999
02000 return ok;
02001 #else
02002 return FALSE;
02003 #endif
02004 }
02005
02006
02007
02008
02009
02010
02011
02012
02013
02014
02015
02016
02017
02018
02019
02020
02021 BOOL CXaraFileTxtTracking::WritePreChildrenWeb(BaseCamelotFilter *pFilter, AttrTxtTracking *pAttr)
02022 {
02023 #ifdef DO_EXPORT
02024 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
02025 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
02026
02027 return WritePreChildrenAux(pFilter, pAttr);
02028 #else
02029 return FALSE;
02030 #endif
02031 }
02032
02033 BOOL CXaraFileTxtTracking::WritePreChildrenNative(BaseCamelotFilter *pFilter, AttrTxtTracking *pAttr)
02034 {
02035 #ifdef DO_EXPORT
02036 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
02037 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
02038
02039 return WritePreChildrenAux(pFilter, pAttr);
02040 #else
02041 return FALSE;
02042 #endif
02043 }
02044
02045 BOOL CXaraFileTxtTracking::WritePreChildrenAux(BaseCamelotFilter *pFilter, AttrTxtTracking *pAttr)
02046 {
02047 #ifdef DO_EXPORT
02048 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
02049 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
02050
02051 BOOL ok;
02052
02053 CamelotFileRecord Rec(pFilter, TAG_TEXT_TRACKING, TAG_TEXT_TRACKING_SIZE);
02054 ok = Rec.Init();
02055 if (ok) ok = Rec.WriteINT32(pAttr->Value.Tracking);
02056 if (ok) ok = pFilter->Write(&Rec);
02057
02058 return ok;
02059 #else
02060 return FALSE;
02061 #endif
02062 }
02063
02064
02065
02066
02067
02068
02069
02070
02071
02072
02073
02074
02075
02076
02077
02078
02079 BOOL CXaraFileTxtFontSize::WritePreChildrenWeb(BaseCamelotFilter *pFilter, AttrTxtFontSize *pAttr)
02080 {
02081 #ifdef DO_EXPORT
02082 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
02083 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
02084
02085 return WritePreChildrenAux(pFilter, pAttr);
02086 #else
02087 return FALSE;
02088 #endif
02089 }
02090
02091 BOOL CXaraFileTxtFontSize::WritePreChildrenNative(BaseCamelotFilter *pFilter, AttrTxtFontSize *pAttr)
02092 {
02093 #ifdef DO_EXPORT
02094 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
02095 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
02096
02097 return WritePreChildrenAux(pFilter, pAttr);
02098 #else
02099 return FALSE;
02100 #endif
02101 }
02102
02103 BOOL CXaraFileTxtFontSize::WritePreChildrenAux(BaseCamelotFilter *pFilter, AttrTxtFontSize *pAttr)
02104 {
02105 #ifdef DO_EXPORT
02106 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
02107 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
02108
02109 BOOL ok;
02110
02111 CamelotFileRecord Rec(pFilter, TAG_TEXT_FONT_SIZE, TAG_TEXT_FONT_SIZE_SIZE);
02112 ok = Rec.Init();
02113 if (ok) ok = Rec.WriteINT32(pAttr->Value.FontSize);
02114 if (ok) ok = pFilter->Write(&Rec);
02115
02116 return ok;
02117 #else
02118 return FALSE;
02119 #endif
02120 }
02121
02122
02123
02124
02125
02126
02127
02128
02129
02130
02131
02132
02133
02134
02135
02136
02137 BOOL CXaraFileTxtScript::WritePreChildrenWeb(BaseCamelotFilter *pFilter, AttrTxtScript *pAttr)
02138 {
02139 #ifdef DO_EXPORT
02140 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
02141 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
02142
02143 return WritePreChildrenAux(pFilter, pAttr);
02144 #else
02145 return FALSE;
02146 #endif
02147 }
02148
02149 BOOL CXaraFileTxtScript::WritePreChildrenNative(BaseCamelotFilter *pFilter, AttrTxtScript *pAttr)
02150 {
02151 #ifdef DO_EXPORT
02152 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
02153 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
02154
02155 return WritePreChildrenAux(pFilter, pAttr);
02156 #else
02157 return FALSE;
02158 #endif
02159 }
02160
02161 BOOL CXaraFileTxtScript::WritePreChildrenAux(BaseCamelotFilter *pFilter, AttrTxtScript *pAttr)
02162 {
02163 #ifdef DO_EXPORT
02164 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
02165 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
02166
02167 BOOL ok;
02168
02169 if (pAttr->Value.Offset == 0 && pAttr->Value.Size == 1)
02170 {
02171 CamelotFileRecord Rec(pFilter, TAG_TEXT_SCRIPT_OFF, TAG_TEXT_SCRIPT_OFF_SIZE);
02172 ok = Rec.Init();
02173 if (ok) ok = pFilter->Write(&Rec);
02174 }
02175 else if (pAttr->Value.Offset == FIXED16(Text_SuperScriptOffset)
02176 && pAttr->Value.Size == FIXED16(Text_SuperScriptSize))
02177 {
02178 CamelotFileRecord Rec(pFilter, TAG_TEXT_SUPERSCRIPT_ON, TAG_TEXT_SUPERSCRIPT_ON_SIZE);
02179 ok = Rec.Init();
02180 if (ok) ok = pFilter->Write(&Rec);
02181 }
02182 else if (pAttr->Value.Offset == FIXED16(Text_SubScriptOffset)
02183 && pAttr->Value.Size == FIXED16(Text_SubScriptSize))
02184 {
02185 CamelotFileRecord Rec(pFilter, TAG_TEXT_SUBSCRIPT_ON, TAG_TEXT_SUBSCRIPT_ON_SIZE);
02186 ok = Rec.Init();
02187 if (ok) ok = pFilter->Write(&Rec);
02188 }
02189 else
02190 {
02191 CamelotFileRecord Rec(pFilter, TAG_TEXT_SCRIPT_ON, TAG_TEXT_SCRIPT_ON_SIZE);
02192 ok = Rec.Init();
02193 if (ok) ok = Rec.WriteFIXED16(pAttr->Value.Offset);
02194 if (ok) ok = Rec.WriteFIXED16(pAttr->Value.Size);
02195 if (ok) ok = pFilter->Write(&Rec);
02196 }
02197
02198 return ok;
02199 #else
02200 return FALSE;
02201 #endif
02202 }
02203
02204
02205
02206
02207
02208
02209
02210
02211
02212
02213
02214
02215
02216
02217
02218
02219 BOOL CXaraFileTxtBaseLine::WritePreChildrenWeb(BaseCamelotFilter *pFilter, AttrTxtBaseLine *pAttr)
02220 {
02221 #ifdef DO_EXPORT
02222 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
02223 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
02224
02225 return WritePreChildrenAux(pFilter, pAttr);
02226 #else
02227 return FALSE;
02228 #endif
02229 }
02230
02231 BOOL CXaraFileTxtBaseLine::WritePreChildrenNative(BaseCamelotFilter *pFilter, AttrTxtBaseLine *pAttr)
02232 {
02233 #ifdef DO_EXPORT
02234 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
02235 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
02236
02237 return WritePreChildrenAux(pFilter, pAttr);
02238 #else
02239 return FALSE;
02240 #endif
02241 }
02242
02243 BOOL CXaraFileTxtBaseLine::WritePreChildrenAux(BaseCamelotFilter *pFilter, AttrTxtBaseLine *pAttr)
02244 {
02245 #ifdef DO_EXPORT
02246 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
02247 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
02248
02249 BOOL ok;
02250
02251 CamelotFileRecord Rec(pFilter, TAG_TEXT_BASELINE, TAG_TEXT_BASELINE_SIZE);
02252 ok = Rec.Init();
02253 if (ok) ok = Rec.WriteINT32(pAttr->Value.Value);
02254 if (ok) ok = pFilter->Write(&Rec);
02255
02256 return ok;
02257 #else
02258 return FALSE;
02259 #endif
02260 }
02261
02262
02263
02264
02265
02266
02267
02268
02269
02270
02271
02272
02273
02274
02275
02276
02277 BOOL CXaraFileTxtLeftMargin::WritePreChildrenWeb(BaseCamelotFilter *pFilter, AttrTxtLeftMargin *pAttr)
02278 {
02279 #ifdef DO_EXPORT
02280 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
02281 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
02282
02283 return WritePreChildrenAux(pFilter, pAttr);
02284 #else
02285 return FALSE;
02286 #endif
02287 }
02288
02289 BOOL CXaraFileTxtLeftMargin::WritePreChildrenNative(BaseCamelotFilter *pFilter, AttrTxtLeftMargin *pAttr)
02290 {
02291 #ifdef DO_EXPORT
02292 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
02293 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
02294
02295 return WritePreChildrenAux(pFilter, pAttr);
02296 #else
02297 return FALSE;
02298 #endif
02299 }
02300
02301 BOOL CXaraFileTxtLeftMargin::WritePreChildrenAux(BaseCamelotFilter *pFilter, AttrTxtLeftMargin *pAttr)
02302 {
02303 #ifdef DO_EXPORT
02304 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
02305 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
02306
02307 BOOL ok;
02308
02309 CamelotFileRecord Rec(pFilter, TAG_TEXT_LEFT_INDENT, TAG_TEXT_LEFT_INDENT_SIZE);
02310 ok = Rec.Init();
02311 if (ok) ok = Rec.WriteINT32(pAttr->Value.Value);
02312 if (ok) ok = pFilter->Write(&Rec);
02313
02314 return ok;
02315 #else
02316 return FALSE;
02317 #endif
02318 }
02319
02320
02321
02322
02323
02324
02325
02326
02327
02328
02329
02330
02331
02332
02333
02334
02335 BOOL CXaraFileTxtRightMargin::WritePreChildrenWeb(BaseCamelotFilter *pFilter, AttrTxtRightMargin *pAttr)
02336 {
02337 #ifdef DO_EXPORT
02338 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
02339 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
02340
02341 return WritePreChildrenAux(pFilter, pAttr);
02342 #else
02343 return FALSE;
02344 #endif
02345 }
02346
02347 BOOL CXaraFileTxtRightMargin::WritePreChildrenNative(BaseCamelotFilter *pFilter, AttrTxtRightMargin *pAttr)
02348 {
02349 #ifdef DO_EXPORT
02350 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
02351 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
02352
02353 return WritePreChildrenAux(pFilter, pAttr);
02354 #else
02355 return FALSE;
02356 #endif
02357 }
02358
02359 BOOL CXaraFileTxtRightMargin::WritePreChildrenAux(BaseCamelotFilter *pFilter, AttrTxtRightMargin *pAttr)
02360 {
02361 #ifdef DO_EXPORT
02362 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
02363 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
02364
02365 BOOL ok;
02366
02367 CamelotFileRecord Rec(pFilter, TAG_TEXT_RIGHT_INDENT, TAG_TEXT_RIGHT_INDENT_SIZE);
02368 ok = Rec.Init();
02369 if (ok) ok = Rec.WriteINT32(pAttr->Value.Value);
02370 if (ok) ok = pFilter->Write(&Rec);
02371
02372 return ok;
02373 #else
02374 return FALSE;
02375 #endif
02376 }
02377
02378
02379
02380
02381
02382
02383
02384
02385
02386
02387
02388
02389
02390
02391
02392
02393 BOOL CXaraFileTxtFirstIndent::WritePreChildrenWeb(BaseCamelotFilter *pFilter, AttrTxtFirstIndent *pAttr)
02394 {
02395 #ifdef DO_EXPORT
02396 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
02397 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
02398
02399 return WritePreChildrenAux(pFilter, pAttr);
02400 #else
02401 return FALSE;
02402 #endif
02403 }
02404
02405 BOOL CXaraFileTxtFirstIndent::WritePreChildrenNative(BaseCamelotFilter *pFilter, AttrTxtFirstIndent *pAttr)
02406 {
02407 #ifdef DO_EXPORT
02408 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
02409 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
02410
02411 return WritePreChildrenAux(pFilter, pAttr);
02412 #else
02413 return FALSE;
02414 #endif
02415 }
02416
02417 BOOL CXaraFileTxtFirstIndent::WritePreChildrenAux(BaseCamelotFilter *pFilter, AttrTxtFirstIndent *pAttr)
02418 {
02419 #ifdef DO_EXPORT
02420 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
02421 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
02422
02423 BOOL ok;
02424
02425 CamelotFileRecord Rec(pFilter, TAG_TEXT_FIRST_INDENT, TAG_TEXT_FIRST_INDENT_SIZE);
02426 ok = Rec.Init();
02427 if (ok) ok = Rec.WriteINT32(pAttr->Value.Value);
02428 if (ok) ok = pFilter->Write(&Rec);
02429
02430 return ok;
02431 #else
02432 return FALSE;
02433 #endif
02434 }
02435
02436
02437
02438
02439
02440
02441
02442
02443
02444
02445
02446
02447
02448
02449
02450
02451 BOOL CXaraFileTxtRuler::WritePreChildrenWeb(BaseCamelotFilter *pFilter, AttrTxtRuler *pAttr)
02452 {
02453 #ifdef DO_EXPORT
02454 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
02455 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
02456
02457 return WritePreChildrenAux(pFilter, pAttr);
02458 #else
02459 return FALSE;
02460 #endif
02461 }
02462
02463 BOOL CXaraFileTxtRuler::WritePreChildrenNative(BaseCamelotFilter *pFilter, AttrTxtRuler *pAttr)
02464 {
02465 #ifdef DO_EXPORT
02466 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
02467 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
02468
02469 return WritePreChildrenAux(pFilter, pAttr);
02470 #else
02471 return FALSE;
02472 #endif
02473 }
02474
02475 BOOL CXaraFileTxtRuler::WritePreChildrenAux(BaseCamelotFilter *pFilter, AttrTxtRuler *pAttr)
02476 {
02477 #ifdef DO_EXPORT
02478 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
02479 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
02480
02481 BOOL ok;
02482
02483 CamelotFileRecord Rec(pFilter, TAG_TEXT_RULER, TAG_TEXT_RULER_SIZE);
02484 ok = Rec.Init();
02485 if (ok)
02486 {
02487 TxtRuler* pRuler = pAttr->Value.Value;
02488 UINT32 NumEntries = pRuler->size();
02489 ERROR2IF(NumEntries > 65535, FALSE, "too many tab stops");
02490 TRACEUSER("wuerthne", _T("saving ruler attribute with %d entries"), NumEntries);
02491 ok = Rec.WriteUINT16(NumEntries);
02492 for (TxtTabStopIterator it = pRuler->begin(); ok && it != pRuler->end(); ++it)
02493 {
02494
02495
02496 BOOL HasTabFiller = ((*it).GetTabFillerChar() != WCHAR(0));
02497 BYTE TypeAndFlags = (*it).GetType() | (HasTabFiller ? 4 : 0);
02498 ok = Rec.WriteBYTE(TypeAndFlags);
02499 if (ok) ok = Rec.WriteINT32((*it).GetPosition());
02500
02501 if ((*it).GetType() == DecimalTab)
02502 if (ok) ok = Rec.WriteWCHAR((*it).GetDecimalPointChar());
02503
02504 if (HasTabFiller)
02505 if (ok) ok = Rec.WriteWCHAR((*it).GetTabFillerChar());
02506 }
02507 }
02508 if (ok) ok = pFilter->Write(&Rec);
02509
02510 return ok;
02511 #else
02512 return FALSE;
02513 #endif
02514 }
02515
02516
02517
02518
02519
02520
02521
02522
02523
02524
02525
02526
02527
02528
02529
02530
02531 BOOL CXaraFileTxtLineSpace::WritePreChildrenWeb(BaseCamelotFilter *pFilter, AttrTxtLineSpace *pAttr)
02532 {
02533 #ifdef DO_EXPORT
02534 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
02535 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
02536
02537 return WritePreChildrenAux(pFilter, pAttr);
02538 #else
02539 return FALSE;
02540 #endif
02541 }
02542
02543 BOOL CXaraFileTxtLineSpace::WritePreChildrenNative(BaseCamelotFilter *pFilter, AttrTxtLineSpace *pAttr)
02544 {
02545 #ifdef DO_EXPORT
02546 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
02547 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
02548
02549 return WritePreChildrenAux(pFilter, pAttr);
02550 #else
02551 return FALSE;
02552 #endif
02553 }
02554
02555 BOOL CXaraFileTxtLineSpace::WritePreChildrenAux(BaseCamelotFilter *pFilter, AttrTxtLineSpace *pAttr)
02556 {
02557 #ifdef DO_EXPORT
02558 ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
02559 ERROR2IF(pAttr==NULL, FALSE, "Parameter pAttr == NULL.");
02560
02561 BOOL ok;
02562
02563 if (pAttr->Value.IsARatio())
02564 {
02565
02566 CamelotFileRecord Rec(pFilter, TAG_TEXT_LINESPACE_RATIO, TAG_TEXT_LINESPACE_RATIO_SIZE);
02567 ok = Rec.Init();
02568 if (ok) ok = Rec.WriteFIXED16(pAttr->Value.Ratio);
02569 if (ok) ok = pFilter->Write(&Rec);
02570 }
02571 else
02572 {
02573
02574 CamelotFileRecord Rec(pFilter, TAG_TEXT_LINESPACE_ABSOLUTE, TAG_TEXT_LINESPACE_ABSOLUTE_SIZE);
02575 ok = Rec.Init();
02576 if (ok) ok = Rec.WriteINT32(pAttr->Value.Value);
02577 if (ok) ok = pFilter->Write(&Rec);
02578 }
02579
02580 return ok;
02581 #else
02582 return FALSE;
02583 #endif
02584 }
02585
02586 #endif // DO_EXPORT