1 /************************************************************************/
2 /* */
3 /* Save notes properties to RTF. */
4 /* */
5 /************************************************************************/
6
7 # include "docRtfConfig.h"
8
9 # include <stdio.h>
10 # include <ctype.h>
11
12 # include <appDebugon.h>
13
14 # include "docRtfWriterImpl.h"
15
docRtfSaveNotesProperties(RtfWriter * rw,const PropertyMask * mask,const NotesProperties * np,const int propMap[NOTESprop_COUNT],const char * startNrTag,const char * const * justificationTags,int justificationTagCount,const char * const * placementTags,int placementTagCount,const char * const * restartTags,int restartTagCount,const char * const * styleTags,int styleTagCount)16 int docRtfSaveNotesProperties(
17 RtfWriter * rw,
18 const PropertyMask * mask,
19 const NotesProperties * np,
20 const int propMap[NOTESprop_COUNT],
21 const char * startNrTag,
22 const char * const * justificationTags,
23 int justificationTagCount,
24 const char * const * placementTags,
25 int placementTagCount,
26 const char * const * restartTags,
27 int restartTagCount,
28 const char * const * styleTags,
29 int styleTagCount )
30 {
31 int prop;
32
33 for ( prop= 0; prop < NOTESprop_COUNT; prop++ )
34 {
35 const int pprop= propMap[prop];
36 int val;
37
38 if ( pprop < 0 ||
39 ! PROPmaskISSET( mask, pprop ) )
40 { continue; }
41
42 val= docGetNotesProperty( np, prop );
43 switch( prop )
44 {
45 case NOTESpropSTARTNR:
46 docRtfWriteArgTag( rw, startNrTag, val );
47 break;
48 case NOTESpropJUSTIFICATION:
49 docRtfWriteEnumTag( rw, justificationTags, val,
50 justificationTagCount, FTNjustify_COUNT );
51 break;
52 case NOTESpropPLACEMENT:
53 docRtfWriteEnumTag( rw, placementTags, val,
54 placementTagCount, FTNplace_COUNT );
55 break;
56 case NOTESpropRESTART:
57 docRtfWriteEnumTag( rw, restartTags, val,
58 restartTagCount, FTN_RST__COUNT );
59 break;
60 case NOTESpropSTYLE:
61 docRtfWriteEnumTag( rw, styleTags, val,
62 styleTagCount, FTNstyle_COUNT );
63 break;
64 default:
65 LDEB(prop); return -1;
66 }
67 }
68
69 return 0;
70 }
71
72