r17911 by fschmid - Added proper enumeration for annotation type.
scribus-commit
scribus-commit at lists.scribus.net
Tue Nov 27 21:23:16 UTC 2012
Author: fschmid
Date: Tue Nov 27 21:23:15 2012
New Revision: 17911
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17911
Log:
Added proper enumeration for annotation type.
Modified:
trunk/Scribus/scribus/actionmanager.cpp
trunk/Scribus/scribus/annotation.h
trunk/Scribus/scribus/canvasmode_create.cpp
trunk/Scribus/scribus/canvasmode_normal.cpp
trunk/Scribus/scribus/documentchecker.cpp
trunk/Scribus/scribus/pageitem_textframe.cpp
trunk/Scribus/scribus/pdflib_core.cpp
trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
trunk/Scribus/scribus/pslib.cpp
trunk/Scribus/scribus/scpageoutput.cpp
trunk/Scribus/scribus/scribusview.cpp
trunk/Scribus/scribus/ui/annot.cpp
trunk/Scribus/scribus/ui/annota.cpp
trunk/Scribus/scribus/ui/outlinepalette.cpp
trunk/Scribus/scribus/ui/selfield.cpp
trunk/Scribus/scribus/ui/tabpdfoptions.cpp
Modified: trunk/Scribus/scribus/actionmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17911&path=/trunk/Scribus/scribus/actionmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/actionmanager.cpp (original)
+++ trunk/Scribus/scribus/actionmanager.cpp Tue Nov 27 21:23:15 2012
@@ -1384,7 +1384,7 @@
if (currItem->isAnnotation())
{
int aType=currItem->annotation().Type();
- bool setter=((aType == 0) || (aType == 1) || (aType > 9));
+ bool setter=((aType == 0) || (aType == 1) || ((aType > Annotation::Listbox) && (aType < Annotation::Annot3D)));
(*scrActions)["itemPDFAnnotationProps"]->setEnabled(setter);
(*scrActions)["itemPDFFieldProps"]->setEnabled(!setter);
}
Modified: trunk/Scribus/scribus/annotation.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17911&path=/trunk/Scribus/scribus/annotation.h
==============================================================================
--- trunk/Scribus/scribus/annotation.h (original)
+++ trunk/Scribus/scribus/annotation.h Tue Nov 27 21:23:15 2012
@@ -46,6 +46,16 @@
AnIPlace(1), AnScaleW(0), AnFormat(0)
{
}
+ enum AnnotationType {
+ Button = 2,
+ Textfield = 3,
+ Checkbox = 4,
+ Combobox = 5,
+ Listbox = 6,
+ Text = 10,
+ Link = 11,
+ Annot3D = 12
+ };
// static const Xml_string saxxDefaultElem;
// static void desaxeRules(const Xml_string& prefixPattern, desaxe::Digester& ruleset, Xml_string elemtag = saxxDefaultElem);
Modified: trunk/Scribus/scribus/canvasmode_create.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17911&path=/trunk/Scribus/scribus/canvasmode_create.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_create.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_create.cpp Tue Nov 27 21:23:15 2012
@@ -736,33 +736,33 @@
switch (m_doc->appMode)
{
case modeInsertPDFButton:
- currItem->annotation().setType(2);
+ currItem->annotation().setType(Annotation::Button);
currItem->annotation().setFlag(65536);
currItem->setItemName( CommonStrings::itemName_PushButton + QString("%1").arg(m_doc->TotalItems));
break;
case modeInsertPDFTextfield:
- currItem->annotation().setType(3);
+ currItem->annotation().setType(Annotation::Textfield);
currItem->setItemName( CommonStrings::itemName_TextField + QString("%1").arg(m_doc->TotalItems));
break;
case modeInsertPDFCheckbox:
- currItem->annotation().setType(4);
+ currItem->annotation().setType(Annotation::Checkbox);
currItem->setItemName( CommonStrings::itemName_CheckBox + QString("%1").arg(m_doc->TotalItems));
break;
case modeInsertPDFCombobox:
- currItem->annotation().setType(5);
+ currItem->annotation().setType(Annotation::Combobox);
currItem->annotation().setFlag(131072);
currItem->setItemName( CommonStrings::itemName_ComboBox + QString("%1").arg(m_doc->TotalItems));
break;
case modeInsertPDFListbox:
- currItem->annotation().setType(6);
+ currItem->annotation().setType(Annotation::Listbox);
currItem->setItemName( CommonStrings::itemName_ListBox + QString("%1").arg(m_doc->TotalItems));
break;
case modeInsertPDFTextAnnotation:
- currItem->annotation().setType(10);
+ currItem->annotation().setType(Annotation::Text);
currItem->setItemName( CommonStrings::itemName_TextAnnotation + QString("%1").arg(m_doc->TotalItems));
break;
case modeInsertPDFLinkAnnotation:
- currItem->annotation().setType(11);
+ currItem->annotation().setType(Annotation::Link);
currItem->annotation().setZiel(m_doc->currentPage()->pageNr());
currItem->annotation().setAction("0 0");
currItem->setItemName( CommonStrings::itemName_LinkAnnotation + QString("%1").arg(m_doc->TotalItems));
@@ -830,7 +830,7 @@
currItem = m_doc->Items->at(z);
currItem->setIsAnnotation(true);
currItem->AutoName = false;
- currItem->annotation().setType(12);
+ currItem->annotation().setType(Annotation::Annot3D);
currItem->setItemName( tr("3DAnnot") + QString("%1").arg(m_doc->TotalItems));
break;
}
Modified: trunk/Scribus/scribus/canvasmode_normal.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17911&path=/trunk/Scribus/scribus/canvasmode_normal.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_normal.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_normal.cpp Tue Nov 27 21:23:15 2012
@@ -366,14 +366,14 @@
QString toolT = "";
if (!hoveredItem->annotation().ToolTip().isEmpty())
toolT = hoveredItem->annotation().ToolTip();
- if (hoveredItem->annotation().Type() == 2)
+ if (hoveredItem->annotation().Type() == Annotation::Button)
{
if (!hoveredItem->annotation().RollOver().isEmpty())
toolT = hoveredItem->annotation().RollOver();
else if (!hoveredItem->annotation().Down().isEmpty())
toolT = hoveredItem->annotation().Down();
}
- else if (hoveredItem->annotation().Type() == 11)
+ else if (hoveredItem->annotation().Type() == Annotation::Link)
{
if (hoveredItem->annotation().ActionType() == 2)
toolT = QString( tr("Go to Page %1").arg(hoveredItem->annotation().Ziel() + 1));
@@ -1235,7 +1235,7 @@
currItem = m_doc->m_Selection->itemAt(0);
if (currItem->isAnnotation())
{
- if (currItem->annotation().Type() == 11)
+ if (currItem->annotation().Type() == Annotation::Link)
{
if (currItem->annotation().ActionType() == 2)
{
Modified: trunk/Scribus/scribus/documentchecker.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17911&path=/trunk/Scribus/scribus/documentchecker.cpp
==============================================================================
--- trunk/Scribus/scribus/documentchecker.cpp (original)
+++ trunk/Scribus/scribus/documentchecker.cpp Tue Nov 27 21:23:15 2012
@@ -304,7 +304,7 @@
if ((currItem->asTextFrame()) || (currItem->asPathText()))
{
#ifndef NLS_PROTO
- if ( currItem->frameOverflows() && (checkerSettings.checkOverflow) && (!((currItem->isAnnotation()) && ((currItem->annotation().Type() == 5) || (currItem->annotation().Type() == 6)))))
+ if ( currItem->frameOverflows() && (checkerSettings.checkOverflow) && (!((currItem->isAnnotation()) && ((currItem->annotation().Type() == Annotation::Combobox) || (currItem->annotation().Type() == Annotation::Listbox)))))
itemError.insert(TextOverflow, 0);
if (currItem->isAnnotation())
{
@@ -595,7 +595,7 @@
if ((currItem->asTextFrame()) || (currItem->asPathText()))
{
#ifndef NLS_PROTO
- if ( currItem->frameOverflows() && (checkerSettings.checkOverflow) && (!((currItem->isAnnotation()) && ((currItem->annotation().Type() == 5) || (currItem->annotation().Type() == 6)))))
+ if ( currItem->frameOverflows() && (checkerSettings.checkOverflow) && (!((currItem->isAnnotation()) && ((currItem->annotation().Type() == Annotation::Combobox) || (currItem->annotation().Type() == Annotation::Listbox)))))
itemError.insert(TextOverflow, 0);
if (currItem->isAnnotation())
{
Modified: trunk/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17911&path=/trunk/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_textframe.cpp (original)
+++ trunk/Scribus/scribus/pageitem_textframe.cpp Tue Nov 27 21:23:15 2012
@@ -3155,7 +3155,7 @@
p->drawRect(0, 0, Width, Height);
}
}
- if (annotation().Type() == 2)
+ if (annotation().Type() == Annotation::Button)
{
int wdt = annotation().Bwid();
QPainterPath clp;
@@ -3186,7 +3186,7 @@
p->restore();
return;
}
- else if (annotation().Type() == 3)
+ else if (annotation().Type() == Annotation::Textfield)
{
int wdt = annotation().Bwid();
TExtra = wdt;
@@ -3196,7 +3196,7 @@
invalid = true;
layout();
}
- else if (annotation().Type() == 4)
+ else if (annotation().Type() == Annotation::Checkbox)
{
if (annotation().IsChk())
{
@@ -3314,7 +3314,7 @@
return;
}
}
- else if (annotation().Type() == 5)
+ else if (annotation().Type() == Annotation::Combobox)
{
int wdt = annotation().Bwid();
if (Width > 2 * wdt + 15)
@@ -3358,7 +3358,7 @@
return;
}
}
- else if (annotation().Type() == 6)
+ else if (annotation().Type() == Annotation::Listbox)
{
int wdt = annotation().Bwid();
if (Width > 2 * wdt + 15)
@@ -5039,7 +5039,7 @@
actionList << "itemPDFIsBookmark";
if (isAnnotation())
{
- if ((annotation().Type() == 0) || (annotation().Type() == 1) || (annotation().Type() > 9))
+ if ((annotation().Type() == 0) || (annotation().Type() == 1) || ((annotation().Type() > Annotation::Listbox) && (annotation().Type() < Annotation::Annot3D)))
actionList << "itemPDFAnnotationProps";
else
actionList << "itemPDFFieldProps";
Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17911&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp (original)
+++ trunk/Scribus/scribus/pdflib_core.cpp Tue Nov 27 21:23:15 2012
@@ -1001,8 +1001,8 @@
if (pgit->isAnnotation())
{
int annotType = pgit->annotation().Type();
- bool mustEmbed = ((annotType >= 2) && (annotType <= 6) && (annotType != 4));
- if (pgit->annotation().Type() == 4)
+ bool mustEmbed = ((annotType >= Annotation::Button) && (annotType <= Annotation::Listbox) && (annotType != Annotation::Checkbox));
+ if (pgit->annotation().Type() == Annotation::Checkbox)
StdFonts.insert("/ZapfDingbats", "");
if (pgit->itemText.length() > 0 || mustEmbed)
{
@@ -1053,8 +1053,8 @@
if (pgit->isAnnotation())
{
int annotType = pgit->annotation().Type();
- bool mustEmbed = ((annotType >= 2) && (annotType <= 6) && (annotType != 4));
- if (pgit->annotation().Type() == 4)
+ bool mustEmbed = ((annotType >= Annotation::Button) && (annotType <= Annotation::Listbox) && (annotType != Annotation::Checkbox));
+ if (pgit->annotation().Type() == Annotation::Checkbox)
StdFonts.insert("/ZapfDingbats", "");
if (pgit->itemText.length() > 0 || mustEmbed)
{
@@ -1105,8 +1105,8 @@
if (pgit->isAnnotation())
{
int annotType = pgit->annotation().Type();
- bool mustEmbed = ((annotType >= 2) && (annotType <= 6) && (annotType != 4));
- if (pgit->annotation().Type() == 4)
+ bool mustEmbed = ((annotType >= Annotation::Button) && (annotType <= Annotation::Listbox) && (annotType != Annotation::Checkbox));
+ if (pgit->annotation().Type() == Annotation::Checkbox)
StdFonts.insert("/ZapfDingbats", "");
if (pgit->itemText.length() > 0 || mustEmbed)
{
@@ -1164,7 +1164,7 @@
{
if (pgit->isAnnotation())
{
- if (pgit->annotation().Type() == 4)
+ if (pgit->annotation().Type() == Annotation::Checkbox)
StdFonts.insert("/ZapfDingbats", "");
if (pgit->itemText.length() > 0)
{
@@ -8373,12 +8373,12 @@
switch (ite->annotation().Type())
{
case 0:
- case 10:
+ case Annotation::Text:
PutDoc("/Subtype /Text\n");
PutDoc("/Contents " + EncStringUTF16(bmUtf16, annotationObj) + "\n");
break;
case 1:
- case 11:
+ case Annotation::Link:
PutDoc("/Subtype /Link\n");
if (ite->annotation().ActionType() == 2)
{
@@ -8403,11 +8403,11 @@
PutDoc("/D ["+QString::number(ite->annotation().Ziel())+" /XYZ "+ite->annotation().Action()+"]\n>>\n");
}
break;
- case 2:
- case 3:
- case 4:
- case 5:
- case 6:
+ case Annotation::Button:
+ case Annotation::Textfield:
+ case Annotation::Checkbox:
+ case Annotation::Combobox:
+ case Annotation::Listbox:
Seite.FormObjects.append(annotationObj);
PutDoc("/Subtype /Widget\n");
PutDoc("/T " + EncString(anTitle, annotationObj) + "\n");
@@ -8447,14 +8447,14 @@
QString xs[] = {"N", "I", "O", "P"};
switch (ite->annotation().Type())
{
- case 2:
+ case Annotation::Button:
PutDoc("/FT /Btn\n");
PutDoc("/H /");
PutDoc(xs[ite->annotation().Feed()]);
PutDoc("\n");
PutDoc("/Q 0\n");
break;
- case 3:
+ case Annotation::Textfield:
PutDoc("/FT /Tx\n");
PutDoc("/V " + EncStringUTF16(bmUtf16, annotationObj) + "\n");
PutDoc("/DV "+ EncStringUTF16(bmUtf16, annotationObj) + "\n");
@@ -8464,15 +8464,15 @@
if (ite->annotation().MaxChar() != -1)
PutDoc("/MaxLen "+QString::number(ite->annotation().MaxChar())+"\n");
break;
- case 4:
+ case Annotation::Checkbox:
PutDoc("/FT /Btn\n");
PutDoc(ite->annotation().IsChk() ? "/V /Yes\n/DV /Yes\n/AS /Yes\n" :
"/V /Off\n/DV /Off\n/AS /Off\n");
appearanceObj = newObject();
PutDoc("/AP << /N << /Yes "+QString::number(appearanceObj)+" 0 R >> >>\n");
break;
- case 5:
- case 6:
+ case Annotation::Combobox:
+ case Annotation::Listbox:
cnx = "%1";
cnx = cnx.arg((bmstUtf16.count() > 0) ? bmstUtf16[0] : "");
cnx = EncStringUTF16(cnx, annotationObj);
@@ -8488,7 +8488,7 @@
break;
}
PutDoc("/MK << ");
- if ((ite->annotation().Type() == 5) || (ite->annotation().Type() == 6))
+ if ((ite->annotation().Type() == Annotation::Combobox) || (ite->annotation().Type() == Annotation::Listbox))
{
PutDoc("/BG [ 1 1 1 ] ");
if (ite->annotation().borderColor() != CommonStrings::None)
@@ -8504,7 +8504,7 @@
int IconOb = 0;
switch (ite->annotation().Type())
{
- case 2:
+ case Annotation::Button:
PutDoc("/CA " + EncString(bmUtf16, annotationObj) + " ");
if (!ite->annotation().RollOver().isEmpty())
PutDoc("/RC " + EncString(ite->annotation().RollOver(), annotationObj) + " ");
@@ -8570,11 +8570,11 @@
PutDoc(" ] >> ");
}
break;
- case 6:
- case 5:
- case 3:
+ case Annotation::Textfield:
+ case Annotation::Combobox:
+ case Annotation::Listbox:
break;
- case 4:
+ case Annotation::Checkbox:
PutDoc("/CA " + EncString(ct, annotationObj) + " ");
break;
}
@@ -8659,7 +8659,7 @@
}
break;
}
- if ((ite->annotation().Type() < 2) || (ite->annotation().Type() > 9))
+ if ((ite->annotation().Type() < 2) || ((ite->annotation().Type() > Annotation::Listbox) && (ite->annotation().Type() < Annotation::Annot3D)))
PutDoc("/Border [ 0 0 0 ]\n");
switch (((abs(static_cast<int>(ite->rotation())) / 90)*90))
{
@@ -8687,7 +8687,7 @@
PutDoc("/Rect [ "+FToStr(x+bleedDisplacementX)+" "+FToStr(y2+bleedDisplacementY)+" "+FToStr(x2+bleedDisplacementX)+" "+FToStr(y+bleedDisplacementY)+" ]\n");
PutDoc(">>\nendobj\n");
// write icons
- if ((ite->annotation().Type() == 2) && (ite->annotation().UseIcons()))
+ if ((ite->annotation().Type() == Annotation::Button) && (ite->annotation().UseIcons()))
{
if (!ite->Pfile.isEmpty())
{
@@ -8715,7 +8715,7 @@
}
}
// write Appearance?
- if (ite->annotation().Type() == 3)
+ if (ite->annotation().Type() == Annotation::Textfield)
{
cc = "";
if (ite->fillColor() != CommonStrings::None)
@@ -8744,7 +8744,7 @@
cc += "1 0 0 1 0 0 Tm\n0 0 Td\n" + EncStringUTF16(bmUtf16, annotationObj) + " Tj\nET\nEMC";
PDF_xForm(appearanceObj, ite->width(), ite->height(), cc);
}
- if (ite->annotation().Type() == 4)
+ if (ite->annotation().Type() == Annotation::Checkbox)
{
cc = "q\nBT\n";
if (ite->itemText.defaultStyle().charStyle().fillColor() != CommonStrings::None)
@@ -8753,7 +8753,7 @@
cc += "0 0 Td\n("+ct+") Tj\nET\nQ";
PDF_xForm(appearanceObj, ite->width(), ite->height(), cc);
}
- if ((ite->annotation().Type() == 5) || (ite->annotation().Type() == 6))
+ if ((ite->annotation().Type() == Annotation::Combobox) || (ite->annotation().Type() == Annotation::Listbox))
{
cc = "";
cc += "1 g\n";
@@ -8805,7 +8805,7 @@
uint F = 0;
uint V = 0;
uint C = 0;
- if ((annot.Type() == 3) || (annot.Type() == 5) || (annot.Type() == 6))
+ if ((annot.Type() == Annotation::Textfield) || (annot.Type() == Annotation::Combobox) || (annot.Type() == Annotation::Listbox))
{
if (!annot.K_act().isEmpty())
K = WritePDFString(annot.K_act());
@@ -8843,7 +8843,7 @@
{
PutDoc("/Bl << /Type /Action /S /JavaScript /JS "+QString::number(Bl)+" 0 R >>\n");
}
- if ((annot.Type() == 3) || (annot.Type() == 5) || (annot.Type() == 6))
+ if ((annot.Type() == Annotation::Textfield) || (annot.Type() == Annotation::Combobox) || (annot.Type() == Annotation::Listbox))
{
if (K)
{
Modified: trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17911&path=/trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp Tue Nov 27 21:23:15 2012
@@ -337,7 +337,7 @@
}
ite->setIsAnnotation(true);
ite->AutoName = false;
- ite->annotation().setType(10);
+ ite->annotation().setType(Annotation::Text);
ite->annotation().setActionType(0);
ite->setItemName( CommonStrings::itemName_TextAnnotation + QString("%1").arg(m_doc->TotalItems));
ite->itemText.insertChars(UnicodeParsedString(annota->getContents()));
@@ -475,7 +475,7 @@
ite->annotation().setExtern(fileName);
ite->annotation().setActionType(8);
}
- ite->annotation().setType(11);
+ ite->annotation().setType(Annotation::Link);
ite->setItemName( CommonStrings::itemName_LinkAnnotation + QString("%1").arg(m_doc->TotalItems));
}
return validLink;
Modified: trunk/Scribus/scribus/pslib.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17911&path=/trunk/Scribus/scribus/pslib.cpp
==============================================================================
--- trunk/Scribus/scribus/pslib.cpp (original)
+++ trunk/Scribus/scribus/pslib.cpp Tue Nov 27 21:23:15 2012
@@ -1311,12 +1311,12 @@
switch (item->annotation().Type())
{
case 0:
- case 10:
+ case Annotation::Text:
PutStream("/Subtype /Text\n");
PutStream("/Contents ("+text+")\n/Open false\n");
break;
case 1:
- case 11:
+ case Annotation::Link:
PutStream("/Subtype /Link\n");
if (item->annotation().ActionType() == 2)
{
@@ -1819,7 +1819,7 @@
}
if (c->isAnnotation())
{
- if ((c->annotation().Type() == 0) || (c->annotation().Type() == 1) || (c->annotation().Type() == 10) || (c->annotation().Type() == 11))
+ if ((c->annotation().Type() == 0) || (c->annotation().Type() == 1) || (c->annotation().Type() == Annotation::Text) || (c->annotation().Type() == Annotation::Link))
{
QString bm = "";
QString cc;
Modified: trunk/Scribus/scribus/scpageoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17911&path=/trunk/Scribus/scribus/scpageoutput.cpp
==============================================================================
--- trunk/Scribus/scribus/scpageoutput.cpp (original)
+++ trunk/Scribus/scribus/scpageoutput.cpp Tue Nov 27 21:23:15 2012
@@ -1600,7 +1600,7 @@
painter->setupPolygon(&item->PoLine);
fillPath(item, painter, clip);
}
- if ((item->isAnnotation()) && (item->annotation().Type() == 2) && (!item->Pfile.isEmpty()) && (item->PictureIsAvailable) && (item->imageShown()) && (item->annotation().UseIcons()))
+ if ((item->isAnnotation()) && (item->annotation().Type() == Annotation::Button) && (!item->Pfile.isEmpty()) && (item->PictureIsAvailable) && (item->imageShown()) && (item->annotation().UseIcons()))
{
painter->save();
painter->setupPolygon(&item->PoLine);
Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17911&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp (original)
+++ trunk/Scribus/scribus/scribusview.cpp Tue Nov 27 21:23:15 2012
@@ -305,7 +305,7 @@
storedShowControls = Doc->guidesPrefs().showControls;
setRulersShown(Doc->guidesPrefs().rulersShown);
m_canvas->m_viewMode.viewAsPreview = false;
- m_canvas->setPreviewVisual(-1);
+ m_canvas->setPreviewVisual(0);
// shiftSelItems = false;
// inItemCreation = false;
m_previousMode = -1;
@@ -1940,7 +1940,7 @@
currItem->AutoName = false;
if (Doc->masterPageMode())
{
- currItem->annotation().setType(11);
+ currItem->annotation().setType(Annotation::Link);
currItem->annotation().setZiel(0);
currItem->annotation().setAction("0 0");
}
Modified: trunk/Scribus/scribus/ui/annot.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17911&path=/trunk/Scribus/scribus/ui/annot.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/annot.cpp (original)
+++ trunk/Scribus/scribus/ui/annot.cpp Tue Nov 27 21:23:15 2012
@@ -228,19 +228,19 @@
GroupBox30Layout->setAlignment( Qt::AlignTop );
ReadOnly = new QCheckBox( GroupBox30 );
ReadOnly->setText( tr( "Read Only" ) );
- if (item->annotation().Type() == 2)
+ if (item->annotation().Type() == Annotation::Button)
ReadOnly->setEnabled(false);
ReadOnly->setChecked(item->annotation().Flag() & 1);
GroupBox30Layout->addWidget( ReadOnly, 0, 0, 1, 2 );
Required = new QCheckBox( GroupBox30 );
Required->setText( tr( "Required" ) );
- if (item->annotation().Type() == 2)
+ if (item->annotation().Type() == Annotation::Button)
Required->setEnabled(false);
Required->setChecked(item->annotation().Flag() & 2);
GroupBox30Layout->addWidget( Required, 1, 0, 1, 2 );
NoExport = new QCheckBox( GroupBox30 );
NoExport->setText( tr( "Do Not Export Value" ) );
- if (item->annotation().Type() == 2)
+ if (item->annotation().Type() == Annotation::Button)
NoExport->setEnabled(false);
NoExport->setChecked(item->annotation().Flag() & 4);
GroupBox30Layout->addWidget( NoExport, 2, 0, 1, 2 );
@@ -1908,7 +1908,7 @@
if (item->annotation().borderColor() == CommonStrings::tr_NoneColor)
item->annotation().setBorderColor(CommonStrings::None);
Limit->isChecked() ? item->annotation().setMaxChar(MaxChars->value()) : item->annotation().setMaxChar(-1);
- if (item->annotation().Type() == 2)
+ if (item->annotation().Type() == Annotation::Button)
{
item->annotation().addToFlag(65536);
if (item->Pfile.isEmpty())
@@ -1924,13 +1924,13 @@
if (NoExport->isChecked())
item->annotation().addToFlag(4);
}
- if (item->annotation().Type() == 5)
+ if (item->annotation().Type() == Annotation::Combobox)
{
item->annotation().addToFlag(131072);
if (CanEdit->isChecked())
item->annotation().addToFlag(262144);
}
- if (item->annotation().Type() == 3)
+ if (item->annotation().Type() == Annotation::Textfield)
{
if (MultiL->isChecked())
item->annotation().addToFlag(4096);
@@ -1941,7 +1941,7 @@
if (NoScroll->isChecked())
item->annotation().addToFlag(8388608);
}
- if ((item->annotation().Type() == 3) || (item->annotation().Type() == 5))
+ if ((item->annotation().Type() == Annotation::Textfield) || (item->annotation().Type() == Annotation::Combobox))
{
if (NoValid->isChecked())
item->annotation().setV_act("");
Modified: trunk/Scribus/scribus/ui/annota.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17911&path=/trunk/Scribus/scribus/ui/annota.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/annota.cpp (original)
+++ trunk/Scribus/scribus/ui/annota.cpp Tue Nov 27 21:23:15 2012
@@ -286,7 +286,7 @@
else
item->annotation().setActionType(7);
}
- item->annotation().setType(11);
+ item->annotation().setType(Annotation::Link);
break;
case 13:
item->annotation().setAction("");
@@ -295,7 +295,7 @@
item->annotation().setExtern(Destfile->text());
item->annotation().setActionType(8);
}
- item->annotation().setType(11);
+ item->annotation().setType(Annotation::Link);
break;
}
accept();
Modified: trunk/Scribus/scribus/ui/outlinepalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17911&path=/trunk/Scribus/scribus/ui/outlinepalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/outlinepalette.cpp (original)
+++ trunk/Scribus/scribus/ui/outlinepalette.cpp Tue Nov 27 21:23:15 2012
@@ -290,25 +290,25 @@
case PageItem::TextFrame:
switch (pgItem->annotation().Type())
{
- case 2:
+ case Annotation::Button:
tipText += CommonStrings::itemSubType_PDF_PushButton;
break;
- case 3:
+ case Annotation::Textfield:
tipText += CommonStrings::itemSubType_PDF_TextField;
break;
- case 4:
+ case Annotation::Checkbox:
tipText += CommonStrings::itemSubType_PDF_CheckBox;
break;
- case 5:
+ case Annotation::Combobox:
tipText += CommonStrings::itemSubType_PDF_ComboBox;
break;
- case 6:
+ case Annotation::Listbox:
tipText += CommonStrings::itemSubType_PDF_ListBox;
break;
- case 10:
+ case Annotation::Text:
tipText += CommonStrings::itemSubType_PDF_TextAnnotation;
break;
- case 11:
+ case Annotation::Link:
tipText += CommonStrings::itemSubType_PDF_LinkAnnotation;
break;
default:
@@ -751,25 +751,25 @@
case PageItem::TextFrame:
switch (pgItem->annotation().Type())
{
- case 2:
+ case Annotation::Button:
item->setIcon( 0, buttonIcon );
break;
- case 3:
+ case Annotation::Textfield:
item->setIcon( 0, textFieldIcon );
break;
- case 4:
+ case Annotation::Checkbox:
item->setIcon( 0, checkBoxIcon );
break;
- case 5:
+ case Annotation::Combobox:
item->setIcon( 0, comboBoxIcon );
break;
- case 6:
+ case Annotation::Listbox:
item->setIcon( 0, listBoxIcon );
break;
- case 10:
+ case Annotation::Text:
item->setIcon( 0, annotTextIcon );
break;
- case 11:
+ case Annotation::Link:
item->setIcon( 0, annotLinkIcon );
break;
default:
Modified: trunk/Scribus/scribus/ui/selfield.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17911&path=/trunk/Scribus/scribus/ui/selfield.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/selfield.cpp (original)
+++ trunk/Scribus/scribus/ui/selfield.cpp Tue Nov 27 21:23:15 2012
@@ -53,7 +53,7 @@
PageItem* item = allItems.at(ii);
if (Art < 2)
{
- if ((item->isAnnotation()) && ((item->annotation().Type() > 1) && (item->annotation().Type() < 12)))
+ if ((item->isAnnotation()) && ((item->annotation().Type() > 1) && (item->annotation().Type() < Annotation::Annot3D)))
AvailFields->addItem(item->itemName());
}
else
Modified: trunk/Scribus/scribus/ui/tabpdfoptions.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17911&path=/trunk/Scribus/scribus/ui/tabpdfoptions.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/tabpdfoptions.cpp (original)
+++ trunk/Scribus/scribus/ui/tabpdfoptions.cpp Tue Nov 27 21:23:15 2012
@@ -1083,7 +1083,7 @@
if (((pgit->itemType() == PageItem::TextFrame) || (pgit->itemType() == PageItem::PathText)) && (pgit->isAnnotation()))
{
int annotType = pgit->annotation().Type();
- bool mustEmbed = ((annotType >= 2) && (annotType <= 6) && (annotType != 4));
+ bool mustEmbed = ((annotType >= Annotation::Button) && (annotType <= Annotation::Listbox) && (annotType != Annotation::Checkbox));
if (pgit->itemText.length() > 0 || mustEmbed)
AnnotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
}
@@ -1103,7 +1103,7 @@
if (((pgit->itemType() == PageItem::TextFrame) || (pgit->itemType() == PageItem::PathText)) && (pgit->isAnnotation()))
{
int annotType = pgit->annotation().Type();
- bool mustEmbed = ((annotType >= 2) && (annotType <= 6) && (annotType != 4));
+ bool mustEmbed = ((annotType >= Annotation::Button) && (annotType <= Annotation::Listbox) && (annotType != Annotation::Checkbox));
if (pgit->itemText.length() > 0 || mustEmbed)
AnnotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
}
@@ -1123,7 +1123,7 @@
if (((pgit->itemType() == PageItem::TextFrame) || (pgit->itemType() == PageItem::PathText)) && (pgit->isAnnotation()))
{
int annotType = pgit->annotation().Type();
- bool mustEmbed = ((annotType >= 2) && (annotType <= 6) && (annotType != 4));
+ bool mustEmbed = ((annotType >= Annotation::Button) && (annotType <= Annotation::Listbox) && (annotType != Annotation::Checkbox));
if (pgit->itemText.length() > 0 || mustEmbed)
AnnotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
}
More information about the scribus-commit
mailing list