Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 2447 → Rev 2448

/branches/Version13x/Scribus/scribus/tocindexprefs.ui.h
44,6 → 44,7
if (enabled)
{
updateToCListBox();
updateParagraphStyleComboBox();
tocListBox->setCurrentItem(0);
selectToC(0);
}
74,9 → 75,6
itemAttrComboBox->clear();
itemAttrComboBox->insertItem(trStrNone);
itemAttrComboBox->insertStringList(newNames);
itemParagraphStyleComboBox->clear();
itemParagraphStyleComboBox->insertItem(trStrNone);
selectToC(0);
}
 
 
91,15 → 89,7
itemAttrComboBox->setCurrentText(trStrNone);
else
itemAttrComboBox->setCurrentText(localToCSetupVector[num].itemAttrName);
if (localToCSetupVector[num].frameName==strNone)
itemDestFrameComboBox->setCurrentText(trStrNone);
else
itemDestFrameComboBox->setCurrentText(localToCSetupVector[num].frameName);
if (localToCSetupVector[num].textStyle==strNone)
itemParagraphStyleComboBox->setCurrentText(trStrNone);
else
itemParagraphStyleComboBox->setCurrentText(localToCSetupVector[num].textStyle);
if (localToCSetupVector[num].pageLocation==NotShown)
itemNumberPlacementComboBox->setCurrentText(trStrPNNotShown);
else
107,6 → 97,19
itemNumberPlacementComboBox->setCurrentText(trStrPNBeginning);
else
itemNumberPlacementComboBox->setCurrentText(trStrPNEnd);
 
if (currDoc!=NULL)
{
if (localToCSetupVector[num].frameName==strNone)
itemDestFrameComboBox->setCurrentText(trStrNone);
else
itemDestFrameComboBox->setCurrentText(localToCSetupVector[num].frameName);
if (!paragraphStyleList.contains(localToCSetupVector[num].textStyle) || localToCSetupVector[num].textStyle==strNone)
itemParagraphStyleComboBox->setCurrentText(trStrNone);
else
itemParagraphStyleComboBox->setCurrentText(localToCSetupVector[num].textStyle);
}
if (numberSelected>=0)
{
149,7 → 152,21
tocListBox->insertItem((*it).name);
}
 
void TOCIndexPrefs::updateParagraphStyleComboBox()
{
paragraphStyleList.clear();
paragraphStyleList.append(trStrNone);
if(currDoc!=NULL && currDoc->docParagraphStyles.count()>5)
{
for (uint i = 5; i < currDoc->docParagraphStyles.count(); ++i)
paragraphStyleList.append(currDoc->docParagraphStyles[i].Vname);
}
itemParagraphStyleComboBox->clear();
itemParagraphStyleComboBox->insertStringList(paragraphStyleList);
}
 
 
void TOCIndexPrefs::enableGUIWidgets()
{
bool enabled=(localToCSetupVector.count()>0);
/branches/Version13x/Scribus/scribus/tocindexprefs.ui
239,8 → 239,9
</connection>
</connections>
<includes>
<include location="local" impldecl="in declaration">pagestructs.h</include>
<include location="local" impldecl="in implementation">scribusdoc.h</include>
<include location="local" impldecl="in declaration">pagestructs.h</include>
<include location="global" impldecl="in implementation">qstringlist.h</include>
<include location="local" impldecl="in implementation">tocindexprefs.ui.h</include>
</includes>
<forwards>
257,6 → 258,7
<variable>QString trStrNone;</variable>
<variable>ScribusDoc *currDoc;</variable>
<variable>QString selectedTOCAttrName;</variable>
<variable>QStringList paragraphStyleList;</variable>
<variable>QString strNone;</variable>
</variables>
<slots>
265,6 → 267,8
<slot>setupItemAttrs( QStringList newNames )</slot>
<slot>selectToC( int numberSelected )</slot>
<slot>addToC()</slot>
<slot>updateToCListBox()</slot>
<slot>updateParagraphStyleComboBox()</slot>
<slot>deleteToC()</slot>
<slot>itemAttributeSelected( const QString &amp; itemAttributeName )</slot>
<slot>itemFrameSelected( const QString &amp; frameName )</slot>
275,7 → 279,6
<functions>
<function access="private" specifier="non virtual">init()</function>
<function access="private" specifier="non virtual">destroy()</function>
<function access="protected">updateToCListBox()</function>
<function>enableGUIWidgets()</function>
<function returnType="ToCSetupVector *">getNewToCs()</function>
</functions>
/branches/Version13x/Scribus/scribus/tocgenerator.cpp
21,6 → 21,8
#include "scribusdoc.h"
#include "pagestructs.h"
#include "pageitem.h"
#include "gtparagraphstyle.h"
#include "gtframestyle.h"
#include "gtwriter.h"
 
 
95,7 → 97,15
}
}
}
//Set up the gtWriter instance with the selected paragraph style
gtWriter* writer = new gtWriter(false, tocFrame);
writer->setUpdateParagraphStyles(false);
writer->setOverridePStyleFont(false);
gtFrameStyle* fstyle = writer->getDefaultStyle();
gtParagraphStyle* pstyle = new gtParagraphStyle(*fstyle);
pstyle->setName((*tocSetupIt).textStyle);
writer->setParagraphStyle(pstyle);
QString oldTocPage=QString::null;
for (QMap<QString, QString>::Iterator tocIt=tocMap.begin();tocIt!=tocMap.end();++tocIt)
{