r16684 by jghali - remove some unused code in scribus 13x file importer
scribus-commit
scribus-commit at lists.scribus.net
Mon Jun 20 20:58:32 UTC 2011
Author: jghali
Date: Mon Jun 20 20:58:32 2011
New Revision: 16684
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=16684
Log:
remove some unused code in scribus 13x file importer
Modified:
branches/Version135/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
Modified: branches/Version135/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16684&path=/branches/Version135/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp (original)
+++ branches/Version135/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp Mon Jun 20 20:58:32 2011
@@ -1189,541 +1189,7 @@
bool Scribus13Format::saveFile(const QString & fileName, const FileFormat & /* fmt */)
{
- QString text, tf, tf2, tc, tc2;
- QDomDocument docu("scribus");
- QString st="<SCRIBUSUTF8NEW></SCRIBUSUTF8NEW>";
- docu.setContent(st);
- QDomElement elem=docu.documentElement();
- elem.setAttribute("Version", QString(VERSION));
- QDomElement dc=docu.createElement("DOCUMENT");
- dc.setAttribute("ANZPAGES",m_Doc->DocPages.count());
- dc.setAttribute("PAGEWIDTH",m_Doc->pageWidth);
- dc.setAttribute("PAGEHEIGHT",m_Doc->pageHeight);
- dc.setAttribute("BORDERLEFT",m_Doc->pageMargins.Left);
- dc.setAttribute("BORDERRIGHT",m_Doc->pageMargins.Right);
- dc.setAttribute("BORDERTOP",m_Doc->pageMargins.Top);
- dc.setAttribute("BORDERBOTTOM",m_Doc->pageMargins.Bottom);
- dc.setAttribute("PRESET",m_Doc->marginPreset);
- dc.setAttribute("ORIENTATION",m_Doc->PageOri);
- dc.setAttribute("PAGESIZE",m_Doc->m_pageSize);
- dc.setAttribute("FIRSTNUM",m_Doc->FirstPnum);
- dc.setAttribute("BOOK", m_Doc->currentPageLayout);
- if(m_Doc->usesAutomaticTextFrames())
- dc.setAttribute("AUTOTEXT",1);
- dc.setAttribute("AUTOSPALTEN",m_Doc->PageSp);
- dc.setAttribute("ABSTSPALTEN",m_Doc->PageSpa);
- dc.setAttribute("UNITS",m_Doc->unitIndex());
- dc.setAttribute("DFONT",m_Doc->toolSettings.defFont);
- dc.setAttribute("DSIZE",m_Doc->toolSettings.defSize / 10.0);
- dc.setAttribute("DCOL",m_Doc->toolSettings.dCols);
- dc.setAttribute("DGAP",m_Doc->toolSettings.dGap);
- dc.setAttribute("TabFill",m_Doc->toolSettings.tabFillChar);
- dc.setAttribute("TabWidth",m_Doc->toolSettings.dTabWidth);
- dc.setAttribute("AUTHOR",m_Doc->documentInfo.getAuthor());
- dc.setAttribute("COMMENTS",m_Doc->documentInfo.getComments());
- dc.setAttribute("KEYWORDS",m_Doc->documentInfo.getKeywords());
- dc.setAttribute("PUBLISHER",m_Doc->documentInfo.getPublisher());
- dc.setAttribute("DOCDATE",m_Doc->documentInfo.getDate());
- dc.setAttribute("DOCTYPE",m_Doc->documentInfo.getType());
- dc.setAttribute("DOCFORMAT",m_Doc->documentInfo.getFormat());
- dc.setAttribute("DOCIDENT",m_Doc->documentInfo.getIdent());
- dc.setAttribute("DOCSOURCE",m_Doc->documentInfo.getSource());
- dc.setAttribute("DOCLANGINFO",m_Doc->documentInfo.getLangInfo());
- dc.setAttribute("DOCRELATION",m_Doc->documentInfo.getRelation());
- dc.setAttribute("DOCCOVER",m_Doc->documentInfo.getCover());
- dc.setAttribute("DOCRIGHTS",m_Doc->documentInfo.getRights());
- dc.setAttribute("DOCCONTRIB",m_Doc->documentInfo.getContrib());
- dc.setAttribute("TITLE",m_Doc->documentInfo.getTitle());
- dc.setAttribute("VHOCH",m_Doc->typographicSettings.valueSuperScript);
- dc.setAttribute("VHOCHSC",m_Doc->typographicSettings.scalingSuperScript);
- dc.setAttribute("VTIEF",m_Doc->typographicSettings.valueSubScript);
- dc.setAttribute("VTIEFSC",m_Doc->typographicSettings.scalingSubScript);
- dc.setAttribute("VKAPIT",m_Doc->typographicSettings.valueSmallCaps);
- dc.setAttribute("BASEGRID",m_Doc->typographicSettings.valueBaseGrid);
- dc.setAttribute("BASEO", m_Doc->typographicSettings.offsetBaseGrid);
- dc.setAttribute("AUTOL", m_Doc->typographicSettings.autoLineSpacing);
- dc.setAttribute("UnderlinePos", m_Doc->typographicSettings.valueUnderlinePos);
- dc.setAttribute("UnderlineWidth", m_Doc->typographicSettings.valueUnderlineWidth);
- dc.setAttribute("StrikeThruPos", m_Doc->typographicSettings.valueStrikeThruPos);
- dc.setAttribute("StrikeThruWidth", m_Doc->typographicSettings.valueStrikeThruWidth);
- dc.setAttribute("GROUPC",m_Doc->GroupCounter);
- dc.setAttribute("HCMS", static_cast<int>(m_Doc->HasCMS));
- dc.setAttribute("DPSo", static_cast<int>(m_Doc->CMSSettings.SoftProofOn));
- dc.setAttribute("DPSFo", static_cast<int>(m_Doc->CMSSettings.SoftProofFullOn));
- dc.setAttribute("DPuse", static_cast<int>(m_Doc->CMSSettings.CMSinUse));
- dc.setAttribute("DPgam", static_cast<int>(m_Doc->CMSSettings.GamutCheck));
- dc.setAttribute("DPbla", static_cast<int>(m_Doc->CMSSettings.BlackPoint));
- dc.setAttribute("DPMo",m_Doc->CMSSettings.DefaultMonitorProfile);
- dc.setAttribute("DPPr",m_Doc->CMSSettings.DefaultPrinterProfile);
- dc.setAttribute("DPIn",m_Doc->CMSSettings.DefaultImageRGBProfile);
- dc.setAttribute("DPInCMYK",m_Doc->CMSSettings.DefaultImageCMYKProfile);
- dc.setAttribute("DPIn2",m_Doc->CMSSettings.DefaultSolidColorRGBProfile);
- dc.setAttribute("DPIn3",m_Doc->CMSSettings.DefaultSolidColorCMYKProfile);
- dc.setAttribute("DISc",m_Doc->CMSSettings.DefaultIntentColors);
- dc.setAttribute("DIIm",m_Doc->CMSSettings.DefaultIntentImages);
- dc.setAttribute("ALAYER", m_Doc->activeLayer());
- dc.setAttribute("LANGUAGE", m_Doc->Language);
- dc.setAttribute("MINWORDLEN", m_Doc->MinWordLen);
- dc.setAttribute("HYCOUNT", m_Doc->HyCount);
- dc.setAttribute("AUTOMATIC", static_cast<int>(m_Doc->Automatic));
- dc.setAttribute("AUTOCHECK", static_cast<int>(m_Doc->AutoCheck));
- dc.setAttribute("GUIDELOCK", static_cast<int>(m_Doc->GuideLock));
- dc.setAttribute("SnapToGuides", static_cast<int>(m_Doc->SnapGuides));
- dc.setAttribute("SnapToGrid", static_cast<int>(m_Doc->useRaster));
- dc.setAttribute("MINGRID", m_Doc->guidesSettings.minorGrid);
- dc.setAttribute("MAJGRID", m_Doc->guidesSettings.majorGrid);
- dc.setAttribute("SHOWGRID", static_cast<int>(m_Doc->guidesSettings.gridShown));
- dc.setAttribute("SHOWGUIDES", static_cast<int>(m_Doc->guidesSettings.guidesShown));
- dc.setAttribute("showcolborders", static_cast<int>(m_Doc->guidesSettings.colBordersShown));
- dc.setAttribute("SHOWFRAME", static_cast<int>(m_Doc->guidesSettings.framesShown));
- dc.setAttribute("SHOWLAYERM", static_cast<int>(m_Doc->guidesSettings.layerMarkersShown));
- dc.setAttribute("SHOWMARGIN", static_cast<int>(m_Doc->guidesSettings.marginsShown));
- dc.setAttribute("SHOWBASE", static_cast<int>(m_Doc->guidesSettings.baseShown));
- dc.setAttribute("SHOWPICT", static_cast<int>(m_Doc->guidesSettings.showPic));
- dc.setAttribute("SHOWControl", static_cast<int>(m_Doc->guidesSettings.showControls));
- dc.setAttribute("SHOWLINK", static_cast<int>(m_Doc->guidesSettings.linkShown));
- dc.setAttribute("rulerMode", static_cast<int>(m_Doc->guidesSettings.rulerMode));
- dc.setAttribute("showrulers", static_cast<int>(m_Doc->guidesSettings.rulersShown));
- dc.setAttribute("rulerXoffset", m_Doc->rulerXoffset);
- dc.setAttribute("rulerYoffset", m_Doc->rulerYoffset);
- dc.setAttribute("GuideRad", m_Doc->guidesSettings.guideRad);
- dc.setAttribute("GRAB",m_Doc->guidesSettings.grabRad);
- dc.setAttribute("POLYC", m_Doc->toolSettings.polyC);
- dc.setAttribute("POLYF", m_Doc->toolSettings.polyF);
- dc.setAttribute("POLYR", m_Doc->toolSettings.polyR);
- dc.setAttribute("POLYFD", m_Doc->toolSettings.polyFd);
- dc.setAttribute("POLYS", static_cast<int>(m_Doc->toolSettings.polyS));
- dc.setAttribute("AutoSave", static_cast<int>(m_Doc->AutoSave));
- dc.setAttribute("AutoSaveTime", m_Doc->AutoSaveTime);
- dc.setAttribute("ScratchBottom", m_Doc->scratch.Bottom);
- dc.setAttribute("ScratchLeft", m_Doc->scratch.Left);
- dc.setAttribute("ScratchRight", m_Doc->scratch.Right);
- dc.setAttribute("ScratchTop", m_Doc->scratch.Top);
- dc.setAttribute("StartArrow", m_Doc->toolSettings.dStartArrow);
- dc.setAttribute("EndArrow", m_Doc->toolSettings.dEndArrow);
- dc.setAttribute("PEN",m_Doc->toolSettings.dPen);
- dc.setAttribute("BRUSH",m_Doc->toolSettings.dBrush);
- dc.setAttribute("PENLINE",m_Doc->toolSettings.dPenLine);
- dc.setAttribute("PENTEXT",m_Doc->toolSettings.dPenText);
- dc.setAttribute("StrokeText",m_Doc->toolSettings.dStrokeText);
- dc.setAttribute("TextBackGround", m_Doc->toolSettings.dTextBackGround);
- dc.setAttribute("TextLineColor", m_Doc->toolSettings.dTextLineColor);
- dc.setAttribute("TextBackGroundShade", m_Doc->toolSettings.dTextBackGroundShade);
- dc.setAttribute("TextLineShade", m_Doc->toolSettings.dTextLineShade);
- dc.setAttribute("TextPenShade", m_Doc->toolSettings.dTextPenShade);
- dc.setAttribute("TextStrokeShade", m_Doc->toolSettings.dTextStrokeShade);
- dc.setAttribute("STIL",m_Doc->toolSettings.dLineArt);
- dc.setAttribute("STILLINE",m_Doc->toolSettings.dLstyleLine);
- dc.setAttribute("WIDTH",m_Doc->toolSettings.dWidth);
- dc.setAttribute("WIDTHLINE",m_Doc->toolSettings.dWidthLine);
- dc.setAttribute("PENSHADE",m_Doc->toolSettings.dShade2);
- dc.setAttribute("LINESHADE",m_Doc->toolSettings.dShadeLine);
- dc.setAttribute("BRUSHSHADE",m_Doc->toolSettings.dShade);
- dc.setAttribute("MAGMIN",m_Doc->toolSettings.magMin);
- dc.setAttribute("MAGMAX",m_Doc->toolSettings.magMax);
- dc.setAttribute("MAGSTEP",m_Doc->toolSettings.magStep);
- dc.setAttribute("CPICT",m_Doc->toolSettings.dBrushPict);
- dc.setAttribute("PICTSHADE",m_Doc->toolSettings.shadePict);
- dc.setAttribute("PICTSCX",m_Doc->toolSettings.scaleX);
- dc.setAttribute("PICTSCY",m_Doc->toolSettings.scaleY);
- dc.setAttribute("PSCALE", static_cast<int>(m_Doc->toolSettings.scaleType));
- dc.setAttribute("PASPECT", static_cast<int>(m_Doc->toolSettings.aspectRatio));
- dc.setAttribute("EmbeddedPath", static_cast<int>(m_Doc->toolSettings.useEmbeddedPath));
- dc.setAttribute("HalfRes", m_Doc->toolSettings.lowResType);
- dc.setAttribute("MINORC",m_Doc->guidesSettings.minorColor.name());
- dc.setAttribute("MAJORC",m_Doc->guidesSettings.majorColor.name());
- dc.setAttribute("GuideC", m_Doc->guidesSettings.guideColor.name());
- dc.setAttribute("BaseC", m_Doc->guidesSettings.baseColor.name());
- dc.setAttribute("GuideZ", m_Doc->guidesSettings.guideRad);
- dc.setAttribute("BACKG", static_cast<int>(m_Doc->guidesSettings.before));
- dc.setAttribute("PAGEC",m_Doc->papColor.name());
- dc.setAttribute("MARGC",m_Doc->guidesSettings.margColor.name());
- dc.setAttribute("RANDF", static_cast<int>(m_Doc->marginColored));
- dc.setAttribute("currentProfile", m_Doc->curCheckProfile);
- CheckerPrefsList::Iterator itcp;
- CheckerPrefsList::Iterator itcpend=m_Doc->checkerProfiles.end();
- for (itcp = m_Doc->checkerProfiles.begin(); itcp != itcpend; ++itcp)
- {
- QDomElement dc79a=docu.createElement("CheckProfile");
- dc79a.setAttribute("Name",itcp.key());
- dc79a.setAttribute("ignoreErrors", static_cast<int>(itcp.value().ignoreErrors));
- dc79a.setAttribute("autoCheck", static_cast<int>(itcp.value().autoCheck));
- dc79a.setAttribute("checkGlyphs", static_cast<int>(itcp.value().checkGlyphs));
- dc79a.setAttribute("checkOrphans", static_cast<int>(itcp.value().checkOrphans));
- dc79a.setAttribute("checkOverflow", static_cast<int>(itcp.value().checkOverflow));
- dc79a.setAttribute("checkPictures", static_cast<int>(itcp.value().checkPictures));
- dc79a.setAttribute("checkResolution", static_cast<int>(itcp.value().checkResolution));
- dc79a.setAttribute("checkTransparency", static_cast<int>(itcp.value().checkTransparency));
- dc79a.setAttribute("minResolution",itcp.value().minResolution);
- dc79a.setAttribute("maxResolution",itcp.value().maxResolution);
- dc79a.setAttribute("checkAnnotations", static_cast<int>(itcp.value().checkAnnotations));
- dc79a.setAttribute("checkRasterPDF", static_cast<int>(itcp.value().checkRasterPDF));
- dc79a.setAttribute("checkForGIF", static_cast<int>(itcp.value().checkForGIF));
- dc.appendChild(dc79a);
- }
- QMap<QString,multiLine>::Iterator itMU;
- for (itMU = m_Doc->MLineStyles.begin(); itMU != m_Doc->MLineStyles.end(); ++itMU)
- {
- QDomElement MuL=docu.createElement("MultiLine");
- MuL.setAttribute("Name",itMU.key());
- multiLine ml = itMU.value();
- multiLine::iterator itMU2;
- for (itMU2 = ml.begin(); itMU2 != ml.end(); ++itMU2)
- {
- QDomElement SuL=docu.createElement("SubLine");
- SuL.setAttribute("Color", (*itMU2).Color);
- SuL.setAttribute("Shade", (*itMU2).Shade);
- SuL.setAttribute("Dash", (*itMU2).Dash);
- SuL.setAttribute("LineEnd", (*itMU2).LineEnd);
- SuL.setAttribute("LineJoin", (*itMU2).LineJoin);
- SuL.setAttribute("Width", (*itMU2).Width);
- MuL.appendChild(SuL);
- }
- dc.appendChild(MuL);
- }
- QList<ArrowDesc>::Iterator itar;
- for (itar = m_Doc->arrowStyles.begin(); itar != m_Doc->arrowStyles.end(); ++itar)
- {
- if ((*itar).userArrow)
- {
- QDomElement ar=docu.createElement("Arrows");
- ar.setAttribute("NumPoints", (*itar).points.size());
- QString arp = "";
- QString tmp, tmpy;
- double xa, ya;
- for (uint nxx = 0; nxx < (*itar).points.size(); ++nxx)
- {
- (*itar).points.point(nxx, &xa, &ya);
- arp += tmp.setNum(xa) + " " + tmpy.setNum(ya) + " ";
- }
- ar.setAttribute("Points", arp);
- ar.setAttribute("Name", (*itar).name);
- dc.appendChild(ar);
- }
- }
- QMap<QString,QString>::Iterator itja;
- for (itja = m_Doc->JavaScripts.begin(); itja != m_Doc->JavaScripts.end(); ++itja)
- {
- QDomElement jav=docu.createElement("JAVA");
- jav.setAttribute("NAME",itja.key());
- jav.setAttribute("SCRIPT",itja.value());
- dc.appendChild(jav);
- }
- QList<ScribusDoc::BookMa>::Iterator itbm;
- for (itbm = m_Doc->BookMarks.begin(); itbm != m_Doc->BookMarks.end(); ++itbm)
- {
- QDomElement fn=docu.createElement("Bookmark");
- fn.setAttribute("Title",(*itbm).Title);
- fn.setAttribute("Text",(*itbm).Text);
- fn.setAttribute("Aktion",(*itbm).Aktion);
- fn.setAttribute("ItemNr", (*itbm).ItemNr);
- fn.setAttribute("Element", (*itbm).PageObject->ItemNr);
- fn.setAttribute("First", (*itbm).First);
- fn.setAttribute("Last", (*itbm).Last);
- fn.setAttribute("Prev", (*itbm).Prev);
- fn.setAttribute("Next", (*itbm).Next);
- fn.setAttribute("Parent", (*itbm).Parent);
- dc.appendChild(fn);
- }
- ColorList::Iterator itc;
- for (itc = m_Doc->PageColors.begin(); itc != m_Doc->PageColors.end(); ++itc)
- {
- QDomElement co=docu.createElement("COLOR");
- co.setAttribute("NAME",itc.key());
- if (m_Doc->PageColors[itc.key()].getColorModel() == colorModelRGB)
- co.setAttribute("RGB",m_Doc->PageColors[itc.key()].nameRGB());
- else
- co.setAttribute("CMYK",m_Doc->PageColors[itc.key()].nameCMYK());
- co.setAttribute("Spot",static_cast<int>(m_Doc->PageColors[itc.key()].isSpotColor()));
- co.setAttribute("Register",static_cast<int>(m_Doc->PageColors[itc.key()].isRegistrationColor()));
- dc.appendChild(co);
- }
-// if (m_Doc->docParagraphStyles.count() > 5)
- {
- for (int ff = 0; ff < m_Doc->paragraphStyles().count(); ++ff)
- {
- QDomElement fo=docu.createElement("STYLE");
- fo.setAttribute("NAME",m_Doc->paragraphStyles()[ff].name());
- fo.setAttribute("ALIGN",m_Doc->paragraphStyles()[ff].alignment());
- fo.setAttribute("LINESPMode",m_Doc->paragraphStyles()[ff].lineSpacingMode());
- fo.setAttribute("LINESP",m_Doc->paragraphStyles()[ff].lineSpacing());
- fo.setAttribute("INDENT",m_Doc->paragraphStyles()[ff].leftMargin());
- fo.setAttribute("RMARGIN",m_Doc->paragraphStyles()[ff].rightMargin());
- fo.setAttribute("FIRST",m_Doc->paragraphStyles()[ff].firstIndent());
- fo.setAttribute("VOR",m_Doc->paragraphStyles()[ff].gapBefore());
- fo.setAttribute("NACH",m_Doc->paragraphStyles()[ff].gapAfter());
- fo.setAttribute("FONT",m_Doc->paragraphStyles()[ff].charStyle().font().scName());
- fo.setAttribute("FONTSIZE",m_Doc->paragraphStyles()[ff].charStyle().fontSize() / 10.0);
- fo.setAttribute("DROP", static_cast<int>(m_Doc->paragraphStyles()[ff].hasDropCap()));
- fo.setAttribute("DROPLIN", m_Doc->paragraphStyles()[ff].dropCapLines());
- fo.setAttribute("DROPDIST", m_Doc->paragraphStyles()[ff].dropCapOffset());
- fo.setAttribute("EFFECT", m_Doc->paragraphStyles()[ff].charStyle().effects());
- if (m_Doc->paragraphStyles()[ff].tabValues().count() != 0)
- {
- for (int a = 0; a < m_Doc->paragraphStyles()[ff].tabValues().count(); ++a)
- {
- QDomElement tabs = docu.createElement("Tabs");
- tabs.setAttribute("Type", (m_Doc->paragraphStyles()[ff].tabValues().at(a)).tabType);
- tabs.setAttribute("Pos", (m_Doc->paragraphStyles()[ff].tabValues().at(a)).tabPosition);
- QString tabCh = "";
- if (!(m_Doc->paragraphStyles()[ff].tabValues().at(a)).tabFillChar.isNull())
- tabCh = QString((m_Doc->paragraphStyles()[ff].tabValues().at(a)).tabFillChar);
- tabs.setAttribute("Fill", tabCh);
- fo.appendChild(tabs);
- }
- }
- fo.setAttribute("FCOLOR",m_Doc->paragraphStyles()[ff].charStyle().fillColor());
- fo.setAttribute("FSHADE",m_Doc->paragraphStyles()[ff].charStyle().fillShade());
- fo.setAttribute("SCOLOR",m_Doc->paragraphStyles()[ff].charStyle().strokeColor());
- fo.setAttribute("SSHADE",m_Doc->paragraphStyles()[ff].charStyle().strokeShade());
- fo.setAttribute("BASE", static_cast<int>(m_Doc->paragraphStyles()[ff].lineSpacingMode() == ParagraphStyle::BaselineGridLineSpacing));
- fo.setAttribute("TXTSHX",m_Doc->paragraphStyles()[ff].charStyle().shadowXOffset() / 10.0);
- fo.setAttribute("TXTSHY",m_Doc->paragraphStyles()[ff].charStyle().shadowYOffset() / 10.0);
- fo.setAttribute("TXTOUT",m_Doc->paragraphStyles()[ff].charStyle().outlineWidth() / 10.0);
- fo.setAttribute("TXTULP",m_Doc->paragraphStyles()[ff].charStyle().underlineOffset() / 10.0);
- fo.setAttribute("TXTULW",m_Doc->paragraphStyles()[ff].charStyle().underlineWidth() / 10.0);
- fo.setAttribute("TXTSTP",m_Doc->paragraphStyles()[ff].charStyle().strikethruOffset() / 10.0);
- fo.setAttribute("TXTSTW",m_Doc->paragraphStyles()[ff].charStyle().strikethruWidth() / 10.0);
- fo.setAttribute("SCALEH",m_Doc->paragraphStyles()[ff].charStyle().scaleH() / 10.0);
- fo.setAttribute("SCALEV",m_Doc->paragraphStyles()[ff].charStyle().scaleV() / 10.0);
- fo.setAttribute("BASEO",m_Doc->paragraphStyles()[ff].charStyle().baselineOffset() / 10.0);
- fo.setAttribute("KERN",m_Doc->paragraphStyles()[ff].charStyle().tracking() / 10.0);
- dc.appendChild(fo);
- }
- }
- uint layerCount=m_Doc->layerCount();
- for (uint lay = 0; lay < layerCount; ++lay)
- {
- QDomElement la = docu.createElement("LAYERS");
- la.setAttribute("NUMMER",m_Doc->Layers[lay].LNr);
- la.setAttribute("LEVEL",m_Doc->Layers[lay].Level);
- la.setAttribute("NAME",m_Doc->Layers[lay].Name);
- la.setAttribute("SICHTBAR", static_cast<int>(m_Doc->Layers[lay].isViewable));
- la.setAttribute("DRUCKEN", static_cast<int>(m_Doc->Layers[lay].isPrintable));
- la.setAttribute("EDIT", static_cast<int>(m_Doc->Layers[lay].isEditable));
- la.setAttribute("FLOW", static_cast<int>(m_Doc->Layers[lay].flowControl));
- la.setAttribute("TRANS", m_Doc->Layers[lay].transparency);
- la.setAttribute("BLEND", m_Doc->Layers[lay].blendMode);
- la.setAttribute("OUTL", static_cast<int>(m_Doc->Layers[lay].outlineMode));
- la.setAttribute("LAYERC",m_Doc->Layers[lay].markerColor.name());
- dc.appendChild(la);
- }
- QDomElement pdf = docu.createElement("PDF");
- pdf.setAttribute("Thumbnails", static_cast<int>(m_Doc->PDF_Options.Thumbnails));
- pdf.setAttribute("Articles", static_cast<int>(m_Doc->PDF_Options.Articles));
- pdf.setAttribute("Bookmarks", static_cast<int>(m_Doc->PDF_Options.Bookmarks));
- pdf.setAttribute("Compress", static_cast<int>(m_Doc->PDF_Options.Compress));
- pdf.setAttribute("CMethod", m_Doc->PDF_Options.CompressMethod);
- pdf.setAttribute("Quality", m_Doc->PDF_Options.Quality);
- pdf.setAttribute("MirrorH", static_cast<int>(m_Doc->PDF_Options.MirrorH));
- pdf.setAttribute("MirrorV", static_cast<int>(m_Doc->PDF_Options.MirrorV));
- pdf.setAttribute("Clip", static_cast<int>(m_Doc->PDF_Options.doClip));
- pdf.setAttribute("RotateDeg", static_cast<int>(m_Doc->PDF_Options.RotateDeg));
- pdf.setAttribute("PresentMode", static_cast<int>(m_Doc->PDF_Options.PresentMode));
- pdf.setAttribute("RecalcPic", static_cast<int>(m_Doc->PDF_Options.RecalcPic));
- pdf.setAttribute("Grayscale", static_cast<int>(m_Doc->PDF_Options.isGrayscale));
- pdf.setAttribute("RGBMode", static_cast<int>(m_Doc->PDF_Options.UseRGB));
- pdf.setAttribute("UseProfiles", static_cast<int>(m_Doc->PDF_Options.UseProfiles));
- pdf.setAttribute("UseProfiles2", static_cast<int>(m_Doc->PDF_Options.UseProfiles2));
- pdf.setAttribute("Binding", m_Doc->PDF_Options.Binding);
- pdf.setAttribute("PicRes", m_Doc->PDF_Options.PicRes);
- pdf.setAttribute("Resolution", m_Doc->PDF_Options.Resolution);
- pdf.setAttribute("Version", m_Doc->PDF_Options.Version);
- pdf.setAttribute("Intent", m_Doc->PDF_Options.Intent);
- pdf.setAttribute("Intent2", m_Doc->PDF_Options.Intent2);
- pdf.setAttribute("SolidP", m_Doc->PDF_Options.SolidProf);
- pdf.setAttribute("ImageP", m_Doc->PDF_Options.ImageProf);
- pdf.setAttribute("PrintP", m_Doc->PDF_Options.PrintProf);
- pdf.setAttribute("InfoString", m_Doc->PDF_Options.Info);
- pdf.setAttribute("BTop", m_Doc->PDF_Options.bleeds.Top);
- pdf.setAttribute("BLeft", m_Doc->PDF_Options.bleeds.Left);
- pdf.setAttribute("BRight", m_Doc->PDF_Options.bleeds.Right);
- pdf.setAttribute("BBottom", m_Doc->PDF_Options.bleeds.Bottom);
- pdf.setAttribute("ImagePr", static_cast<int>(m_Doc->PDF_Options.EmbeddedI));
- pdf.setAttribute("PassOwner", m_Doc->PDF_Options.PassOwner);
- pdf.setAttribute("PassUser", m_Doc->PDF_Options.PassUser);
- pdf.setAttribute("Permissions", m_Doc->PDF_Options.Permissions);
- pdf.setAttribute("Encrypt", static_cast<int>(m_Doc->PDF_Options.Encrypt));
- pdf.setAttribute("UseLayers", static_cast<int>(m_Doc->PDF_Options.useLayers));
- pdf.setAttribute("UseLpi", static_cast<int>(m_Doc->PDF_Options.UseLPI));
- pdf.setAttribute("UseSpotColors", static_cast<int>(m_Doc->PDF_Options.UseSpotColors));
- pdf.setAttribute("doMultiFile", static_cast<int>(m_Doc->PDF_Options.doMultiFile));
- pdf.setAttribute("displayBookmarks", static_cast<int>(m_Doc->PDF_Options.displayBookmarks));
- pdf.setAttribute("displayFullscreen", static_cast<int>(m_Doc->PDF_Options.displayFullscreen));
- pdf.setAttribute("displayLayers", static_cast<int>(m_Doc->PDF_Options.displayLayers));
- pdf.setAttribute("displayThumbs", static_cast<int>(m_Doc->PDF_Options.displayThumbs));
- pdf.setAttribute("hideMenuBar", static_cast<int>(m_Doc->PDF_Options.hideMenuBar));
- pdf.setAttribute("hideToolBar", static_cast<int>(m_Doc->PDF_Options.hideToolBar));
- pdf.setAttribute("fitWindow", static_cast<int>(m_Doc->PDF_Options.fitWindow));
- pdf.setAttribute("PageLayout", m_Doc->PDF_Options.PageLayout);
- pdf.setAttribute("openAction", m_Doc->PDF_Options.openAction);
- for (int pdoF = 0; pdoF < m_Doc->PDF_Options.EmbedList.count(); ++pdoF)
- {
- QDomElement pdf2 = docu.createElement("Fonts");
- pdf2.setAttribute("Name", m_Doc->PDF_Options.EmbedList[pdoF]);
- pdf.appendChild(pdf2);
- }
- for (int pdoS = 0; pdoS < m_Doc->PDF_Options.SubsetList.count(); ++pdoS)
- {
- QDomElement pdf4 = docu.createElement("Subset");
- pdf4.setAttribute("Name", m_Doc->PDF_Options.SubsetList[pdoS]);
- pdf.appendChild(pdf4);
- }
- for (int pdoE = 0; pdoE < m_Doc->PDF_Options.PresentVals.count(); ++pdoE)
- {
- QDomElement pdf3 = docu.createElement("Effekte");
- pdf3.setAttribute("pageEffectDuration", m_Doc->PDF_Options.PresentVals[pdoE].pageEffectDuration);
- pdf3.setAttribute("pageViewDuration", m_Doc->PDF_Options.PresentVals[pdoE].pageViewDuration);
- pdf3.setAttribute("effectType", m_Doc->PDF_Options.PresentVals[pdoE].effectType);
- pdf3.setAttribute("Dm", m_Doc->PDF_Options.PresentVals[pdoE].Dm);
- pdf3.setAttribute("M", m_Doc->PDF_Options.PresentVals[pdoE].M);
- pdf3.setAttribute("Di", m_Doc->PDF_Options.PresentVals[pdoE].Di);
- pdf.appendChild(pdf3);
- }
- QMap<QString,LPIData>::Iterator itlp;
- for (itlp = m_Doc->PDF_Options.LPISettings.begin(); itlp != m_Doc->PDF_Options.LPISettings.end(); ++itlp)
- {
- QDomElement pdf4 = docu.createElement("LPI");
- pdf4.setAttribute("Color", itlp.key());
- pdf4.setAttribute("Frequency", itlp.value().Frequency);
- pdf4.setAttribute("Angle", itlp.value().Angle);
- pdf4.setAttribute("SpotFunction", itlp.value().SpotFunc);
- pdf.appendChild(pdf4);
- }
- dc.appendChild(pdf);
- QDomElement docItemAttrs = docu.createElement("DocItemAttributes");
- for(ObjAttrVector::Iterator objAttrIt = m_Doc->docItemAttributes.begin() ; objAttrIt != m_Doc->docItemAttributes.end(); ++objAttrIt )
- {
- QDomElement itemAttr = docu.createElement("ItemAttribute");
- itemAttr.setAttribute("Name", (*objAttrIt).name);
- itemAttr.setAttribute("Type", (*objAttrIt).type);
- itemAttr.setAttribute("Value", (*objAttrIt).value);
- itemAttr.setAttribute("Parameter", (*objAttrIt).parameter);
- itemAttr.setAttribute("Relationship", (*objAttrIt).relationship);
- itemAttr.setAttribute("RelationshipTo", (*objAttrIt).relationshipto);
- itemAttr.setAttribute("AutoAddTo", (*objAttrIt).autoaddto);
- docItemAttrs.appendChild(itemAttr);
- }
- dc.appendChild(docItemAttrs);
- QDomElement tocElem = docu.createElement("TablesOfContents");
- for(ToCSetupVector::Iterator tocSetupIt = m_Doc->docToCSetups.begin() ; tocSetupIt != m_Doc->docToCSetups.end(); ++tocSetupIt )
- {
- QDomElement tocsetup = docu.createElement("TableOfContents");
- tocsetup.setAttribute("Name", (*tocSetupIt).name);
- tocsetup.setAttribute("ItemAttributeName", (*tocSetupIt).itemAttrName);
- tocsetup.setAttribute("FrameName", (*tocSetupIt).frameName);
- tocsetup.setAttribute("ListNonPrinting", (*tocSetupIt).listNonPrintingFrames);
- tocsetup.setAttribute("Style", (*tocSetupIt).textStyle);
- switch ((*tocSetupIt).pageLocation)
- {
- case Beginning:
- tocsetup.setAttribute("NumberPlacement", "Beginning");
- break;
- case End:
- tocsetup.setAttribute("NumberPlacement", "End");
- break;
- case NotShown:
- tocsetup.setAttribute("NumberPlacement", "NotShown");
- break;
- }
- tocElem.appendChild(tocsetup);
- }
- dc.appendChild(tocElem);
- QDomElement sectionElem = docu.createElement("Sections");
- for(DocumentSectionMap::Iterator it = m_Doc->sections.begin() ; it != m_Doc->sections.end(); ++it )
- {
- QDomElement currsection = docu.createElement("Section");
- currsection.setAttribute("Number", (*it).number);
- currsection.setAttribute("Name", (*it).name);
- currsection.setAttribute("From", (*it).fromindex);
- currsection.setAttribute("To", (*it).toindex);
- switch ((*it).type)
- {
- case Type_1_2_3:
- currsection.setAttribute("Type", "Type_1_2_3");
- break;
- case Type_i_ii_iii:
- currsection.setAttribute("Type", "Type_i_ii_iii");
- break;
- case Type_I_II_III:
- currsection.setAttribute("Type", "Type_I_II_III");
- break;
- case Type_a_b_c:
- currsection.setAttribute("Type", "Type_a_b_c");
- break;
- case Type_A_B_C:
- currsection.setAttribute("Type", "Type_A_B_C");
- break;
- case Type_None:
- currsection.setAttribute("Type", "Type_None");
- break;
- }
- currsection.setAttribute("Start", (*it).sectionstartindex);
- currsection.setAttribute("Reversed", (*it).reversed);
- currsection.setAttribute("Active", (*it).active);
- sectionElem.appendChild(currsection);
- }
- dc.appendChild(sectionElem);
-
- QDomElement pageSetAttr = docu.createElement("PageSets");
- QList<PageSet>::Iterator itpgset;
- for(itpgset = m_Doc->pageSets.begin(); itpgset != m_Doc->pageSets.end(); ++itpgset )
- {
- QDomElement pgst = docu.createElement("Set");
- pgst.setAttribute("Name", (*itpgset).Name);
- pgst.setAttribute("FirstPage", (*itpgset).FirstPage);
- pgst.setAttribute("Rows", (*itpgset).Rows);
- pgst.setAttribute("Columns", (*itpgset).Columns);
-// pgst.setAttribute("GapHorizontal", (*itpgset).GapHorizontal);
-// pgst.setAttribute("GapVertical", (*itpgset).GapVertical);
-// pgst.setAttribute("GapBelow", (*itpgset).GapBelow);
- QStringList pNames = (*itpgset).pageNames;
- QStringList::Iterator itpgsetN;
- for(itpgsetN = pNames.begin(); itpgsetN != pNames.end(); ++itpgsetN )
- {
- QDomElement pgstN = docu.createElement("PageNames");
- pgstN.setAttribute("Name", (*itpgsetN));
- pgst.appendChild(pgstN);
- }
- pageSetAttr.appendChild(pgst);
- }
- dc.appendChild(pageSetAttr);
- if (m_mwProgressBar != 0)
- {
- m_mwProgressBar->setMaximum(m_Doc->DocPages.count()+m_Doc->MasterPages.count()+m_Doc->DocItems.count()+m_Doc->MasterItems.count()+m_Doc->FrameItems.count());
- m_mwProgressBar->setValue(0);
- }
- QString baseDir = QFileInfo(fileName).absolutePath();;
- WritePages(m_Doc, &docu, &dc, m_mwProgressBar, 0, true);
- WritePages(m_Doc, &docu, &dc, m_mwProgressBar, m_Doc->MasterPages.count(), false);
- WriteObjects(m_Doc, &docu, &dc, baseDir, m_mwProgressBar, m_Doc->MasterPages.count()+m_Doc->DocPages.count(), 2);
- WriteObjects(m_Doc, &docu, &dc, baseDir, m_mwProgressBar, m_Doc->MasterPages.count()+m_Doc->DocPages.count()+m_Doc->FrameItems.count(), 0);
- WriteObjects(m_Doc, &docu, &dc, baseDir, m_mwProgressBar, m_Doc->MasterPages.count()+m_Doc->DocPages.count()+m_Doc->MasterItems.count()+m_Doc->FrameItems.count(), 1);
- elem.appendChild(dc);
-/**
- * changed to enable saving
- * of *.gz documents
- * 2.7.2002 C.Toepp
- * <c.toepp at gmx.de>
-*/
- QByteArray cs = docu.toByteArray(); // UTF-8 QCString
- if(fileName.right(2) == "gz")
- {
- // zipped saving
- // XXX: latin1() should probably be local8Bit()
- if (!ScGzFile::writeToFile(fileName, cs))
- return false;
- }
- else
- {
- QFile f(fileName);
- if(!f.open(QIODevice::WriteOnly))
- return false;
- QDataStream s(&f);
- s.writeRawData(cs, cs.length());
- f.close();
- }
- return true;
+ return false;
}
// Low level plugin API
@@ -1746,32 +1212,6 @@
delete plug;
}
-/*
-const ScFace& Scribus13Format::findFont(ScribusDoc *doc, const QString& fontname)
-{
- if (fontname.isEmpty())
- return ScFace::none();
-
- PrefsManager* prefsManager=PrefsManager::instance();
- if (!(*m_AvailableFonts).contains(fontname) || !(*m_AvailableFonts)[fontname].usable())
- {
- if ((!prefsManager->appPrefs.GFontSub.contains(fontname)) || (!(*m_AvailableFonts)[prefsManager->appPrefs.GFontSub[fontname]].usable()))
- {
- newReplacement = true;
- ReplacedFonts.insert(fontname, doc->toolSettings.defFont);
- }
- else
- ReplacedFonts.insert(fontname, prefsManager->appPrefs.GFontSub[fontname]);
- ScFace dummy = (*m_AvailableFonts)[ReplacedFonts[fontname]].mkReplacementFor(fontname, doc->DocName);
- (*m_AvailableFonts).insert(fontname, dummy);
- }
- else if ( !doc->UsedFonts.contains(fontname) )
- {
- doc->AddFont(fontname, qRound(doc->toolSettings.defSize / 10.0));
- }
- return (*m_AvailableFonts)[fontname];
-}
-*/
void Scribus13Format::GetItemText(QDomElement *it, ScribusDoc *doc, PageItem* obj, LastStyles* last, bool impo, bool VorLFound)
{
ScFace dummy = ScFace::none();
More information about the scribus-commit
mailing list