本文整理汇总了C++中KoGenStyle::setAutoStyleInStylesDotXml方法的典型用法代码示例。如果您正苦于以下问题:C++ KoGenStyle::setAutoStyleInStylesDotXml方法的具体用法?C++ KoGenStyle::setAutoStyleInStylesDotXml怎么用?C++ KoGenStyle::setAutoStyleInStylesDotXml使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KoGenStyle
的用法示例。
在下文中一共展示了KoGenStyle::setAutoStyleInStylesDotXml方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: saveOdf
void KoPAMasterPage::saveOdf( KoShapeSavingContext & context ) const
{
KoPASavingContext &paContext = static_cast<KoPASavingContext&>( context );
KoGenStyle pageLayoutStyle = pageLayout().saveOdf();
pageLayoutStyle.setAutoStyleInStylesDotXml( true );
pageLayoutStyle.addAttribute( "style:page-usage", "all" );
QString pageLayoutName( paContext.mainStyles().insert( pageLayoutStyle, "pm" ) );
KoGenStyle pageMaster( KoGenStyle::MasterPageStyle );
pageMaster.addAttribute( "style:page-layout-name", pageLayoutName );
pageMaster.addAttribute( "style:display-name", name() );
pageMaster.addAttribute( "draw:style-name", saveOdfPageStyle( paContext ) );
KoXmlWriter &savedWriter = paContext.xmlWriter();
QBuffer buffer;
buffer.open( QIODevice::WriteOnly );
KoXmlWriter xmlWriter( &buffer );
paContext.setXmlWriter( xmlWriter );
saveOdfPageContent( paContext );
paContext.setXmlWriter( savedWriter );
QString contentElement = QString::fromUtf8( buffer.buffer(), buffer.buffer().size() );
pageMaster.addChildElement( paContext.masterPageElementName(), contentElement );
paContext.addMasterPage( this, paContext.mainStyles().insert( pageMaster, "Default" ) );
}
示例2: KoGenStyle
KoGenStyle
WordsGraphicsHandler::DrawClient::createGraphicStyle(const MSO::OfficeArtClientTextBox* ct,
const MSO::OfficeArtClientData* cd,
const DrawStyle& ds,
Writer& out)
{
Q_UNUSED(ct);
Q_UNUSED(cd);
KoGenStyle style = KoGenStyle(KoGenStyle::GraphicAutoStyle, "graphic");
style.setAutoStyleInStylesDotXml(out.stylesxml);
// Set specific attributes of graphic-properties.
gh->definePositionAttributes(style, ds);
gh->defineWrappingAttributes(style, ds);
return style;
}
示例3: slotSectionFound
//create page-layout and master-page
void Document::slotSectionFound(wvWare::SharedPtr<const wvWare::Word97::SEP> sep)
{
kDebug(30513) ;
m_omittMasterPage = false;
m_useLastMasterPage = false;
//does this section require a specific first page
bool firstPage = sep->fTitlePage || sep->pgbApplyTo;
// *******************************
// page-layout style
// *******************************
kDebug(30513) << "preparing page-layout styles";
KoGenStyle* pageLayoutStyle = new KoGenStyle(KoGenStyle::PageLayoutStyle);
//set page-layout attributes
setPageLayoutStyle(pageLayoutStyle, sep, 0);
pageLayoutStyle->setAutoStyleInStylesDotXml(true);
//NOTE: Each section may require a new page-layout. If this is not the
//case and the header/footer content didn't change, the <style:master-page>
//element can be omitted. Except of continuous section break a manual page
//break has to be inserted.
//TODO: Even page/Odd page section break support
//FIXME: missing support for fo:break-before="page" in table properties so
//let's omitt the <style:master-page> element only in case of a continuous
//section break
if ( !firstPage && !headersChanged() && (m_pageLayoutStyle_last == *pageLayoutStyle) ){
// if (sep->bkc != 0) {
// textHandler()->set_breakBeforePage(true);
// }
switch (sep->bkc) {
case bkcContinuous:
kDebug(30513) << "omitting page-layout & master-page creation";
m_omittMasterPage = true;
break;
case bkcNewPage:
case bkcEvenPage:
case bkcOddPage:
kDebug(30513) << "using the last defined master-page";
m_useLastMasterPage = true;
m_writeMasterPageName = true;
break;
default:
kWarning(30513) << "Warning: section break type (" << sep->bkc << ") NOT SUPPORTED!";
m_omittMasterPage = true;
break;
}
//cleaning required!
delete pageLayoutStyle;
} else {
//save the actual KoGenStyle!
m_pageLayoutStyle_last = *pageLayoutStyle;
//add data into corresponding lists
m_pageLayoutStyle_list.prepend(pageLayoutStyle);
}
//yeah, we can omitt creation of a new master-page
if (m_omittMasterPage || m_useLastMasterPage) {
return;
}
//check if a first-page specific page-layout has to be created
if (firstPage) {
pageLayoutStyle = new KoGenStyle(KoGenStyle::PageLayoutStyle);
//set page-layout attributes for the first page
setPageLayoutStyle(pageLayoutStyle, sep, 1);
pageLayoutStyle->setAutoStyleInStylesDotXml(true);
//add data into corresponding lists
m_pageLayoutStyle_list.prepend(pageLayoutStyle);
}
// *******************************
// master-page style
// *******************************
KoGenStyle* masterStyle = new KoGenStyle(KoGenStyle::MasterPageStyle);
QString masterStyleName;
//NOTE: The first master-page-name has to be "Standard", words has hard
//coded that the value of fo:backgroud-color from this style is used for
//the entire frameset.
if (m_textHandler->sectionNumber() > 1) {
masterStyleName.append("MP");
masterStyleName.append(QString::number(m_textHandler->sectionNumber()));
} else {
masterStyleName.append("Standard");
}
masterStyle->addAttribute("style:display-name", masterStyleName);
//add data into corresponding lists
//.........这里部分代码省略.........