Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 3624 → Rev 3625

/branches/Version13x/Scribus/scribus/documentchecker.cpp
50,7 → 50,7
itemError.insert(6, 0);
if ((currItem->OwnPage == -1) && (checkerSettings.checkOrphans))
itemError.insert(3, 0);
if (currItem->itemType() == PageItem::ImageFrame)
if (currItem->asImageFrame())
{
if ((!currItem->PicAvail) && (checkerSettings.checkPictures))
itemError.insert(4, 0);
65,7 → 65,7
itemError.insert(8, 0);
}
}
if ((currItem->itemType() == PageItem::TextFrame) || (currItem->itemType() == PageItem::PathText))
if ((currItem->asTextFrame()) || (currItem->asPathText()))
{
if ((currItem->itemText.count() > currItem->MaxChars) && (checkerSettings.checkOverflow))
itemError.insert(2, 0);
139,7 → 139,7
itemError.insert(7, 0);
if ((currItem->OwnPage == -1) && (checkerSettings.checkOrphans))
itemError.insert(3, 0);
if (currItem->itemType() == PageItem::ImageFrame)
if (currItem->asImageFrame())
{
if ((!currItem->PicAvail) && (checkerSettings.checkPictures))
itemError.insert(4, 0);
154,7 → 154,7
itemError.insert(8, 0);
}
}
if ((currItem->itemType() == PageItem::TextFrame) || (currItem->itemType() == PageItem::PathText))
if ((currItem->asTextFrame()) || (currItem->asPathText()))
{
if ((currItem->itemText.count() > currItem->MaxChars) && (checkerSettings.checkOverflow))
itemError.insert(2, 0);
/branches/Version13x/Scribus/scribus/fileloader.cpp
198,7 → 198,7
PageItem *it = app->doc->MasterItems.at(d);
if ((!app->doc->UsedFonts.contains(it->IFont)) && (!it->IFont.isEmpty()))
it->IFont = ReplacedFonts[it->IFont];
if ((it->itemType() == PageItem::TextFrame) || (it->itemType() == PageItem::PathText))
if ((it->asTextFrame()) || (it->asPathText()))
{
for (uint e = 0; e < it->itemText.count(); ++e)
{
212,7 → 212,7
PageItem *it = app->doc->DocItems.at(d);
if ((!app->doc->UsedFonts.contains(it->IFont)) && (!it->IFont.isEmpty()))
it->IFont = ReplacedFonts[it->IFont];
if ((it->itemType() == PageItem::TextFrame) || (it->itemType() == PageItem::PathText))
if ((it->asTextFrame()) || (it->asPathText()))
{
for (uint e = 0; e < it->itemText.count(); ++e)
{
226,7 → 226,7
PageItem *it = app->doc->FrameItems.at(d);
if ((!app->doc->UsedFonts.contains(it->IFont)) && (!it->IFont.isEmpty()))
it->IFont = ReplacedFonts[it->IFont];
if ((it->itemType() == PageItem::TextFrame) || (it->itemType() == PageItem::PathText))
if ((it->asTextFrame()) || (it->asPathText()))
{
for (uint e = 0; e < it->itemText.count(); ++e)
{
375,7 → 375,7
PageItem *it = app->doc->MasterItems.at(d);
if ((!app->doc->UsedFonts.contains(it->IFont)) && (!it->IFont.isEmpty()))
it->IFont = ReplacedFonts[it->IFont];
if ((it->itemType() == PageItem::TextFrame) || (it->itemType() == PageItem::PathText))
if ((it->asTextFrame()) || (it->asPathText()))
{
for (uint e = 0; e < it->itemText.count(); ++e)
{
389,7 → 389,7
PageItem *it = app->doc->DocItems.at(d);
if ((!app->doc->UsedFonts.contains(it->IFont)) && (!it->IFont.isEmpty()))
it->IFont = ReplacedFonts[it->IFont];
if ((it->itemType() == PageItem::TextFrame) || (it->itemType() == PageItem::PathText))
if ((it->asTextFrame()) || (it->asPathText()))
{
for (uint e = 0; e < it->itemText.count(); ++e)
{
403,7 → 403,7
PageItem *it = app->doc->FrameItems.at(d);
if ((!app->doc->UsedFonts.contains(it->IFont)) && (!it->IFont.isEmpty()))
it->IFont = ReplacedFonts[it->IFont];
if ((it->itemType() == PageItem::TextFrame) || (it->itemType() == PageItem::PathText))
if ((it->asTextFrame()) || (it->asPathText()))
{
for (uint e = 0; e < it->itemText.count(); ++e)
{
2234,7 → 2234,7
}
else
currItem->ContourLine = currItem->PoLine.copy();
if (currItem->itemType() != PageItem::Line)
if (!currItem->asLine())
currItem->Clip = FlattenPath(currItem->PoLine, currItem->Segments);
else
{
2246,9 → 2246,9
-ph,static_cast<int>(currItem->Height+ph));
currItem->Height = 1;
}
if (currItem->itemType() == PageItem::ImageFrame)
if (currItem->asImageFrame())
view->AdjustPictScale(currItem);
if ((currItem->itemType() != PageItem::TextFrame) && (currItem->itemType() != PageItem::PathText))
if (!(currItem->asTextFrame()) && !(currItem->asPathText()))
currItem->IFont = doc->toolSettings.defFont;
currItem->GrType = QStoInt(obj->attribute("GRTYP","0"));
QString GrColor;
/branches/Version13x/Scribus/scribus/pageitem_polyline.h
45,6 → 45,7
 
public:
PageItem_PolyLine(ScribusDoc *pa, double x, double y, double w, double h, double w2, QString fill, QString outline);
PageItem_PolyLine(const PageItem & p) : PageItem(p) {}
~PageItem_PolyLine() {};
virtual PageItem_PolyLine * asPolyLine() { return this; }
/branches/Version13x/Scribus/scribus/hyphenator.cpp
228,7 → 228,7
nextItem->CPos = 0;
nextItem = nextItem->NextBox;
}
if ((!useAble) || (nb1->itemType() != PageItem::TextFrame) || (nb1 ->itemText.count() == 0))
if ((!useAble) || !(nb1->asTextFrame()) || (nb1 ->itemText.count() == 0))
return;
doc->DoDrawing = false;
const char *word;
378,7 → 378,7
{
PageItem *nextItem = it;
PageItem *nb1;
if ((it->itemType() != PageItem::TextFrame) || (it ->itemText.count() == 0))
if (!(it->asTextFrame()) || (it ->itemText.count() == 0))
return;
while (nextItem != 0)
{
/branches/Version13x/Scribus/scribus/mpalette.cpp
933,7 → 933,7
SCustom->setPixmap(SCustom->getIconPixmap(1));
if (i->FrameType > 3)
SCustom->setPixmap(SCustom->getIconPixmap(i->FrameType-2));
if ((i->itemType() == PageItem::Line) || (i->itemType() == PageItem::PolyLine))
if ((i->asLine()) || (i->asPolyLine()))
{
startArrow->setEnabled(true);
endArrow->setEnabled(true);
1035,7 → 1035,7
Width->setReadOnly(setter);
Height->setReadOnly(setter);
}
if (i->itemType() == PageItem::PathText)
if (i->asPathText())
{
TabStack2->raiseWidget(1);
showcurveCheckBox->setChecked(i->PoShow);
1046,11 → 1046,11
TabStack2->raiseWidget(0);
// Frame type 3 is obsolete: CR 2005-02-06
//if (((i->itemType() == PageItem::TextFrame) || (i->itemType() == PageItem::ImageFrame) || (i->itemType() == 3)) && (!i->ClipEdited))
if (((i->itemType() == PageItem::TextFrame) || (i->itemType() == PageItem::ImageFrame)) && (!i->ClipEdited))
if (((i->asTextFrame()) || (i->asImageFrame())) && (!i->ClipEdited))
RoundRect->setEnabled(true);
else
{
if ((i->itemType() == PageItem::Polygon) && ((i->FrameType == 0) || (i->FrameType == 2)))
if ((i->asPolygon()) && ((i->FrameType == 0) || (i->FrameType == 2)))
RoundRect->setEnabled(true);
else
RoundRect->setEnabled(false);
1070,7 → 1070,7
Rot->setEnabled(true);
}
HaveItem = true;
if (i->itemType() == PageItem::Line)
if (i->asLine())
{
keepFrameWHRatioButton->setEnabled(false);
if (LMode && !i->locked())
1082,7 → 1082,7
{
Height->setEnabled(true);
keepFrameWHRatioButton->setEnabled(true);
if (i->itemType() == PageItem::ImageFrame)
if (i->asImageFrame())
{
updateCmsList();
setter = i->ScaleType;
1454,7 → 1454,7
HaveItem = false;
QWMatrix ma;
QPoint dp;
if ((LMode) && (CurItem->itemType() == PageItem::Line))
if ((LMode) && (CurItem->asLine()))
{
ma.translate(static_cast<double>(Xpos->value()) / Umrech, static_cast<double>(Ypos->value()) / Umrech);
ma.rotate(static_cast<double>(Rot->value())*(-1));
1851,7 → 1851,7
}
else
{
if ((CurItem->itemType() == PageItem::Line) && (LMode))
if ((CurItem->asLine()) && (LMode))
{
double r = atan2(h-y,w-x)*(180.0/M_PI);
w = sqrt(pow(w-x,2)+pow(h-y,2));
1913,7 → 1913,7
}
else
{
if ((CurItem->itemType() == PageItem::Line) && (LMode))
if ((CurItem->asLine()) && (LMode))
{
double r = atan2(h-y,w-x)*(180.0/M_PI);
w = sqrt(pow(w-x,2)+pow(h-y,2));
1972,7 → 1972,7
{
CurItem->OldB2 = CurItem->Width;
CurItem->OldH2 = CurItem->Height;
if (CurItem->itemType() == PageItem::Line)
if (CurItem->asLine())
{
if (LMode)
{
2069,7 → 2069,7
{
CurItem->OldB2 = CurItem->Width;
CurItem->OldH2 = CurItem->Height;
if (CurItem->itemType() == PageItem::Line)
if (CurItem->asLine())
{
if (LMode)
{
/branches/Version13x/Scribus/scribus/pageitem_imageframe.h
45,6 → 45,7
 
public:
PageItem_ImageFrame(ScribusDoc *pa, double x, double y, double w, double h, double w2, QString fill, QString outline);
PageItem_ImageFrame(const PageItem & p) : PageItem(p) {}
~PageItem_ImageFrame() {};
 
virtual PageItem_ImageFrame * asImageFrame() { return this; }
/branches/Version13x/Scribus/scribus/loremipsum.cpp
201,7 → 201,7
{
if (ScApp->view->SelItem.at(i) == NULL)
continue;
if (ScApp->view->SelItem.at(i)->itemType() != PageItem::TextFrame)
if (! ScApp->view->SelItem.at(i)->asTextFrame())
continue;
if (ScApp->view->SelItem.at(i)->itemText.count() != 0)
{
/branches/Version13x/Scribus/scribus/pageitem_line.h
45,6 → 45,7
 
public:
PageItem_Line(ScribusDoc *pa, double x, double y, double w, double h, double w2, QString fill, QString outline);
PageItem_Line(const PageItem & p) : PageItem(p) {}
~PageItem_Line() {};
virtual PageItem_Line * asLine() { return this; }
/branches/Version13x/Scribus/scribus/collect4output.cpp
160,7 → 160,7
ite = ScApp->doc->FrameItems.at(b);
break;
}
if (ite->itemType() == PageItem::ImageFrame)
if (ite->asImageFrame())
{
QFileInfo itf = QFileInfo(ite->Pfile);
if (itf.exists())
174,7 → 174,7
}
}
}
if (ite->itemType() == PageItem::TextFrame)
if (ite->asTextFrame())
{
if (ite->isAnnotation)
{
/branches/Version13x/Scribus/scribus/pdflib.cpp
1663,7 → 1663,7
if ((!pag->PageNam.isEmpty()) && (ite->OwnPage != static_cast<int>(pag->pageNr())) && (ite->OwnPage != -1))
continue;
QString name = "/"+pag->MPageNam.simplifyWhiteSpace().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" ) + IToStr(ite->ItemNr);
if (ite->itemType() != PageItem::TextFrame)
if (! ite->asTextFrame())
PutPage(name+" Do\n");
else
{
2657,7 → 2657,7
continue;
if (hl->cstyle & 4096)
continue;
if ((hl->yp == 0) && (ite->itemType() == PageItem::TextFrame))
if ((hl->yp == 0) && (ite->asTextFrame()))
continue;
if (hl->cab < 5)
tTabValues = ite->TabValues;
2772,7 → 2772,7
{
QString FillColor = "";
QString StrokeColor = "";
if (ite->itemType() == PageItem::PathText)
if (ite->asPathText())
{
tmp += "q\n";
QWMatrix trafo = QWMatrix( 1, 0, 0, -1, -hl->PRot, 0 );
2912,7 → 2912,7
trafo *= QWMatrix( hl->PtransX, -hl->PtransY, -hl->PtransY, -hl->PtransX, hl->xp, -hl->yp );
tmp2 += FToStr(trafo.m11())+" "+FToStr(trafo.m12())+" "+FToStr(trafo.m21())+" "+FToStr(trafo.m22())+" "+FToStr(trafo.dx())+" "+FToStr(trafo.dy())+" cm\n";
}
if (ite->itemType() != PageItem::PathText)
if (!ite->asPathText())
{
if (ite->Reverse)
{
3038,7 → 3038,7
tmp += FToStr(tsz * hl->coutline / 10000.0) + (hl->ccolor != "None" ? " w 2 Tr\n" : " w 1 Tr\n");
else
tmp += "0 Tr\n";
if (ite->itemType() != PageItem::PathText)
if (!ite->asPathText())
{
if (ite->Reverse)
{
3065,7 → 3065,7
tmp += FToStr(QMIN(QMAX(hl->cscale, 100), 4000) / 1000.0)+" 0 0 "+FToStr(QMIN(QMAX(hl->cscalev, 100), 4000) / 1000.0)+" 0 0 Tm\n";
uchar idx2 = idx & 0xFF;
tmp += "<"+QString(toHex(idx2))+"> Tj\n";
if (ite->itemType() != PageItem::PathText)
if (! ite->asPathText())
{
if (hl->cstyle & 8192)
{
3150,7 → 3150,7
tmp2 += FToStr(hl->xp+Ulen)+" "+FToStr(-hl->yp+Upos)+" l\n";
tmp2 += "S\n";
}
if (ite->itemType() == PageItem::PathText)
if (ite->asPathText())
{
tmp += "ET\nQ\n"+tmp2;
tmp2 = "";
4834,7 → 4834,7
for (uint ele = 0; ele < doc->Items.count(); ++ele)
{
PageItem* tel = doc->Items.at(ele);
if ((tel->itemType() == PageItem::TextFrame) && (tel->BackBox == 0) && (tel->NextBox != 0) &&
if ((tel->asTextFrame()) && (tel->BackBox == 0) && (tel->NextBox != 0) &&
(!tel->Redrawn))
{
StartObj(ObjCounter);
/branches/Version13x/Scribus/scribus/frameedit.cpp
475,7 → 475,7
cc = view->SelItem.at(0)->ContourLine.size();
else
cc = view->SelItem.at(0)->PoLine.size();
if (view->SelItem.at(0)->itemType() == PageItem::PolyLine)
if (view->SelItem.at(0)->asPolyLine())
{
if (cc < 5)
leaveEd = true;
/branches/Version13x/Scribus/scribus/pageitem_pathtext.h
46,6 → 46,7
 
public:
PageItem_PathText(ScribusDoc *pa, double x, double y, double w, double h, double w2, QString fill, QString outline);
PageItem_PathText(const PageItem & p) : PageItem(p) {}
~PageItem_PathText() {};
virtual PageItem_PathText * asPathText() { return this; }
/branches/Version13x/Scribus/scribus/scribusXml.cpp
363,7 → 363,7
ob->setAttribute("TEXTRA",item->TExtra);
ob->setAttribute("BEXTRA",item->BExtra);
ob->setAttribute("REXTRA",item->RExtra);
if (((item->itemType() == PageItem::ImageFrame) || (item->itemType() == PageItem::TextFrame)) && (!item->Pfile.isEmpty()))
if (((item->asImageFrame()) || (item->asTextFrame())) && (!item->Pfile.isEmpty()))
ob->setAttribute("PFILE",Path2Relative(item->Pfile));
else
ob->setAttribute("PFILE","");
2292,7 → 2292,7
vg.kernVal = doc->docParagraphStyles[item->textAlignment].kernVal;
UsedStyles[item->textAlignment] = vg;
}
if (((item->itemType() == PageItem::TextFrame) || (item->itemType() == PageItem::PathText)) && (item->itemText.count() != 0))
if (((item->asTextFrame()) || (item->asPathText())) && (item->itemText.count() != 0))
{
for (uint tx = 0; tx < item->itemText.count(); ++tx)
{
/branches/Version13x/Scribus/scribus/pageitem.h
36,7 → 36,6
class UndoState;
class Foi;
 
class PageItem;
class PageItem_ImageFrame;
class PageItem_Line;
class PageItem_Polygon;
153,7 → 152,10
QChar tabFillChar;
};
 
 
protected:
PageItem(const PageItem & other);
public:
PageItem(ScribusDoc *pa, ItemType newType, double x, double y, double w, double h, double w2, QString fill, QString outline);
~PageItem() {};
struct ZZ {
/branches/Version13x/Scribus/scribus/pageitem.cpp
49,6 → 49,218
 
using namespace std;
 
PageItem::PageItem(const PageItem & other)
: QObject(other.parent()),
 
// 200 attributes! That is madness, or to quote some famous people from Kriquet:
// "THAT ALL HAS TO GO!"
Reverse(other.Reverse),
Xpos(other.Xpos),
oldXpos(other.oldXpos),
Ypos(other.Ypos),
oldYpos(other.oldYpos),
Width(other.Width),
oldWidth(other.oldWidth),
Height(other.Height),
oldHeight(other.oldHeight),
gXpos(other.gXpos),
gYpos(other.gYpos),
gWidth(other.gWidth),
gHeight(other.gHeight),
RadRect(other.RadRect),
Rot(other.Rot),
oldRot(other.oldRot),
Doc(other.Doc),
GrType(other.GrType),
GrStartX(other.GrStartX),
GrStartY(other.GrStartY),
GrEndX(other.GrEndX),
GrEndY(other.GrEndY),
TxtStroke(other.TxtStroke),
TxtFill(other.TxtFill),
ShTxtStroke(other.ShTxtStroke),
ShTxtFill(other.ShTxtFill),
TxtScale(other.TxtScale),
TxtScaleV(other.TxtScaleV),
TxTStyle(other.TxTStyle),
TxtBase(other.TxtBase),
TxtShadowX(other.TxtShadowX),
TxtShadowY(other.TxtShadowY),
TxtOutline(other.TxtOutline),
TxtUnderPos(other.TxtUnderPos),
TxtUnderWidth(other.TxtUnderWidth),
TxtStrikePos(other.TxtStrikePos),
TxtStrikeWidth(other.TxtStrikeWidth),
Cols(other.Cols),
ColGap(other.ColGap),
Pwidth(other.Pwidth),
OldPwidth(other.OldPwidth),
PLineArt(other.PLineArt),
PLineEnd(other.PLineEnd),
PLineJoin(other.PLineJoin),
NamedLStyle(other.NamedLStyle),
Select(other.Select),
Clip(other.Clip),
PoLine(other.PoLine),
ContourLine(other.ContourLine),
imageClip(other.imageClip),
Segments(other.Segments),
effectsInUse(other.effectsInUse),
PoShow(other.PoShow),
BaseOffs(other.BaseOffs),
ClipEdited(other.ClipEdited),
FrameType(other.FrameType),
ItemNr(other.ItemNr),
Frame(other.Frame),
OwnPage(other.OwnPage),
savedOwnPage(other.savedOwnPage),
oldOwnPage(other.oldOwnPage),
pixm(other.pixm),
Pfile(other.Pfile),
Pfile2(other.Pfile2),
Pfile3(other.Pfile3),
IProfile(other.IProfile),
UseEmbedded(other.UseEmbedded),
EmProfile(other.EmProfile),
IRender(other.IRender),
PicArt(other.PicArt),
PicAvail(other.PicAvail),
LocalScX(other.LocalScX),
LocalScY(other.LocalScY),
LocalX(other.LocalX),
LocalY(other.LocalY),
OrigW(other.OrigW),
OrigH(other.OrigH),
BBoxX(other.BBoxX),
BBoxH(other.BBoxH),
Extra(other.Extra),
TExtra(other.TExtra),
BExtra(other.BExtra),
RExtra(other.RExtra),
LineSp(other.LineSp),
LineSpMode(other.LineSpMode),
CurX(other.CurX),
CurY(other.CurY),
CPos(other.CPos),
itemText(other.itemText),
isBookmark(other.isBookmark),
BMnr(other.BMnr),
isAnnotation(other.isAnnotation),
AnType(other.AnType),
AnActType(other.AnActType),
AnAction(other.AnAction),
An_E_act(other.An_E_act),
An_X_act(other.An_X_act),
An_D_act(other.An_D_act),
An_Fo_act(other.An_Fo_act),
An_Bl_act(other.An_Bl_act),
An_K_act(other.An_K_act),
An_F_act(other.An_F_act),
An_V_act(other.An_V_act),
An_C_act(other.An_C_act),
AutoName(other.AutoName),
AnToolTip(other.AnToolTip),
AnRollOver(other.AnRollOver),
AnDown(other.AnDown),
AnBColor(other.AnBColor),
An_Extern(other.An_Extern),
AnBsty(other.AnBsty),
AnBwid(other.AnBwid),
AnFeed(other.AnFeed),
AnZiel(other.AnZiel),
AnFlag(other.AnFlag),
AnMaxChar(other.AnVis),
AnVis(other.AnVis),
AnChkStil(other.AnChkStil),
AnFont(other.AnFont),
AnIsChk(other.AnIsChk),
AnAAact(other.AnAAact),
AnHTML(other.AnHTML),
AnUseIcons(other.AnUseIcons),
AnIPlace(other.AnIPlace),
AnScaleW(other.AnScaleW),
AnFormat(other.AnFormat),
IFont(other.IFont),
ISize(other.ISize),
HasSel(other.HasSel),
FrameOnly(other.FrameOnly),
BackBox(other.BackBox),
NextBox(other.NextBox),
NextIt(other.NextIt),
NextPg(other.NextPg),
Tinput(other.Tinput),
isAutoText(other.isAutoText),
textAlignment(other.textAlignment),
MaxChars(other.MaxChars),
Redrawn(other.Redrawn),
ExtraV(other.ExtraV),
isRaster(other.isRaster),
OldB(other.OldB),
OldH(other.OldH),
OldB2(other.OldB2),
OldH2(other.OldH2),
Sizing(other.Sizing),
toPixmap(other.toPixmap),
LayerNr(other.LayerNr),
ScaleType(other.ScaleType),
AspectRatio(other.AspectRatio),
Groups(other.Groups),
DashValues(other.DashValues),
TabValues(other.TabValues),
DashOffset(other.DashOffset),
fill_gradient(other.fill_gradient),
fillRule(other.fillRule),
Language(other.Language),
LeftLink(other.LeftLink),
RightLink(other.RightLink),
TopLink(other.TopLink),
BottomLink(other.BottomLink),
LeftLinkID(other.LeftLinkID),
RightLinkID(other.RightLinkID),
TopLinkID(other.TopLinkID),
BottomLinkID(other.BottomLinkID),
LeftLine(other.LeftLine),
RightLine(other.RightLine),
TopLine(other.TopLine),
BottomLine(other.BottomLine),
isTableItem(other.isTableItem),
isSingleSel(other.isSingleSel),
BoundingX(other.BoundingX),
BoundingY(other.BoundingY),
BoundingW(other.BoundingW),
BoundingH(other.BoundingH),
ChangedMasterItem(other.ChangedMasterItem),
OnMasterPage(other.OnMasterPage),
startArrowIndex(other.startArrowIndex),
endArrowIndex(other.endArrowIndex),
isEmbedded(other.isEmbedded),
fillQColor(other.fillQColor),
strokeQColor(other.strokeQColor),
undoManager(other.undoManager),
 
// protected
AnName(other.AnName),
fillColorVal(other.fillColorVal),
lineColorVal(other.lineColorVal),
lineShadeVal(other.lineShadeVal),
fillShadeVal(other.fillShadeVal),
fillTransparencyVal(other.fillTransparencyVal),
lineTransparencyVal(other.fillTransparencyVal),
imageIsFlippedH(other.imageIsFlippedH),
imageIsFlippedV(other.imageIsFlippedV),
Locked(other.Locked),
LockRes(other.LockRes),
textFlowsAroundFrameVal(other.textFlowsAroundFrameVal),
textFlowUsesBoundingBoxVal(other.textFlowUsesBoundingBoxVal),
textFlowUsesContourLineVal(other.textFlowUsesContourLineVal),
pageItemAttributes(other.pageItemAttributes),
isPrintable(other.isPrintable),
tagged(other.tagged)
{
}
 
 
PageItem::PageItem(ScribusDoc *pa, ItemType newType, double x, double y, double w, double h, double w2, QString fill, QString outline)
// Initialize superclasses
: QObject(pa),
403,7 → 615,7
}
if (lineColor() != "None")
{
if ((Pwidth == 0) && (itemType() != Line))
if ((Pwidth == 0) && ! asLine())
p->setLineWidth(0);
else
{
2993,7 → 3205,7
pr.setBrush(red);
if ((!Locked) && (!LockRes))
{
if (itemType() != Line)
if (! asLine())
{
pr.drawRect(-1, -1, 6, 6);
pr.drawRect(static_cast<int>(Width*sc), static_cast<int>(Height*sc), -6, -6);
4149,6 → 4361,7
SimpleState *ss = new SimpleState(Um::ConvertTo + " " + toType,
QString(Um::FromTo).arg(fromType).arg(toType));
ss->set("CONVERT", "convert");
ss->set("PAGEITEM", reinterpret_cast<int>(this));
ss->set("OLD_TYPE", itemTypeVal);
ss->set("NEW_TYPE", newType);
undoManager->action(this, ss);
4728,12 → 4941,18
ScApp->view->chTyStyle(effect);
}
 
 
// This must go into class ScribusDoc!
// For now we'll just make it independent of 'this' -- AV
void PageItem::restoreType(SimpleState *state, bool isUndo)
{
// well, probably not the best way to handle pointers...
PageItem * item = state->getInt("PAGEITEM");
int type = state->getInt("OLD_TYPE");
if (!isUndo)
type = state->getInt("NEW_TYPE");
select();
ScApp->view->Deselect(false);
ScApp->view->SelectItem(item, false);
switch (type) {
case ImageFrame: ScApp->view->ToPicFrame(); break;
case TextFrame: ScApp->view->ToTextFrame(); break;
5317,7 → 5536,7
 
bool PageItem::loadImage(const QString& filename, const bool reload, const int gsResolution)
{
if (itemType()!=PageItem::ImageFrame)
if (! asImageFrame())
return false;
QFileInfo fi(filename);
QString clPath(pixm.imgInfo.usedPath);
/branches/Version13x/Scribus/scribus/scribusview.cpp
64,6 → 64,12
#include "units.h"
#include "extimageprops.h"
#include "pageitemattributes.h"
#include "pageitem_imageframe.h"
#include "pageitem_line.h"
#include "pageitem_pathtext.h"
#include "pageitem_polygon.h"
#include "pageitem_polyline.h"
#include "pageitem_textframe.h"
#include "pageselector.h"
#include "scpaths.h"
#include "actionmanager.h"
671,7 → 677,7
if (!((Doc->EditClip) && (Mpressed)))
currItem->DrawObj(painter, clip);
currItem->Redrawn = true;
if ((currItem->itemType() == PageItem::TextFrame) && ((currItem->NextBox != 0) || (currItem->BackBox != 0)))
if ((currItem->asTextFrame()) && ((currItem->NextBox != 0) || (currItem->BackBox != 0)))
{
PageItem *nextItem = currItem;
while (nextItem != 0)
1149,7 → 1155,7
{
bb = pasted.at(dre);
currItem = SelItem.at(dre);
if ((currItem->itemType() == PageItem::TextFrame) && ((currItem->NextBox != 0) || (currItem->BackBox != 0)))
if ((currItem->asTextFrame()) && ((currItem->NextBox != 0) || (currItem->BackBox != 0)))
{
if (currItem->BackBox != 0)
{
2030,7 → 2036,7
}
else
npx = ApplyGridF(FPoint(nx, ny, currItem->Xpos, currItem->Ypos, currItem->Rot, 1, 1, true));
if ((HowTo == 1) && (currItem->itemType() != PageItem::Line) && (Doc->SnapGuides))
if ((HowTo == 1) && !(currItem->asLine()) && (Doc->SnapGuides))
SizeItem(npx.x(), npx.y(), currItem->ItemNr);
bool sav = Doc->SnapGuides;
Doc->SnapGuides = false;
2037,7 → 2043,7
switch (HowTo)
{
case 1:
if (currItem->itemType() != PageItem::Line)
if (!currItem->asLine())
{
if (currItem->isTableItem)
{
2135,7 → 2141,7
currItem->Sizing = false;
break;
case 2:
if (currItem->itemType() != PageItem::Line)
if (!currItem->asLine())
{
if (currItem->isTableItem)
{
2570,7 → 2576,7
else
{
currItem = SelItem.at(0);
if (currItem->itemType() != PageItem::Line)
if (!currItem->asLine())
{
if (fabs(currItem->Width) < 5)
currItem->Width = 5;
2686,7 → 2692,7
{
currItem = SelItem.at(0);
uint a;
if (currItem->itemType() == PageItem::TextFrame)
if (currItem->asTextFrame())
{
if (oldCp == currItem->CPos)
{
3125,13 → 3131,13
}
if (Mpressed && (Doc->appMode == modeEdit) && (!HanMove))
{
if (currItem->itemType() == PageItem::ImageFrame)
if (currItem->asImageFrame())
{
MoveItemI((newX-Mxp)/currItem->LocalScX, (newY-Myp)/currItem->LocalScY, currItem->ItemNr);
Mxp = newX;
Myp = newY;
}
if (currItem->itemType() == PageItem::TextFrame)
if (currItem->asTextFrame())
{
for (a = 0; a < currItem->itemText.count(); ++a)
currItem->itemText.at(a)->cselect = false;
3248,7 → 3254,7
MoveClipPoint(currItem, npf);
else
{
if (currItem->itemType() == PageItem::PolyLine)
if (currItem->asPolyLine())
MoveClipPoint(currItem, npf);
}
}
3360,7 → 3366,7
nx = np.x();
ny = np.y();
p.end();
if (currItem->itemType() != PageItem::Line)
if (!currItem->asLine())
{
if ((Doc->useRaster) && (OnPage(currItem) != -1))
{
3406,7 → 3412,7
}
break;
case 2:
if (currItem->itemType() == PageItem::Line)
if (currItem->asLine())
{
double sav = Doc->SnapGuides;
npf2 = FPoint(newX-Mxp, newY-Myp);
3495,7 → 3501,7
if (!GroupSel)
{
currItem = SelItem.at(0);
if ((currItem->itemType() == PageItem::ImageFrame) && (m->state() & (ControlButton | AltButton)))
if ((currItem->asImageFrame()) && (m->state() & (ControlButton | AltButton)))
MoveItemI((newX-Mxp)/currItem->LocalScX, (newY-Myp)/currItem->LocalScY, currItem->ItemNr);
else
{
3725,9 → 3731,9
qApp->setOverrideCursor(QCursor(loadIcon("Rotieren2.xpm")), true);
if (Doc->appMode == modeEdit)
{
if (currItem->itemType() == PageItem::TextFrame)
if (currItem->asTextFrame())
qApp->setOverrideCursor(QCursor(ibeamCursor), true);
if (currItem->itemType() == PageItem::ImageFrame)
if (currItem->asImageFrame())
qApp->setOverrideCursor(QCursor(loadIcon("HandC.xpm")), true);
}
if (!currItem->sizeLocked())
3947,7 → 3953,7
return;
if (ClRe != -1)
{
if (currItem->itemType() == PageItem::Polygon)
if (currItem->asPolygon())
{
if ((ClRe != 0) && (ClRe != static_cast<int>(EndInd-2)))
{
4010,7 → 4016,7
}
else
{
if ((currItem->itemType() == PageItem::PolyLine) || (currItem->itemType() == PageItem::PathText))
if ((currItem->asPolyLine()) || (currItem->asPathText()))
{
if ((ClRe > 1) && (ClRe < static_cast<int>(Clip.size()-2)))
{
4042,7 → 4048,7
{
if (!EdPoints)
return;
if ((currItem->itemType() == PageItem::Polygon) || (currItem->itemType() == PageItem::TextFrame) || (currItem->itemType() == PageItem::ImageFrame))
if ((currItem->asPolygon()) || (currItem->asTextFrame()) || (currItem->asImageFrame()))
{
if ((currItem->Segments.count() == 0) && (Clip.size() < 13))
return;
4062,7 → 4068,7
{
if (ClRe == static_cast<int>(StartInd))
{
if ((currItem->itemType() == PageItem::Polygon) || (currItem->itemType() == PageItem::TextFrame) || (currItem->itemType() == PageItem::ImageFrame))
if ((currItem->asPolygon()) || (currItem->asTextFrame()) || (currItem->asImageFrame()))
{
FPoint kp = Clip.point(EndInd-3);
cli.putPoints(0, StartInd, Clip);
4110,7 → 4116,7
if (edited)
{
currItem->FrameType = 3;
if (currItem->itemType() != PageItem::PolyLine)
if (!currItem->asPolyLine())
currItem->Clip = FlattenPath(currItem->PoLine, currItem->Segments);
AdjustItemSize(currItem);
updateContents();
4220,7 → 4226,7
HandleSizer(&p, currItem, mpo, m);
if (HowTo != 0)
{
if (currItem->itemType() != PageItem::Line)
if (!currItem->asLine())
currItem->Sizing = true;
mCG = true;
}
4334,13 → 4340,13
currItem = SelItem.at(0);
oldCp = currItem->CPos;
slotDoCurs(true);
if ((!inText) && ((currItem->itemType() == PageItem::TextFrame) || (currItem->itemType() == PageItem::ImageFrame)))
if ((!inText) && ((currItem->asTextFrame()) || (currItem->asImageFrame())))
{
Deselect(true);
if (SeleItem(m))
{
currItem = SelItem.at(0);
if ((currItem->itemType() == PageItem::TextFrame) || (currItem->itemType() == PageItem::ImageFrame))
if ((currItem->asTextFrame()) || (currItem->asImageFrame()))
emit Amode(modeEdit);
else
{
4356,7 → 4362,7
}
else
{
if ((m->button() == MidButton) && (currItem->itemType() == PageItem::TextFrame))
if ((m->button() == MidButton) && (currItem->asTextFrame()))
{
Mpressed = false;
MidButt = false;
4797,7 → 4803,7
currItem->Ypos = page->YGuides[yg]+page->yOffset();
break;
}
if (currItem->itemType() == PageItem::Line)
if (currItem->asLine())
{
QWMatrix ma;
ma.translate(currItem->Xpos, currItem->Ypos);
4829,7 → 4835,7
currItem->Xpos = page->XGuides[xg]+page->xOffset();
break;
}
if (currItem->itemType() == PageItem::Line)
if (currItem->asLine())
{
QWMatrix ma;
ma.translate(currItem->Xpos, currItem->Ypos);
4900,7 → 4906,7
currItem->getBoundingRect(&currItem->BoundingX, &currItem->BoundingY, &bw, &bh);
currItem->BoundingW = bw - currItem->BoundingX;
currItem->BoundingH = bh - currItem->BoundingY;
if (currItem->itemType() == PageItem::Line)
if (currItem->asLine())
currItem->BoundingH = QMAX(currItem->BoundingH, 1);
adjustCanvas(FPoint(currItem->BoundingX, currItem->BoundingY), FPoint(bw, bh));
}
5128,7 → 5134,7
-ph,static_cast<int>(currItem->Height+ph));
break;
default:
if (((!currItem->ClipEdited) || (currItem->FrameType < 3)) && (currItem->itemType() != PageItem::PathText))
if (((!currItem->ClipEdited) || (currItem->FrameType < 3)) && !(currItem->asPathText()))
{
switch (currItem->FrameType)
{
5167,7 → 5173,7
{
currItem->PoLine.map(ma);
currItem->ContourLine.map(ma);
if (currItem->itemType() == PageItem::PathText)
if (currItem->asPathText())
UpdatePolyClip(currItem);
else
currItem->Clip = FlattenPath(currItem->PoLine, currItem->Segments);
5217,7 → 5223,7
currItem->GrEndY = gr.point(1).y();
currItem->PoLine.map(ma);
currItem->ContourLine.map(ma);
if (currItem->itemType() == PageItem::PathText)
if (currItem->asPathText())
UpdatePolyClip(currItem);
else
currItem->Clip = FlattenPath(currItem->PoLine, currItem->Segments);
5486,7 → 5492,7
ma.scale(-1, 1);
currItem->PoLine.map(ma);
currItem->PoLine.translate(currItem->Width, 0);
if (currItem->itemType() == PageItem::PathText)
if (currItem->asPathText())
UpdatePolyClip(currItem);
else
currItem->Clip = FlattenPath(currItem->PoLine, currItem->Segments);
5533,7 → 5539,7
ma.scale(1, -1);
currItem->PoLine.map(ma);
currItem->PoLine.translate(0, currItem->Height);
if (currItem->itemType() == PageItem::PathText)
if (currItem->asPathText())
UpdatePolyClip(currItem);
else
currItem->Clip = FlattenPath(currItem->PoLine, currItem->Segments);
5678,7 → 5684,7
double x = ma2.m11() * n.x() + ma2.m21() * n.y() + ma2.dx();
double y = ma2.m22() * n.y() + ma2.m12() * n.x() + ma2.dy();
MoveItem(x-oldPos.x(), y-oldPos.y(), currItem);
if (currItem->itemType() == PageItem::PathText)
if (currItem->asPathText())
UpdatePolyClip(currItem);
setRedrawBounding(currItem);
RefreshItem(currItem);
5876,7 → 5882,7
Clip.setPoint(ClRe-2, np);
}
if (((ClRe == static_cast<int>(StartInd)) || (ClRe == static_cast<int>(EndInd-2))) &&
((currItem->itemType() == PageItem::Polygon) || (currItem->itemType() == PageItem::TextFrame) || (currItem->itemType() == PageItem::ImageFrame)))
((currItem->asPolygon()) || (currItem->asTextFrame()) || (currItem->asImageFrame())))
{
if (ClRe == static_cast<int>(StartInd))
{
5898,7 → 5904,7
}
}
if (((ClRe == static_cast<int>(StartInd+1)) || (ClRe == static_cast<int>(EndInd-1))) &&
((currItem->itemType() == PageItem::Polygon) || (currItem->itemType() == PageItem::TextFrame) || (currItem->itemType() == PageItem::ImageFrame)) && (MoveSym))
((currItem->asPolygon()) || (currItem->asTextFrame()) || (currItem->asImageFrame())) && (MoveSym))
{
uint kon = 0;
if (ClRe == static_cast<int>(StartInd+1))
5955,7 → 5961,7
return false;
QPainter p;
QRect oldR = getRedrawBounding(currItem);
if (currItem->itemType() != PageItem::Line)
if (!currItem->asLine())
{
newX = QMAX(newX, 1);
newY = QMAX(newY, 1);
5986,9 → 5992,9
}
}
currItem->RadRect = QMIN(currItem->RadRect, QMIN(currItem->Width,currItem->Height)/2);
if ((currItem->itemType() == PageItem::ImageFrame) && (!currItem->Sizing) && (!Doc->EditClip))
if ((currItem->asImageFrame()) && (!currItem->Sizing) && (!Doc->EditClip))
AdjustPictScale(currItem);
if (currItem->itemType() == PageItem::Line)
if (currItem->asLine())
{
if (!fromMP)
{
6009,9 → 6015,9
emit ItemRadius(currItem->RadRect);
currItem->FrameOnly = true;
currItem->Tinput = true;
if ((HowTo == 1) && (currItem->itemType() != PageItem::Line))
if ((HowTo == 1) && !(currItem->asLine()))
currItem->paintObj();
if ((currItem->FrameType == 0) || (currItem->itemType() == PageItem::Line) || (HowTo != 1))
if ((currItem->FrameType == 0) || (currItem->asLine()) || (HowTo != 1))
return true;
QPainter p;
p.begin(viewport());
6084,7 → 6090,7
{
PageItem *currItem = Doc->Items.at(ite);
QRect oldR = getRedrawBounding(currItem);
if (currItem->itemType() == PageItem::Line)
if (currItem->asLine())
{
QWMatrix ma;
ma.translate(currItem->Xpos, currItem->Ypos);
6162,7 → 6168,7
p.setRasterOp(XorROP);
p.setBrush(NoBrush);
p.setPen(QPen(white, 1, DotLine, FlatCap, MiterJoin));
if ((currItem->itemType() != PageItem::Line) && (currItem->FrameType != 0) || (currItem->itemType() == PageItem::PolyLine))
if (!(currItem->asLine()) && (currItem->FrameType != 0) || (currItem->asPolyLine()))
currItem->DrawPolyL(&p, currItem->Clip);
else
p.drawRect(0, 0, static_cast<int>(currItem->Width)+1, static_cast<int>(currItem->Height)+1);
6179,7 → 6185,7
p.setRasterOp(XorROP);
p.setBrush(NoBrush);
p.setPen(QPen(white, 1, DotLine, FlatCap, MiterJoin));
if ((currItem->itemType() != PageItem::Line) && (currItem->FrameType != 0) || (currItem->itemType() == PageItem::PolyLine))
if (!(currItem->asLine()) && (currItem->FrameType != 0) || (currItem->asPolyLine()))
currItem->DrawPolyL(&p, currItem->Clip);
else
p.drawRect(0, 0, static_cast<int>(currItem->Width)+1, static_cast<int>(currItem->Height)+1);
6334,7 → 6340,7
bb->LineSp = ((bb->ISize / 10.0) * static_cast<double>(Doc->typographicSettings.autoLineSpacing) / 100) + (bb->ISize / 10.0);
for (aa = 0; aa < bb->itemText.count(); ++aa)
bb->itemText.at(aa)->csize = QMAX(qRound(bb->itemText.at(aa)->csize*((scx+scy)/2)), 1);
if (bb->itemType() == PageItem::PathText)
if (bb->asPathText())
UpdatePolyClip(bb);
}
bb->LocalX = oldLocalX;
6414,7 → 6420,7
return;
FPoint n;
QRect oldR = getRedrawBounding(currItem);
if ((Doc->RotMode != 0) && (currItem->itemType() != PageItem::Line))
if ((Doc->RotMode != 0) && !(currItem->asLine()))
{
QWMatrix ma;
ma.translate(currItem->Xpos, currItem->Ypos);
6487,7 → 6493,7
SizeItem(tp.x(), tp.y(), currItem->ItemNr, true, false);
currItem->ClipEdited = true;
currItem->PoLine = Clip.copy();
if (currItem->itemType() == PageItem::PolyLine)
if (currItem->asPolyLine())
SetPolyClip(currItem, qRound(QMAX(currItem->Pwidth / 2, 1)));
else
currItem->Clip = FlattenPath(currItem->PoLine, currItem->Segments);
6696,7 → 6702,7
PageItem *currItem;
if (GetItem(&currItem))
{
if (!((currItem->itemType() == PageItem::TextFrame) || (currItem->itemType() == PageItem::ImageFrame)))
if (!((currItem->asTextFrame()) || (currItem->asImageFrame())))
return false;
QRect mpo;
int xP, yP;
6711,7 → 6717,7
if ((QRegion(p.xForm(QPointArray(QRect(0, 0, static_cast<int>(currItem->Width), static_cast<int>(currItem->Height))))).contains(mpo)) ||
(QRegion(p.xForm(currItem->Clip)).contains(mpo)))
{
if (currItem->itemType() == PageItem::ImageFrame)
if (currItem->asImageFrame())
return true;
uint a, i;
int xp, yp, w, h, chs;
6903,7 → 6909,7
PageItem *currItem;
if (GetItem(&currItem))
{
if (currItem->itemType() != PageItem::TextFrame)
if (!currItem->asTextFrame())
return;
QPainter p;
QString chx;
7489,7 → 7495,7
else
{
EmitValues(currItem);
if (currItem->itemType() == PageItem::Line)
if (currItem->asLine())
emit ItemGeom(currItem->Width, currItem->Height);
emit HaveSel(currItem->itemType());
}
7629,7 → 7635,7
{
EmitValues(currItem);
currItem->paintObj();
if (currItem->itemType() == PageItem::Line)
if (currItem->asLine())
emit ItemGeom(currItem->Width, currItem->Height);
emit HaveSel(currItem->itemType());
}
7723,7 → 7729,7
d1 = sqrt(pow(n1.x() * Scale - m->x(),2)+pow(n1.y() * Scale - m->y(),2));
if (d1 < Doc->guidesSettings.grabRad)
distance.insert(d1, 2);
if (currItem->itemType() != PageItem::Line)
if (!currItem->asLine())
{
QPoint docMinCanvasCoordinate(qRound(Doc->minCanvasCoordinate.x()), qRound(Doc->minCanvasCoordinate.y()));
n1 = FPoint(currItem->Width, 0, currItem->Xpos, currItem->Ypos, currItem->Rot, 1, 1);
7764,7 → 7770,7
HandleCurs(p, currItem, mpo);
if (HowTo != 0)
{
if (currItem->itemType() != PageItem::Line)
if (!currItem->asLine())
currItem->Sizing = true;
mCG = true;
}
7795,7 → 7801,7
for (uint a = 0; a < SelItem.count(); ++a)
{
currItem = SelItem.at(a);
if ((currItem->itemType() == PageItem::TextFrame) && (currItem->isBookmark))
if ((currItem->asTextFrame()) && (currItem->isBookmark))
emit ChBMText(currItem);
currItem->Select = false;
currItem->isSingleSel = false;
7889,7 → 7895,7
Imoved = true;
Doc->appMode = modeNormal;
emit DocChanged();
currItem->Sizing = currItem->itemType() == PageItem::Line ? false : true;
currItem->Sizing = currItem->asLine() ? false : true;
EmitValues(currItem);
}
 
7924,7 → 7930,7
for (uint a = 0; a < SelItem.count(); ++a)
{
PageItem* currItem = SelItem.at(a);
if (currItem->itemType()==PageItem::TextFrame)
if (currItem->asTextFrame())
{
if (currItem->OwnPage != -1)
{
7955,7 → 7961,7
for (uint a = 0; a < SelItem.count(); ++a)
{
PageItem* currItem = SelItem.at(a);
if (currItem->itemType()==PageItem::TextFrame)
if (currItem->asTextFrame())
{
bool old = currItem->isBookmark;
currItem->isAnnotation = !currItem->isAnnotation;
8221,7 → 8227,7
void ScribusView::ToPicFrame()
{
//emit Amode(1);
PageItem *currItem = SelItem.at(0);
PageItem *currItem = new PageItem_ImageFrame(*SelItem.at(0));
currItem->convertTo(PageItem::ImageFrame);
currItem->Frame = true;
RefreshItem(currItem);
8234,7 → 8240,7
 
void ScribusView::ToPolyFrame()
{
PageItem *currItem = SelItem.at(0);
PageItem *currItem = new PageItem_Polygon(*SelItem.at(0));
currItem->convertTo(PageItem::Polygon);
currItem->Frame = false;
currItem->ClipEdited = true;
8251,7 → 8257,7
 
void ScribusView::ToTextFrame()
{
PageItem *currItem = SelItem.at(0);
PageItem *currItem = new PageItem_TextFrame(*SelItem.at(0));
currItem->convertTo(PageItem::TextFrame);
currItem->Frame = true;
RefreshItem(currItem);
8264,7 → 8270,7
 
void ScribusView::ToBezierFrame()
{
PageItem *currItem = SelItem.at(0);
PageItem *currItem = new PageItem_PolyLine(*SelItem.at(0));
currItem->convertTo(PageItem::PolyLine);
currItem->ClipEdited = true;
SetPolyClip(currItem, qRound(QMAX(currItem->Pwidth / 2, 1)));
8306,9 → 8312,9
for (uint i = 0; i < SelItem.count(); ++i)
{
currItem = SelItem.at(i);
if ((currItem->itemType() == PageItem::ImageFrame) || (currItem->itemType() == PageItem::TextFrame))
if ((currItem->asImageFrame()) || (currItem->asTextFrame()))
{
if (currItem->itemType() == PageItem::TextFrame)
if (currItem->asTextFrame())
{
if ((currItem->itemText.count() != 0) && ((currItem->NextBox == 0) || (currItem->BackBox == 0)))
{
8341,12 → 8347,12
nextItem = nextItem->NextBox;
}
}
if ((currItem->itemType() == PageItem::ImageFrame) && ((ScApp->fileWatcher->files().contains(currItem->Pfile) != 0) && (currItem->PicAvail)))
if ((currItem->asImageFrame()) && ((ScApp->fileWatcher->files().contains(currItem->Pfile) != 0) && (currItem->PicAvail)))
ScApp->fileWatcher->removeFile(currItem->Pfile);
currItem->Pfile = "";
currItem->PicAvail = false;
currItem->pixm = ScImage();
if (currItem->itemType() == PageItem::ImageFrame)
if (currItem->asImageFrame())
{
currItem->LocalScX = 1;
currItem->LocalScY = 1;
8394,7 → 8400,7
offs++;
continue;
}
if ((currItem->itemType()==PageItem::TextFrame || currItem->itemType()==PageItem::PathText) && currItem==ScApp->storyEditor->currentItem() && Doc==ScApp->storyEditor->currentDocument())
if ((currItem->asTextFrame() || currItem->asPathText()) && currItem==ScApp->storyEditor->currentItem() && Doc==ScApp->storyEditor->currentDocument())
{
QMessageBox::critical(ScApp, tr("Cannot Delete In-Use Item"), tr("The item %1 is currently being edited by Story Editor. The delete operation will be cancelled").arg(currItem->itemName()), QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton);
return;
8414,9 → 8420,9
{
//currItem = delItems.at(0);
currItem = delItems.last();
if ((currItem->itemType() == PageItem::ImageFrame) && ((ScApp->fileWatcher->files().contains(currItem->Pfile) != 0) && (currItem->PicAvail)))
if ((currItem->asImageFrame()) && ((ScApp->fileWatcher->files().contains(currItem->Pfile) != 0) && (currItem->PicAvail)))
ScApp->fileWatcher->removeFile(currItem->Pfile);
if (currItem->itemType() == PageItem::TextFrame)
if (currItem->asTextFrame())
{
for (ScText *it = currItem->itemText.first(); it != 0; it = currItem->itemText.next())
{
9428,9 → 9434,9
PageItem *currItem = SelItem.at(a);
currItem->OldPwidth = currItem->Pwidth;
currItem->setLineWidth(w);
if (currItem->itemType() == PageItem::PolyLine)
if (currItem->asPolyLine())
SetPolyClip(currItem, qRound(QMAX(currItem->Pwidth / 2, 1)));
if (currItem->itemType() == PageItem::Line)
if (currItem->asLine())
{
int ph = static_cast<int>(QMAX(1.0, w / 2.0));
currItem->Clip.setPoints(4, -ph,-ph, static_cast<int>(currItem->Width+ph),-ph,
9582,7 → 9588,7
{
for (uint a = 0; a < currItem->itemText.count(); ++a)
currItem->itemText.at(a)->cfont = (*Doc->AllFonts)[fon];
if (currItem->itemType() == PageItem::PathText)
if (currItem->asPathText())
{
UpdatePolyClip(currItem);
AdjustItemSize(currItem);
9624,7 → 9630,7
for (uint a = 0; a < selectedItemCount; ++a)
{
i = SelItem.at(a);
if ((i->itemType() == PageItem::Line) && (farbe == "None"))
if ((i->asLine()) && (farbe == "None"))
continue;
i->setLineColor(farbe);
if (i->lineColor() != "None")
9651,7 → 9657,7
for (uint a = 0; a < selectedItemCount; ++a)
{
currItem = SelItem.at(a);
if ((currItem->itemType() == PageItem::TextFrame) || (currItem->itemType() == PageItem::PathText))
if ((currItem->asTextFrame()) || (currItem->asPathText()))
{
if (Doc->appMode != modeEdit)
currItem->setFontFillColor(farbe);
9686,7 → 9692,7
for (uint a = 0; a < selectedItemCount; ++a)
{
currItem = SelItem.at(a);
if (currItem->itemType() == PageItem::TextFrame)
if (currItem->asTextFrame())
{
if (Doc->appMode != modeEdit)
currItem->setFontFillShade(sha);
9723,7 → 9729,7
for (uint a = 0; a < selectedItemCount; ++a)
{
currItem = SelItem.at(a);
if ((currItem->itemType() == PageItem::TextFrame) || (currItem->itemType() == PageItem::PathText))
if ((currItem->asTextFrame()) || (currItem->asPathText()))
{
if (Doc->appMode != modeEdit)
currItem->setFontStrokeColor(farbe);
9757,7 → 9763,7
for (uint a = 0; a < selectedItemCount; ++a)
{
currItem = SelItem.at(a);
if (currItem->itemType() == PageItem::TextFrame)
if (currItem->asTextFrame())
{
if (Doc->appMode != modeEdit)
currItem->setFontStrokeShade(sha);
9790,7 → 9796,7
for (uint a = 0; a < selectedItemCount; ++a)
{
currItem = SelItem.at(a);
if ((currItem->itemType() == PageItem::TextFrame) || (currItem->itemType() == PageItem::PathText))
if ((currItem->asTextFrame()) || (currItem->asPathText()))
{
if (Doc->appMode != modeEdit)
currItem->setFontHeight(sha);
9824,7 → 9830,7
for (uint a = 0; a < selectedItemCount; ++a)
{
currItem = SelItem.at(a);
if ((currItem->itemType() == PageItem::TextFrame) || (currItem->itemType() == PageItem::PathText))
if ((currItem->asTextFrame()) || (currItem->asPathText()))
{
if (Doc->appMode != modeEdit)
currItem->setFontWidth(sha);
9855,7 → 9861,7
for (uint a = 0; a < selectedItemCount; ++a)
{
currItem = SelItem.at(a);
if ((currItem->itemType() == PageItem::TextFrame) || (currItem->itemType() == PageItem::PathText))
if ((currItem->asTextFrame()) || (currItem->asPathText()))
{
if (Doc->appMode != modeEdit)
{
9893,7 → 9899,7
for (uint a = 0; a < selectedItemCount; ++a)
{
currItem = SelItem.at(a);
if ((currItem->itemType() == PageItem::TextFrame) || (currItem->itemType() == PageItem::PathText))
if ((currItem->asTextFrame()) || (currItem->asPathText()))
{
if (Doc->appMode != modeEdit)
{
9931,7 → 9937,7
for (uint a = 0; a < selectedItemCount; ++a)
{
currItem = SelItem.at(a);
if ((currItem->itemType() == PageItem::TextFrame) || (currItem->itemType() == PageItem::PathText))
if ((currItem->asTextFrame()) || (currItem->asPathText()))
{
if (Doc->appMode != modeEdit)
{
9969,7 → 9975,7
for (uint a = 0; a < selectedItemCount; ++a)
{
currItem = SelItem.at(a);
if ((currItem->itemType() == PageItem::TextFrame) || (currItem->itemType() == PageItem::PathText))
if ((currItem->asTextFrame()) || (currItem->asPathText()))
{
if (Doc->appMode != modeEdit)
currItem->TxtBase = sha;
9998,7 → 10004,7
for (uint a = 0; a < selectedItemCount; ++a)
{
currItem = SelItem.at(a);
if ((currItem->itemType() == PageItem::TextFrame) || (currItem->itemType() == PageItem::PathText))
if ((currItem->asTextFrame()) || (currItem->asPathText()))
{
if (Doc->appMode != modeEdit)
currItem->TxtOutline = sha;
10531,7 → 10537,7
currItem->itemText.at(a)->csize = size;
}
}
if (currItem->itemType() == PageItem::PathText)
if (currItem->asPathText())
{
UpdatePolyClip(currItem);
AdjustItemSize(currItem);
10628,7 → 10634,7
{
pageItem = SelItem.at(i);
if (pageItem!=NULL)
if (pageItem->itemType() == PageItem::ImageFrame)
if (pageItem->asImageFrame())
{
pageItem->pixm.imgInfo.lowResType = id;
if (!found)
10828,7 → 10834,7
for (uint i = 0; i < selectedItemCount; ++i)
{
if (SelItem.at(i)!=NULL)
if (SelItem.at(i)->itemType() == PageItem::ImageFrame)
if (SelItem.at(i)->asImageFrame())
{
PageItem *currItem = SelItem.at(0);
if (currItem->PicAvail)
10856,7 → 10862,7
for (uint i = 0; i < SelItem.count(); ++i)
{
if (SelItem.at(i)!=NULL)
if (SelItem.at(i)->itemType() == PageItem::ImageFrame)
if (SelItem.at(i)->asImageFrame())
{
PageItem *currItem = SelItem.at(i);
if (currItem->PicAvail)
11185,7 → 11191,7
currItem->ContourLine = currItem->PoLine.copy();
else
currItem->ContourLine = Buffer->ContourLine.copy();
if (currItem->itemType() != PageItem::Line)
if (!currItem->asLine())
{
// OBSOLETE CR 2005-02-06
if ((currItem->PoLine.size() == 0) && (currItem->itemType() != PageItem::ItemType1))
11227,9 → 11233,9
}
currItem->ClipEdited = true;
}
if (currItem->itemType() == PageItem::ImageFrame)
if (currItem->asImageFrame())
AdjustPictScale(currItem);
if ((currItem->itemType() != PageItem::TextFrame) && (currItem->itemType() != PageItem::PathText))
if ((currItem->asTextFrame()) && !(currItem->asPathText()))
currItem->IFont = Doc->toolSettings.defFont;
if (Buffer->GrType != 0)
{
11346,9 → 11352,9
{
if (SelItem.count() > 1)
{
PageItem *currItem = SelItem.at(0);
PageItem *currItem = new PageItem_PathText(*SelItem.at(0));
PageItem *bb;
if (currItem->itemType() == PageItem::TextFrame)
if (currItem->asTextFrame())
bb = SelItem.at(1);
else
{
11355,7 → 11361,7
bb = SelItem.at(0);
currItem = SelItem.at(1);
}
if (bb->itemType() != PageItem::PolyLine)
if (!bb->asPolyLine())
return;
currItem->Frame = false;
currItem->ClipEdited = true;
11419,7 → 11425,7
{
PageItem *currItem = SelItem.at(offset);
bool cont=false;
if ((!((currItem->itemType()==PageItem::TextFrame) || (currItem->itemType()==PageItem::PathText))) || (currItem->isTableItem && currItem->isSingleSel) || (currItem->locked()) || currItem->itemText.count() == 0)
if ((!((currItem->asTextFrame()) || (currItem->asPathText()))) || (currItem->isTableItem && currItem->isSingleSel) || (currItem->locked()) || currItem->itemText.count() == 0)
cont=true;
if (currItem==ScApp->storyEditor->currentItem() && Doc==ScApp->storyEditor->currentDocument())
{
11465,7 → 11471,7
double csi = static_cast<double>(chs) / 100.0;
uint chr = chx[0].unicode();
QWMatrix chma, chma2, chma3, chma4, chma6;
if (currItem->itemType()==PageItem::PathText)
if (currItem->asPathText())
{
QWMatrix trafo = QWMatrix( 1, 0, 0, -1, -hl->PRot, 0 );
trafo *= QWMatrix( hl->PtransX, hl->PtransY, hl->PtransY, -hl->PtransX, hl->xp, hl->yp);
11533,7 → 11539,7
bb->setItemName(currItem->itemName()+"+"+ccounter.setNum(a));
bb->AutoName = false;
bb->PoLine = pts.copy();
if (currItem->itemType()!=PageItem::PathText)
if (!currItem->asPathText())
bb->Rot = currItem->Rot;
bb->setFillColor(hl->ccolor);
bb->setFillShade(hl->cshade);
11552,7 → 11558,7
if (bb->lineColor() != "None")
bb->strokeQColor = Doc->PageColors[bb->lineColor()].getShadeColorProof(bb->lineShade());
bb->Pwidth = chs * hl->coutline / 10000.0;
if (currItem->itemType()==PageItem::PathText)
if (currItem->asPathText())
AdjustItemSize(bb);
else
{
11581,7 → 11587,7
setRedrawBounding(bb);
newGroupedItems.append(bb);
}
if ((currItem->itemType()==PageItem::PathText) && (currItem->PoShow))
if ((currItem->asPathText()) && (currItem->PoShow))
{
uint z = Doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, currItem->Xpos, currItem->Ypos, currItem->Width, currItem->Height, currItem->Pwidth, "None", currItem->lineColor(), !Mpressed);
PageItem *bb = Doc->Items.at(z);
/branches/Version13x/Scribus/scribus/actionmanager.cpp
755,7 → 755,7
disconnect( (*scrActions)["itemPDFIsBookmark"], 0, 0, 0);
disconnect( (*scrActions)["itemPDFIsAnnotation"], 0, 0, 0);
 
if (currItem->itemType()!=PageItem::TextFrame)
if (!currItem->asTextFrame())
{
(*scrActions)["itemPDFIsAnnotation"]->setEnabled(false);
(*scrActions)["itemPDFIsBookmark"]->setEnabled(false);
/branches/Version13x/Scribus/scribus/scribus.cpp
1533,7 → 1533,7
case modeEdit:
int oldPos = currItem->CPos; // 15-mar-2004 jjsa for cursor movement with Shift + Arrow key
view->oldCp = currItem->CPos;
if (currItem->itemType() == PageItem::ImageFrame)
if (currItem->asImageFrame())
{
switch (kk)
{
2922,7 → 2922,7
scrActions["itemPreviewNormal"]->setOn(false);
scrActions["itemPreviewFull"]->setOn(false);
}
if ((Nr==-1) || (Nr!=-1 && currItem->itemType()!=PageItem::TextFrame))
if ((Nr==-1) || (Nr!=-1 && !currItem->asTextFrame()))
actionManager->enableUnicodeActions(false);
scrActions["insertSampleText"]->setEnabled(false);
 
3051,7 → 3051,7
setTBvals(currItem);
scrActions["editSelectAll"]->setEnabled(true);
scrActions["insertGlyph"]->setEnabled(true);
if (currItem->itemType()==PageItem::TextFrame)
if (currItem->asTextFrame())
actionManager->enableUnicodeActions(true);
view->horizRuler->setItemPosition(currItem->Xpos, currItem->Width);
if (currItem->lineColor() != "None")
3233,7 → 3233,7
firstElem = currItem->Groups.top();
for (uint bx=0; bx<view->SelItem.count(); ++bx)
{
if (view->SelItem.at(bx)->itemType() != PageItem::Polygon)
if (!view->SelItem.at(bx)->asPolygon())
hPoly = false;
if (view->SelItem.at(bx)->Groups.count() != 0)
{
3274,7 → 3274,7
else
{
scrActions["itemUngroup"]->setEnabled(false);
scrActions["itemSplitPolygons"]->setEnabled( (currItem->itemType() == PageItem::Polygon) && (currItem->Segments.count() != 0) );
scrActions["itemSplitPolygons"]->setEnabled( (currItem->asPolygon()) && (currItem->Segments.count() != 0) );
}
if (currItem->locked())
{
3654,7 → 3654,7
for (uint i = oldItemsCount; i < docItemsCount; ++i)
{
PageItem *ite = doc->Items.at(i);
if ((ite->itemType() == PageItem::TextFrame) && (ite->isBookmark))
if ((ite->asTextFrame()) && (ite->isBookmark))
bookmarkPalette->BView->AddPageItem(ite);
}
propertiesPalette->updateColorList();
3994,9 → 3994,9
// TODO fix that for Groups on Masterpages
// if (ite->Groups.count() != 0)
// view->GroupOnPage(ite);
if ((ite->itemType() == PageItem::TextFrame) || (ite->itemType() == PageItem::PathText))
if ((ite->asTextFrame()) || (ite->asPathText()))
{
if (ite->itemType() == PageItem::PathText)
if (ite->asPathText())
{
ite->Frame = false;
view->UpdatePolyClip(ite);
4205,7 → 4205,7
//slotDocCh(); view->LoadPict does this now.
}
}
if (currItem->itemType() == PageItem::TextFrame)
if (currItem->asTextFrame())
{
gtGetText* gt = new gtGetText();
gt->run(false);
4769,7 → 4769,7
for (uint i = 0; i < view->SelItem.count(); ++i)
{
currItem=view->SelItem.at(i);
if ((currItem->itemType()==PageItem::TextFrame || currItem->itemType()==PageItem::PathText) && currItem==ScApp->storyEditor->currentItem() && doc==ScApp->storyEditor->currentDocument())
if ((currItem->asTextFrame() || currItem->asPathText()) && currItem==ScApp->storyEditor->currentItem() && doc==ScApp->storyEditor->currentDocument())
{
QMessageBox::critical(ScApp, tr("Cannot Cut In-Use Item"), tr("The item %1 is currently being edited by Story Editor. The cut operation will be cancelled").arg(currItem->itemName()), QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton);
return;
5646,7 → 5646,7
doc->guidesSettings.showPic = !doc->guidesSettings.showPic;
for (uint b=0; b<doc->Items.count(); ++b)
{
if (doc->Items.at(b)->itemType() == PageItem::ImageFrame)
if (doc->Items.at(b)->asImageFrame())
doc->Items.at(b)->PicArt = doc->guidesSettings.showPic;
}
view->DrawNew();
5953,7 → 5953,7
}
scrActions["editPaste"]->setEnabled(false);
scrActions["insertGlyph"]->setEnabled(true);
if (currItem!=NULL && currItem->itemType()==PageItem::TextFrame)
if (currItem!=NULL && currItem->asTextFrame())
actionManager->enableUnicodeActions(true);
if (!Buffer2.isNull())
{
6655,7 → 6655,7
if (view->SelItem.count() != 0)
{
currItem = view->SelItem.at(0);
if ((currItem->itemType() == PageItem::TextFrame) || (currItem->itemType() == PageItem::PathText))
if ((currItem->asTextFrame()) || (currItem->asPathText()))
{
if ((doc->appMode == modeEdit) && (currItem->itemText.count() != 0))
{
6889,7 → 6889,7
ite = doc->FrameItems.at(d);
break;
}
if (ite->itemType() == PageItem::TextFrame)
if (ite->asTextFrame())
{
for (uint e=0; e<ite->itemText.count(); ++e)
{
7146,7 → 7146,7
for (c=0; c<doc->DocItems.count(); ++c)
{
ite = doc->DocItems.at(c);
if ((ite->itemType() == PageItem::TextFrame) || (ite->itemType() == PageItem::PathText))
if ((ite->asTextFrame()) || (ite->asPathText()))
{
for (d=0; d<ite->itemText.count(); ++d)
{
7185,7 → 7185,7
for (c=0; c<doc->FrameItems.count(); ++c)
{
ite = doc->FrameItems.at(c);
if ((ite->itemType() == PageItem::TextFrame) || (ite->itemType() == PageItem::PathText))
if ((ite->asTextFrame()) || (ite->asPathText()))
{
for (d=0; d<ite->itemText.count(); ++d)
{
9151,7 → 9151,7
if (art && view->SelItem.count() != 0)
{
PageItem *currItem = view->SelItem.at(0);
if (currItem->itemType() == PageItem::ImageFrame)
if (currItem->asImageFrame())
{
scrMenuMgr->clearMenu("Style");
scrMenuMgr->addMenuToMenu("Color","Style");
9304,7 → 9304,7
if ((HaveDoc) && (view->SelItem.count() != 0))
{
PageItem *currItem = view->SelItem.at(0);
if ((currItem->itemType() == PageItem::TextFrame) && (doc->appMode == modeEdit))
if ((currItem->asTextFrame()) && (doc->appMode == modeEdit))
{
CharSelect *dia = new CharSelect(this, currItem);
dia->exec();
9424,7 → 9424,7
if (view->SelItem.at(i)!=NULL)
{
PageItem *currItem=view->SelItem.at(i);
if ((m->stateAfter() & Qt::ControlButton) && (currItem->itemType() == PageItem::TextFrame || currItem->itemType() == PageItem::PathText))
if ((m->stateAfter() & Qt::ControlButton) && (currItem->asTextFrame() || currItem->asPathText()))
view->ItemTextBrush(colorName); //Text colour
else
if (m->stateAfter() & Qt::AltButton) //Line colour
/branches/Version13x/Scribus/scribus/pageitem_textframe.h
45,6 → 45,7
 
public:
PageItem_TextFrame(ScribusDoc *pa, double x, double y, double w, double h, double w2, QString fill, QString outline);
PageItem_TextFrame(const PageItem & p) : PageItem(p) {}
~PageItem_TextFrame() {};
 
virtual PageItem_TextFrame * asTextFrame() { return this; }
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/cmdtext.cpp
12,7 → 12,7
PageItem *it = GetUniqueItem(QString::fromUtf8(Name));
if (it == NULL)
return NULL;
if ((it->itemType() != PageItem::TextFrame) && (it->itemType() != PageItem::PathText))
if (!(it->asTextFrame()) && !(it->asPathText()))
{
PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot get font size of non-text frame.","python error"));
return NULL;
38,7 → 38,7
PageItem *it = GetUniqueItem(QString::fromUtf8(Name));
if (it == NULL)
return NULL;
if ((it->itemType() != PageItem::TextFrame) && (it->itemType() != PageItem::PathText))
if (!(it->asTextFrame()) && !(it->asPathText()))
{
PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot get font of non-text frame.","python error"));
return NULL;
64,7 → 64,7
PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
if (i == NULL)
return NULL;
if ((i->itemType() != PageItem::TextFrame) && (i->itemType() != PageItem::PathText))
if (!(i->asTextFrame()) && !(i->asPathText()))
{
PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot get text size of non-text frame.","python error"));
return NULL;
82,7 → 82,7
PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
if (i == NULL)
return NULL;
if (i->itemType() != PageItem::TextFrame)
if (!i->asTextFrame())
{
PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot get column count of non-text frame.","python error"));
return NULL;
100,7 → 100,7
PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
if (i == NULL)
return NULL;
if (i->itemType() != PageItem::TextFrame)
if (!i->asTextFrame())
{
PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot get line space of non-text frame.","python error"));
return NULL;
118,7 → 118,7
PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
if (i == NULL)
return NULL;
if (i->itemType() != PageItem::TextFrame)
if (!i->asTextFrame())
{
PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot get column gap of non-text frame.","python error"));
return NULL;
137,7 → 137,7
PageItem *it = GetUniqueItem(QString::fromUtf8(Name));
if (it == NULL)
return NULL;
if ((it->itemType() != PageItem::TextFrame) && (it->itemType() != PageItem::PathText))
if (!(it->asTextFrame()) && !(it->asPathText()))
{
PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot get text of non-text frame.","python error"));
return NULL;
168,7 → 168,7
PageItem *it = GetUniqueItem(QString::fromUtf8(Name));
if (it == NULL)
return NULL;
if ((it->itemType() != PageItem::TextFrame) && (it->itemType() != PageItem::PathText))
if (!(it->asTextFrame()) && !(it->asPathText()))
{
PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot get text of non-text frame.","python error"));
return NULL;
244,7 → 244,7
PageItem *currItem = GetUniqueItem(QString::fromUtf8(Name));
if (currItem == NULL)
return NULL;
if ((currItem->itemType() != PageItem::TextFrame) && (currItem->itemType() != PageItem::PathText))
if (!(currItem->asTextFrame()) && !(currItem->asPathText()))
{
PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot set text of non-text frame.","python error"));
return NULL;
334,7 → 334,7
PageItem *it = GetUniqueItem(QString::fromUtf8(Name));
if (it == NULL)
return NULL;
if ((it->itemType() != PageItem::TextFrame) && (it->itemType() != PageItem::PathText))
if (!(it->asTextFrame()) && !(it->asPathText()))
{
PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot insert text into non-text frame.","python error"));
return NULL;
405,7 → 405,7
PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
if (i == NULL)
return NULL;
if (i->itemType() != PageItem::TextFrame)
if (!i->asTextFrame())
{
PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot set text alignment on a non-text frame.","python error"));
return NULL;
439,7 → 439,7
if (i == NULL)
return NULL;
 
if (i->itemType() != PageItem::TextFrame)
if (!i->asTextFrame())
{
PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot set font size on a non-text frame.","python error"));
return NULL;
467,7 → 467,7
PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
if (i == NULL)
return NULL;
if ((i->itemType() != PageItem::TextFrame) && (i->itemType() != PageItem::PathText))
if (!(i->asTextFrame()) && !(i->asPathText()))
{
PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot set font on a non-text frame.","python error"));
return NULL;
508,7 → 508,7
PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
if (i == NULL)
return NULL;
if (i->itemType() != PageItem::TextFrame)
if (!i->asTextFrame())
{
PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot set line spacing on a non-text frame.","python error"));
return NULL;
534,7 → 534,7
PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
if (i == NULL)
return NULL;
if (i->itemType() != PageItem::TextFrame)
if (!i->asTextFrame())
{
PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot set column gap on a non-text frame.","python error"));
return NULL;
560,7 → 560,7
PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
if (i == NULL)
return NULL;
if (i->itemType() != PageItem::TextFrame)
if (!i->asTextFrame())
{
PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot set number of columns on a non-text frame.","python error"));
return NULL;
595,7 → 595,7
PyErr_SetString(PyExc_IndexError, QObject::tr("Selection index out of bounds", "python error"));
return NULL;
}
if ((it->itemType() != PageItem::TextFrame) && (it->itemType() != PageItem::PathText))
if (!(it->asTextFrame()) && !(it->asPathText()))
{
PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot select text in a non-text frame", "python error"));
return NULL;
632,7 → 632,7
PageItem *it = GetUniqueItem(QString::fromUtf8(Name));
if (it == NULL)
return NULL;
if ((it->itemType() != PageItem::TextFrame) && (it->itemType() != PageItem::PathText))
if (!(it->asTextFrame()) && !(it->asPathText()))
{
PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot delete text from a non-text frame.","python error"));
return NULL;
671,7 → 671,7
PageItem *it = GetUniqueItem(QString::fromUtf8(Name));
if (it == NULL)
return NULL;
if ((it->itemType() != PageItem::TextFrame) && (it->itemType() != PageItem::PathText))
if (!(it->asTextFrame()) && !(it->asPathText()))
{
PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot set text fill on a non-text frame.","python error"));
return NULL;
705,7 → 705,7
PageItem *it = GetUniqueItem(QString::fromUtf8(Name));
if (it == NULL)
return NULL;
if ((it->itemType() != PageItem::TextFrame) && (it->itemType() != PageItem::PathText))
if (!(it->asTextFrame()) && (it->asPathText()))
{
PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot set text stroke on a non-text frame.","python error"));
return NULL;
744,7 → 744,7
PageItem *it = GetUniqueItem(QString::fromUtf8(Name));
if (it == NULL)
return NULL;
if ((it->itemType() != PageItem::TextFrame) && (it->itemType() != PageItem::PathText))
if (!(it->asTextFrame()) && !(it->asPathText()))
{
PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot set text shade on a non-text frame.","python error"));
return NULL;
782,7 → 782,7
PageItem *toitem = GetUniqueItem(QString::fromUtf8(name2));
if (toitem == NULL)
return NULL;
if ((fromitem->itemType() != PageItem::TextFrame) || (toitem->itemType() != PageItem::TextFrame))
if (!(fromitem->asTextFrame()) || !(toitem->asTextFrame()))
{
PyErr_SetString(WrongFrameTypeError, QObject::tr("Can only link text frames.","python error"));
return NULL;
827,7 → 827,7
PageItem *item = GetUniqueItem(QString::fromUtf8(name));
if (item == NULL)
return NULL;
if (item->itemType() != PageItem::TextFrame)
if (!item->asTextFrame())
{
PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot unlink a non-text frame.","python error"));
return NULL;
879,7 → 879,7
PageItem *item = GetUniqueItem(QString::fromUtf8(name));
if (item == NULL)
return NULL;
if (item->itemType() != PageItem::TextFrame)
if (!item->asTextFrame())
{
PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot convert a non-text frame to outlines.","python error"));
return NULL;
903,7 → 903,7
PageItem *item = GetUniqueItem(QString::fromUtf8(name));
if (item == NULL)
return NULL;
if (item->itemType() != PageItem::TextFrame)
if (!item->asTextFrame())
{
PyErr_SetString(WrongFrameTypeError, QObject::tr("Only text frames can be checked for overflowing", "python error"));
return NULL;
943,7 → 943,7
PageItem *i = GetUniqueItem(QString::fromUtf8(name));
if (i == NULL)
return NULL;
if (i->itemType() != PageItem::TextFrame)
if (!i->asTextFrame())
{
PyErr_SetString(WrongFrameTypeError, QObject::tr("Can't set bookmark on a non-text frame", "python error"));
return NULL;
975,7 → 975,7
PageItem *i = GetUniqueItem(QString::fromUtf8(name));
if (i == NULL)
return NULL;
if (i->itemType() != PageItem::TextFrame)
if (i->asTextFrame())
{
PyErr_SetString(WrongFrameTypeError, QObject::tr("Can't get info from a non-text frame", "python error"));
return NULL;
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/cmdmani.cpp
12,7 → 12,7
PageItem *item = GetUniqueItem(QString::fromUtf8(Name));
if (item == NULL)
return NULL;
if (item->itemType() != PageItem::ImageFrame)
if (!item->asImageFrame())
{
PyErr_SetString(WrongFrameTypeError, QObject::tr("Target is not an image frame.","python error"));
return NULL;
33,7 → 33,7
PageItem *item = GetUniqueItem(QString::fromUtf8(Name));
if (item == NULL)
return NULL;
if (item->itemType() != PageItem::ImageFrame)
if (! item->asImageFrame())
{
PyErr_SetString(ScribusException, QObject::tr("Specified item not an image frame.","python error"));
return NULL;
350,7 → 350,7
PageItem *item = GetUniqueItem(QString::fromUtf8(name));
if (item == NULL)
return NULL;
if (item->itemType() != PageItem::ImageFrame)
if (! item->asImageFrame())
{
PyErr_SetString(ScribusException, QObject::tr("Specified item not an image frame.","python error"));
return NULL;
/branches/Version13x/Scribus/scribus/plugins/fileloader/oodraw/oodrawimp.cpp
665,7 → 665,7
ss->GetText(ite, AbsStyle, Doku->toolSettings.defFont, FontSize*10, firstPa);
delete ss;
firstPa = true;
if (ite->itemType() != PageItem::PolyLine)
if (! ite->asPolyLine())
ite->convertTo(PageItem::TextFrame);
}
ite->setFillTransparency(FillTrans);
/branches/Version13x/Scribus/scribus/plugins/short-words/parse.cpp
45,7 → 45,7
SWConfig *cfg = new SWConfig();
 
// just textframes processed
if (aFrame->itemType() != PageItem::TextFrame)
if (!aFrame->asTextFrame())
return;
 
// an ugly hack to get the language code from the item language property
/branches/Version13x/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
427,11 → 427,11
}
gr = docu->createElement("g");
gr.setAttribute("transform", trans);
if (Item->itemType() != PageItem::TextFrame)
if (!Item->asTextFrame())
{
if (Item->NamedLStyle.isEmpty())
{
if ((Item->itemType() == PageItem::Line) || (Item->itemType() == PageItem::PolyLine) || (Item->itemType() == PageItem::PathText))
if ((Item->asLine()) || (Item->asPolyLine()) || (Item->asPathText()))
gr.setAttribute("style", "fill:none; "+stroke+" "+strokeW+" "+strokeLC+" "+strokeLJ+" "+strokeDA);
else
gr.setAttribute("style", fill+" "+stroke+" "+strokeW+" "+strokeLC+" "+strokeLJ+" "+strokeDA);
/branches/Version13x/Scribus/scribus/pslib.cpp
23,10 → 23,9
#include <cstdlib>
#include <qregexp.h>
 
#include "pslib.h"
#include "scconfig.h"
#include "pluginapi.h"
 
#include "pslib.h"
#include "scribusdoc.h"
#include "scribusview.h"
#include "scfonts.h"
1050,7 → 1049,7
continue;
if ((it->OwnPage != static_cast<int>(Doc->MasterPages.at(ap)->pageNr())) && (it->OwnPage != -1))
continue;
if ((it->itemType() == PageItem::ImageFrame) && (it->PicAvail) && (!it->Pfile.isEmpty()) && (it->printable()) && (!sep) && (farb))
if ((it->asImageFrame()) && (it->PicAvail) && (!it->Pfile.isEmpty()) && (it->printable()) && (!sep) && (farb))
PS_ImageData(it, it->Pfile, it->itemName(), it->IProfile, it->UseEmbedded, Ic);
PS_TemplateStart(Doc->MasterPages.at(ap)->PageNam + tmps.setNum(it->ItemNr));
ProcessItem(Doc, Doc->MasterPages.at(ap), it, ap+1, sep, farb, Ic, gcr, true);
1125,9 → 1124,9
PageItem *ite = Doc->Pages.at(a)->FromMaster.at(am);
if ((ite->LayerNr != ll.LNr) || (!ite->printable()))
continue;
if ((ite->itemType() != PageItem::TextFrame) && (ite->itemType() != PageItem::ImageFrame))
if (!(ite->asTextFrame()) && !(ite->asImageFrame()))
PS_UseTemplate(Doc->Pages.at(a)->MPageNam + tmps.setNum(ite->ItemNr));
else if (ite->itemType() == PageItem::ImageFrame)
else if (ite->asImageFrame())
{
PS_save();
PS_translate(ite->Xpos - mPage->xOffset(), mPage->height() -(ite->Ypos) - mPage->yOffset());
1200,7 → 1199,7
}
PS_restore();
}
else if (ite->itemType() == PageItem::TextFrame)
else if (ite->asTextFrame())
{
PS_save();
if (ite->fillColor() != "None")
1829,9 → 1828,9
c = PItems.at(b);
if (c->LayerNr != ll.LNr)
continue;
if ((!a->PageNam.isEmpty()) && (c->itemType() == PageItem::TextFrame))
if ((!a->PageNam.isEmpty()) && (c->asTextFrame()))
continue;
if ((!a->PageNam.isEmpty()) && (c->itemType() == PageItem::ImageFrame) && ((sep) || (!farb)))
if ((!a->PageNam.isEmpty()) && (c->asImageFrame()) && ((sep) || (!farb)))
continue;
if ((!Art) && (view->SelItem.count() != 0) && (!c->Select))
continue;
1857,9 → 1856,9
c = PItems.at(b);
if (c->LayerNr != ll.LNr)
continue;
if ((!a->PageNam.isEmpty()) && (c->itemType() == PageItem::TextFrame))
if ((!a->PageNam.isEmpty()) && (c->asTextFrame()))
continue;
if ((!a->PageNam.isEmpty()) && (c->itemType() == PageItem::ImageFrame) && ((sep) || (!farb)))
if ((!a->PageNam.isEmpty()) && (c->asImageFrame()) && ((sep) || (!farb)))
continue;
int x = static_cast<int>(a->xOffset());
int y = static_cast<int>(a->yOffset());
/branches/Version13x/Scribus/scribus/colorm.cpp
360,7 → 360,7
if (found)
break;
}
if ((ite->itemType() == PageItem::TextFrame) || (ite->itemType() == PageItem::PathText))
if ((ite->asTextFrame()) || (ite->asPathText()))
{
for (uint d=0; d<ite->itemText.count(); ++d)
{
394,7 → 394,7
if (found)
break;
}
if ((ite->itemType() == PageItem::TextFrame) || (ite->itemType() == PageItem::PathText))
if ((ite->asTextFrame()) || (ite->asPathText()))
{
for (uint d=0; d<ite->itemText.count(); ++d)
{
428,7 → 428,7
if (found)
break;
}
if ((ite->itemType() == PageItem::TextFrame) || (ite->itemType() == PageItem::PathText))
if ((ite->asTextFrame()) || (ite->asPathText()))
{
for (uint d=0; d<ite->itemText.count(); ++d)
{
/branches/Version13x/Scribus/scribus/pageitem_polygon.h
45,6 → 45,7
 
public:
PageItem_Polygon(ScribusDoc *pa, double x, double y, double w, double h, double w2, QString fill, QString outline);
PageItem_Polygon(const PageItem & p) : PageItem(p) {}
~PageItem_Polygon() {};
 
virtual PageItem_Polygon * asPolygon() { return this; }