/****************************************************************************1* Copyright (c) 1998 Free Software Foundation, Inc. *2* *3* Permission is hereby granted, free of charge, to any person obtaining a *4* copy of this software and associated documentation files (the *5* "Software"), to deal in the Software without restriction, including *6* without limitation the rights to use, copy, modify, merge, publish, *7* distribute, distribute with modifications, sublicense, and/or sell *8* copies of the Software, and to permit persons to whom the Software is *9* furnished to do so, subject to the following conditions: *10* *11* The above copyright notice and this permission notice shall be included *12* in all copies or substantial portions of the Software. *13* *14* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *15* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *16* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *17* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *18* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *19* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *20* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *21* *22* Except as contained in this notice, the name(s) of the above copyright *23* holders shall not be used in advertising or otherwise to promote the *24* sale, use or other dealings in this Software without prior written *25* authorization. *26****************************************************************************/2728/****************************************************************************29* Author: Juergen Pfeifer <[email protected]> 1995,1997 *30****************************************************************************/3132#include "form.priv.h"3334MODULE_ID("$Id$")3536/*---------------------------------------------------------------------------37| Facility : libnform38| Function : int set_field_just(FIELD *field, int just)39|40| Description : Set the fields type of justification.41|42| Return Values : E_OK - success43| E_BAD_ARGUMENT - one of the arguments was incorrect44| E_SYSTEM_ERROR - system error45+--------------------------------------------------------------------------*/46int set_field_just(FIELD * field, int just)47{48int res = E_BAD_ARGUMENT;4950if ((just==NO_JUSTIFICATION) ||51(just==JUSTIFY_LEFT) ||52(just==JUSTIFY_CENTER) ||53(just==JUSTIFY_RIGHT) )54{55Normalize_Field( field );56if (field->just != just)57{58field->just = just;59res = _nc_Synchronize_Attributes( field );60}61else62res = E_OK;63}64RETURN(res);65}6667/*---------------------------------------------------------------------------68| Facility : libnform69| Function : int field_just( const FIELD *field )70|71| Description : Retrieve the fields type of justification72|73| Return Values : The justification type.74+--------------------------------------------------------------------------*/75int field_just(const FIELD * field)76{77return Normalize_Field( field )->just;78}7980/* fld_just.c ends here */818283