Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 19755 → Rev 19754

/branches/Version14x/Scribus/scribus/scribusdoc.cpp
8286,11 → 8286,11
}
 
 
bool ScribusDoc::startAlign(uint minObjects)
bool ScribusDoc::startAlign()
{
buildAlignItemList();
uint alignObjectsCount = AObjects.count();
if (alignObjectsCount < minObjects)
uint alignObjectsCount=AObjects.count();
if (alignObjectsCount==0)
return false;
bool oneLocked=false;
8297,7 → 8297,7
for (uint i = 0; i < alignObjectsCount && !oneLocked; ++i)
for (int j = 0; j < AObjects[i].Objects.count() && !oneLocked; ++j)
if (AObjects[i].Objects.at(j)->locked())
oneLocked = true;
oneLocked=true;
int t = 2;
if (oneLocked)
{
8342,6 → 8342,7
return true;
}
 
 
void ScribusDoc::endAlign()
{
changed();
8421,8 → 8422,8
{
if (!startAlign())
return;
uint alignObjectsCount = AObjects.count();
int loopStart = 0, loopEnd = alignObjectsCount - 1;
uint alignObjectsCount=AObjects.count();
int loopStart=0, loopEnd=alignObjectsCount-1;
double newX = 99999.9;
switch ( currAlignTo )
{
8459,8 → 8460,8
{
if (!startAlign())
return;
uint alignObjectsCount = AObjects.count();
int loopStart = 0, loopEnd = alignObjectsCount - 1;
uint alignObjectsCount=AObjects.count();
int loopStart=0, loopEnd=alignObjectsCount-1;
double newX = std::numeric_limits<double>::max();
switch ( currAlignTo )
{
8497,8 → 8498,8
{
if (!startAlign())
return;
uint alignObjectsCount = AObjects.count();
int loopStart = 0, loopEnd = alignObjectsCount - 1;
uint alignObjectsCount=AObjects.count();
int loopStart=0, loopEnd=alignObjectsCount-1;
double newX = 0.0;
switch ( currAlignTo )
{
8551,8 → 8552,8
{
if (!startAlign())
return;
uint alignObjectsCount = AObjects.count();
int loopStart = 0, loopEnd = alignObjectsCount - 1;
uint alignObjectsCount=AObjects.count();
int loopStart=0, loopEnd=alignObjectsCount-1;
double newX = -std::numeric_limits<double>::max();
switch ( currAlignTo )
{
8591,8 → 8592,8
{
if (!startAlign())
return;
uint alignObjectsCount = AObjects.count();
int loopStart = 0, loopEnd = alignObjectsCount - 1;
uint alignObjectsCount=AObjects.count();
int loopStart=0, loopEnd=alignObjectsCount-1;
double newX = -std::numeric_limits<double>::max();
switch ( currAlignTo )
{
8631,8 → 8632,8
{
if (!startAlign())
return;
uint alignObjectsCount = AObjects.count();
int loopStart = 0, loopEnd = alignObjectsCount - 1;
uint alignObjectsCount=AObjects.count();
int loopStart=0, loopEnd=alignObjectsCount-1;
double newY = std::numeric_limits<double>::max();
switch ( currAlignTo )
{
8669,8 → 8670,8
{
if (!startAlign())
return;
uint alignObjectsCount = AObjects.count();
int loopStart = 0, loopEnd = alignObjectsCount - 1;
uint alignObjectsCount=AObjects.count();
int loopStart=0, loopEnd=alignObjectsCount-1;
double newY = std::numeric_limits<double>::max();
switch ( currAlignTo )
{
8707,8 → 8708,8
{
if (!startAlign())
return;
uint alignObjectsCount = AObjects.count();
int loopStart = 0, loopEnd = alignObjectsCount - 1;
uint alignObjectsCount=AObjects.count();
int loopStart=0, loopEnd=alignObjectsCount-1;
double newY = 0.0;
switch ( currAlignTo )
{
8761,8 → 8762,8
{
if (!startAlign())
return;
uint alignObjectsCount = AObjects.count();
int loopStart = 0, loopEnd = alignObjectsCount - 1;
uint alignObjectsCount=AObjects.count();
int loopStart=0, loopEnd=alignObjectsCount-1;
double newY = -std::numeric_limits<double>::max();
switch ( currAlignTo )
{
8801,8 → 8802,8
{
if (!startAlign())
return;
uint alignObjectsCount = AObjects.count();
int loopStart = 0, loopEnd = alignObjectsCount - 1;
uint alignObjectsCount=AObjects.count();
int loopStart=0, loopEnd=alignObjectsCount-1;
double newY = -std::numeric_limits<double>::max();
switch ( currAlignTo )
{
8839,9 → 8840,11
 
void ScribusDoc::itemSelection_DistributeLeft()
{
if (!startAlign(2))
if (!startAlign())
return;
uint alignObjectsCount = AObjects.count();
uint alignObjectsCount=AObjects.count();
if (alignObjectsCount<=1)
return;
QMap<double,uint> Xsorted;
for (uint a = 0; a < alignObjectsCount; ++a)
{
8877,9 → 8880,11
 
void ScribusDoc::itemSelection_DistributeCenterH()
{
if (!startAlign(2))
if (!startAlign())
return;
uint alignObjectsCount = AObjects.count();
uint alignObjectsCount=AObjects.count();
if (alignObjectsCount<=1)
return;
QMap<double,uint> Xsorted;
for (uint a = 0; a < alignObjectsCount; ++a)
{
8915,9 → 8920,11
 
void ScribusDoc::itemSelection_DistributeRight()
{
if (!startAlign(2))
if (!startAlign())
return;
uint alignObjectsCount = AObjects.count();
uint alignObjectsCount=AObjects.count();
if (alignObjectsCount<=1)
return;
QMap<double,uint> Xsorted;
for (uint a = 0; a < alignObjectsCount; ++a)
{
8953,9 → 8960,11
 
void ScribusDoc::itemSelection_DistributeDistH(bool usingDistance, double distance, bool reverseDistribute)
{
if (!startAlign(2))
if (!startAlign())
return;
uint alignObjectsCount = AObjects.count();
uint alignObjectsCount=AObjects.count();
if (alignObjectsCount<=1)
return;
QMap<double,uint> X1sorted, X2sorted;
for (uint a = 0; a < alignObjectsCount; ++a)
{
9036,9 → 9045,11
 
void ScribusDoc::itemSelection_DistributeBottom()
{
if (!startAlign(2))
if (!startAlign())
return;
uint alignObjectsCount = AObjects.count();
uint alignObjectsCount=AObjects.count();
if (alignObjectsCount<=1)
return;
QMap<double,uint> Ysorted;
for (uint a = 0; a < alignObjectsCount; ++a)
{
9074,9 → 9085,11
 
void ScribusDoc::itemSelection_DistributeCenterV()
{
if (!startAlign(2))
if (!startAlign())
return;
uint alignObjectsCount = AObjects.count();
uint alignObjectsCount=AObjects.count();
if (alignObjectsCount<=1)
return;
QMap<double,uint> Ysorted;
for (uint a = 0; a < alignObjectsCount; ++a)
{
9112,9 → 9125,11
 
void ScribusDoc::itemSelection_DistributeTop()
{
if (!startAlign(2))
if (!startAlign())
return;
uint alignObjectsCount = AObjects.count();
uint alignObjectsCount=AObjects.count();
if (alignObjectsCount<=1)
return;
QMap<double,uint> Ysorted;
for (uint a = 0; a < alignObjectsCount; ++a)
{
9150,9 → 9165,11
 
void ScribusDoc::itemSelection_DistributeDistV(bool usingDistance, double distance, bool reverseDistribute)
{
if (!startAlign(2))
if (!startAlign())
return;
uint alignObjectsCount = AObjects.count();
uint alignObjectsCount=AObjects.count();
if (alignObjectsCount<=1)
return;
QMap<double,uint> Y1sorted, Y2sorted;
for (uint a = 0; a < alignObjectsCount; ++a)
{
9234,9 → 9251,11
 
void ScribusDoc::itemSelection_DistributeAcrossPage(bool useMargins)
{
if (!startAlign(2))
if (!startAlign())
return;
uint alignObjectsCount = AObjects.count();
uint alignObjectsCount=AObjects.count();
if (alignObjectsCount<=1)
return;
QMap<double,uint> X1sorted, X2sorted;
for (uint a = 0; a < alignObjectsCount; ++a)
{
9284,9 → 9303,11
 
void ScribusDoc::itemSelection_DistributeDownPage(bool useMargins)
{
if (!startAlign(2))
if (!startAlign())
return;
uint alignObjectsCount = AObjects.count();
uint alignObjectsCount=AObjects.count();
if (alignObjectsCount<=1)
return;
QMap<double,uint> Y1sorted, Y2sorted;
for (uint a = 0; a < alignObjectsCount; ++a)
{
/branches/Version14x/Scribus/scribus/scribusdoc.h
791,7 → 791,7
typedef enum {alignFirst, alignLast, alignPage, alignMargins, alignGuide, alignSelection } AlignTo;
typedef enum {alignByMoving, alignByResizing } AlignMethod;
void buildAlignItemList(Selection* customSelection=0);
bool startAlign(uint minObjects = 1);
bool startAlign();
void endAlign();
/**
* \brief Insert a color into the documents color list