1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
|
/************************************************************************/
/* */
/* Buffer administration routines. */
/* */
/************************************************************************/
# include "tedConfig.h"
# include <stdlib.h>
# include <string.h>
# include <stdio.h>
# include <utilPropMask.h>
# include <appDebugon.h>
# include "docNotesProperties.h"
/************************************************************************/
/* */
/* Change note properties and tell what has been changed. */
/* */
/************************************************************************/
void docUpdNotesProperties(
PropertyMask * pChgMask,
NotesProperties * np,
const PropertyMask * updMask,
const NotesProperties * npNew,
int propStartNr,
int propPosition,
int propRestart,
int propStyle )
{
if ( PROPmaskISSET( updMask, propStartNr ) )
{
if ( np->npStartNumber != npNew->npStartNumber )
{
np->npStartNumber= npNew->npStartNumber;
PROPmaskADD( pChgMask, propStartNr );
}
}
if ( PROPmaskISSET( updMask, propPosition ) )
{
if ( np->npPosition != npNew->npPosition )
{
np->npPosition= npNew->npPosition;
PROPmaskADD( pChgMask, propPosition );
}
}
if ( PROPmaskISSET( updMask, propRestart ) )
{
if ( np->npRestart != npNew->npRestart )
{
np->npRestart= npNew->npRestart;
PROPmaskADD( pChgMask, propRestart );
}
}
if ( PROPmaskISSET( updMask, propStyle ) )
{
if ( np->npNumberStyle != npNew->npNumberStyle )
{
np->npNumberStyle= npNew->npNumberStyle;
PROPmaskADD( pChgMask, propStyle );
}
}
return;
}
/************************************************************************/
/* */
/* Compare note properties. */
/* */
/************************************************************************/
void docNotesPropertyDifference(
PropertyMask * diffMask,
const NotesProperties * np1,
const PropertyMask * cmpMask,
const NotesProperties * np2,
int propStartNr,
int propPosition,
int propRestart,
int propStyle )
{
if ( PROPmaskISSET( cmpMask, propStartNr ) )
{
if ( np1->npStartNumber != np2->npStartNumber )
{ PROPmaskADD( diffMask, propStartNr ); }
}
if ( PROPmaskISSET( cmpMask, propPosition ) )
{
if ( np1->npPosition != np2->npPosition )
{ PROPmaskADD( diffMask, propPosition ); }
}
if ( PROPmaskISSET( cmpMask, propRestart ) )
{
if ( np1->npRestart != np2->npRestart )
{ PROPmaskADD( diffMask, propRestart ); }
}
if ( PROPmaskISSET( cmpMask, propStyle ) )
{
if ( np1->npNumberStyle != np2->npNumberStyle )
{ PROPmaskADD( diffMask, propStyle ); }
}
return;
}
|