MCPcopy Index your code
hub / github.com/MapServer/MapServer / msCopyMap

Function msCopyMap

mapcopy.c:935–1064  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

933 **********************************************************************/
934
935int msCopyMap(mapObj *dst, mapObj *src)
936{
937 int i, return_value;
938 outputFormatObj *format;
939
940 MS_COPYSTRING(dst->name, src->name);
941 MS_COPYSTELEM(status);
942 MS_COPYSTELEM(height);
943 MS_COPYSTELEM(width);
944
945 for (i = 0; i < src->numlayers; i++) {
946 if (msGrowMapLayers(dst) == NULL)
947 return MS_FAILURE;
948 initLayer((GET_LAYER(dst, i)), dst);
949
950 return_value = msCopyLayer((GET_LAYER(dst, i)), (GET_LAYER(src, i)));
951 if (return_value != MS_SUCCESS) {
952 msSetError(MS_MEMERR, "Failed to copy layer.", "msCopyMap()");
953 return MS_FAILURE;
954 }
955 dst->numlayers++;
956 }
957
958 return_value = msCopyFontSet(&(dst->fontset), &(src->fontset), dst);
959 if (return_value != MS_SUCCESS) {
960 msSetError(MS_MEMERR, "Failed to copy fontset.", "msCopyMap()");
961 return MS_FAILURE;
962 }
963
964 return_value = msCopySymbolSet(&(dst->symbolset), &(src->symbolset), dst);
965 if(return_value != MS_SUCCESS) {
966 msSetError(MS_MEMERR, "Failed to copy symbolset.", "msCopyMap()");
967 return MS_FAILURE;
968 }
969
970 /* msCopyLabelCache(&(dst->labelcache), &(src->labelcache)); */
971 MS_COPYSTELEM(transparent);
972 MS_COPYSTELEM(interlace);
973 MS_COPYSTELEM(imagequality);
974
975 MS_COPYRECT(&(dst->extent), &(src->extent));
976
977 MS_COPYSTELEM(cellsize);
978 MS_COPYSTELEM(units);
979 MS_COPYSTELEM(scaledenom);
980 MS_COPYSTELEM(defresolution);
981 MS_COPYSTELEM(resolution);
982 MS_COPYSTRING(dst->shapepath, src->shapepath);
983 MS_COPYSTRING(dst->mappath, src->mappath);
984
985 MS_COPYCOLOR(&(dst->imagecolor), &(src->imagecolor));
986
987 /* clear existing destination format list */
988 if( dst->outputformat && --dst->outputformat->refcount < 1 )
989 {
990 msFreeOutputFormat( dst->outputformat );
991 dst->outputformat = NULL;
992 }

Callers 2

mainFunction · 0.85
mapObj_cloneFunction · 0.85

Calls 15

msGrowMapLayersFunction · 0.85
initLayerFunction · 0.85
msCopyLayerFunction · 0.85
msSetErrorFunction · 0.85
msCopyFontSetFunction · 0.85
msCopySymbolSetFunction · 0.85
msFreeOutputFormatFunction · 0.85
msFreeFunction · 0.85
msAppendOutputFormatFunction · 0.85
msCloneOutputFormatFunction · 0.85
msSelectOutputFormatFunction · 0.85
msApplyOutputFormatFunction · 0.85

Tested by 1

mainFunction · 0.68