/// Return the AutoCollection by its Id. If it doesn't /// exist yet, create it. /// If the String pointer is defined, then only query for /// the Attribute descriptions. It doesn't create a style!
SvxFrameDirection GetDefaultFrameDirection(LanguageType nLanguage)
{ return MsLangId::isRightToLeft(nLanguage) ?
SvxFrameDirection::Horizontal_RL_TB : SvxFrameDirection::Horizontal_LR_TB;
}
namespace { #ifndef NDEBUG bool lcl_isValidUsedStyle(const sw::BroadcastingModify* pModify)
{ constbool isParaStyle = dynamic_cast<const SwTextFormatColl*>(pModify); constbool isCharStyle = dynamic_cast<const SwCharFormat*>(pModify); constbool isFrameStyle = dynamic_cast<const SwFrameFormat*>(pModify); constbool isFieldType = dynamic_cast<const SwFieldType*>(pModify); // just for insanity's sake, this is also used on FieldTypes return isParaStyle || isCharStyle || isFrameStyle || isFieldType;
} #endif
}
// See if the Paragraph/Character/Frame style or Field Type is in use bool SwDoc::IsUsed( const sw::BroadcastingModify& rModify ) const
{
assert(lcl_isValidUsedStyle(&rModify));
// Check if we have dependent ContentNodes in the Nodes array // (also indirect ones for derived Formats) bool isUsed = false;
sw::AutoFormatUsedHint aHint(isUsed, GetNodes());
rModify.CallSwClientNotify(aHint); return isUsed;
}
// See if Table style is in use bool SwDoc::IsUsed( const SwTableAutoFormat& rTableAutoFormat) const
{
size_t nTableCount = GetTableFrameFormatCount(true); for (size_t i=0; i < nTableCount; ++i)
{
SwFrameFormat* pFrameFormat = &GetTableFrameFormat(i, true);
SwTable* pTable = SwTable::FindTable(pFrameFormat); if (pTable->GetTableStyleName() == rTableAutoFormat.GetName()) returntrue;
} returnfalse;
}
// See if the NumRule is used bool SwDoc::IsUsed( const SwNumRule& rRule ) const
{
SwList const*const pList(getIDocumentListsAccess().getListByName(rRule.GetDefaultListId())); bool bUsed = rRule.GetTextNodeListSize() > 0 ||
rRule.GetParagraphStyleListSize() > 0 ||
rRule.IsUsedByRedline() // tdf#135014 default num rule is used if any associated num rule is used
|| (pList
&& pList->GetDefaultListStyleName() == rRule.GetName()
&& pList->HasNodes());
// Look for the style name's position. If it doesn't exist, // insert an anew
size_t SwDoc::SetDocPattern(const OUString& rPatternName)
{
OSL_ENSURE( !rPatternName.isEmpty(), "no Document style name" );
sal_uInt16 GetPoolParent( sal_uInt16 nId )
{
sal_uInt16 nRet = USHRT_MAX; if( POOLGRP_NOCOLLID & nId ) // 1 == Formats / 0 == Collections
{ switch( ( COLL_GET_RANGE_BITS | POOLGRP_NOCOLLID ) & nId )
{ case POOLGRP_CHARFMT: case POOLGRP_FRAMEFMT:
nRet = 0; // derived from the default break; case POOLGRP_PAGEDESC: case POOLGRP_NUMRULE: break; // there are no derivations
}
} else
{ switch( COLL_GET_RANGE_BITS & nId )
{ case COLL_TEXT_BITS: switch( nId )
{ case RES_POOLCOLL_STANDARD:
nRet = 0; break; case RES_POOLCOLL_TEXT_IDENT: case RES_POOLCOLL_TEXT_NEGIDENT: case RES_POOLCOLL_TEXT_MOVE: case RES_POOLCOLL_CONFRONTATION: case RES_POOLCOLL_MARGINAL:
nRet = RES_POOLCOLL_TEXT; break;
case RES_POOLCOLL_TEXT: case RES_POOLCOLL_GREETING: case RES_POOLCOLL_SIGNATURE:
nRet = RES_POOLCOLL_STANDARD; break;
} break;
case COLL_LISTS_BITS: switch( nId )
{ case RES_POOLCOLL_NUMBER_BULLET_BASE:
nRet = RES_POOLCOLL_TEXT; break;
case COLL_EXTRA_BITS: switch( nId )
{ case RES_POOLCOLL_TABLE_HDLN:
nRet = RES_POOLCOLL_TABLE; break;
case RES_POOLCOLL_FRAME: case RES_POOLCOLL_TABLE: case RES_POOLCOLL_FOOTNOTE: case RES_POOLCOLL_ENDNOTE: case RES_POOLCOLL_ENVELOPE_ADDRESS: case RES_POOLCOLL_SEND_ADDRESS: case RES_POOLCOLL_HEADERFOOTER: case RES_POOLCOLL_LABEL: case RES_POOLCOLL_COMMENT:
nRet = RES_POOLCOLL_STANDARD; break; case RES_POOLCOLL_HEADER:
nRet = RES_POOLCOLL_HEADERFOOTER; break; case RES_POOLCOLL_HEADERL: case RES_POOLCOLL_HEADERR:
nRet = RES_POOLCOLL_HEADER; break; case RES_POOLCOLL_FOOTER:
nRet = RES_POOLCOLL_HEADERFOOTER; break; case RES_POOLCOLL_FOOTERL: case RES_POOLCOLL_FOOTERR:
nRet = RES_POOLCOLL_FOOTER; break;
case RES_POOLCOLL_LABEL_ABB: case RES_POOLCOLL_LABEL_TABLE: case RES_POOLCOLL_LABEL_FRAME: case RES_POOLCOLL_LABEL_DRAWING: case RES_POOLCOLL_LABEL_FIGURE:
nRet = RES_POOLCOLL_LABEL; break;
} break;
case COLL_REGISTER_BITS: switch( nId )
{ case RES_POOLCOLL_REGISTER_BASE:
nRet = RES_POOLCOLL_STANDARD; break;
case RES_POOLCOLL_TOX_IDXH:
nRet = RES_POOLCOLL_HEADLINE_BASE; break;
case RES_POOLCOLL_TOX_USERH: case RES_POOLCOLL_TOX_CNTNTH: case RES_POOLCOLL_TOX_ILLUSH: case RES_POOLCOLL_TOX_OBJECTH: case RES_POOLCOLL_TOX_TABLESH: case RES_POOLCOLL_TOX_AUTHORITIESH:
nRet = RES_POOLCOLL_TOX_IDXH; break;
case COLL_DOC_BITS: switch (nId)
{ case RES_POOLCOLL_HEADLINE_BASE:
nRet = RES_POOLCOLL_STANDARD; break; default:
nRet = RES_POOLCOLL_HEADLINE_BASE; break;
} break;
case COLL_HTML_BITS:
nRet = RES_POOLCOLL_STANDARD; break;
}
}
return nRet;
}
void SwDoc::RemoveAllFormatLanguageDependencies()
{ /* Restore the language independent pool defaults and styles. */
GetAttrPool().ResetUserDefaultItem( RES_PARATR_ADJUST );
pTextFormatColl->ResetFormatAttr( RES_PARATR_ADJUST ); /* koreans do not like SvxScriptItem(TRUE) */
pTextFormatColl->ResetFormatAttr( RES_PARATR_SCRIPTSPACE );
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.