LibreOffice Module sw (master) 1
|
Classes | |
struct | CharRunEntry |
class | CharStyleMapper |
Knows which writer style a given word style should be imported as. More... | |
class | CompareRedlines |
class | FontMapExport |
Find suitable names for exporting this font. More... | |
class | HdFtDistanceGlue |
Make export a word section top/bottom values easy. More... | |
class | InsertedTableListener |
class | InsertedTablesManager |
Handle requirements for table formatting in insert->file mode. More... | |
class | ItemSort |
class | ParaStyleMapper |
Knows which writer style a given word style should be imported as. More... | |
class | RedlineStack |
class | SetEndIfOpen |
class | SetInDocAndDelete |
class | SetLayer |
Make setting a drawing object's layer in a Writer document easy. More... | |
class | WrtRedlineAuthor |
Typedefs | |
typedef std::vector< CharRunEntry > | CharRuns |
Functions | |
SwTwips | MakeSafePositioningValue (SwTwips nIn) |
Clips a value to MAX/MIN 16bit value to make it safe for use as a position value to give to writer. More... | |
void | MoveAttrFieldmarkInserted (SwFltPosition &rMkPos, SwFltPosition &rPtPos, const SwPosition &rPos) |
CharRuns | GetPseudoCharRuns (const SwTextNode &rTextNd) |
Collect the ranges of Text which share. More... | |
void | GetPoolItems (const SfxItemSet &rSet, ww8::PoolItems &rItems, bool bExportParentItemSet) |
Get the SfxPoolItems of a SfxItemSet. More... | |
const SfxPoolItem * | SearchPoolItems (const ww8::PoolItems &rItems, sal_uInt16 eType) |
void | ClearOverridesFromSet (const SwFormatCharFormat &rFormat, SfxItemSet &rSet) |
Remove properties from an SfxItemSet which a SwFormatCharFormat overrides. More... | |
ww8::ParaStyles | GetParaStyles (const SwDoc &rDoc) |
Get the Paragraph Styles of a SwDoc. More... | |
SwTextFormatColl * | GetParaStyle (SwDoc &rDoc, const OUString &rName) |
Get a Paragraph Style which fits a given name. More... | |
SwCharFormat * | GetCharStyle (SwDoc &rDoc, const OUString &rName) |
Get a Character Style which fits a given name. More... | |
void | SortByAssignedOutlineStyleListLevel (ww8::ParaStyles &rStyles) |
Sort sequence of Paragraph Styles by assigned outline style list level. More... | |
ww8::Frames | GetFrames (const SwDoc &rDoc, SwPaM const *pPaM) |
Get the Floating elements in a SwDoc. More... | |
void | UpdateFramePositions (ww8::Frames &rFrames) |
fix up frame positions, must be called after SetRedlineFlags More... | |
ww8::Frames | GetFramesInNode (const ww8::Frames &rFrames, const SwNode &rNode) |
Get the Frames anchored to a given node. More... | |
const SwNumFormat * | GetNumFormatFromSwNumRuleLevel (const SwNumRule &rRule, int nLevel) |
Get the Numbering Format for a given level from a numbering rule. More... | |
const SwNumFormat * | GetNumFormatFromTextNode (const SwTextNode &rTextNode) |
Get the Numbering Format used on a paragraph. More... | |
const SwNumRule * | GetNumRuleFromTextNode (const SwTextNode &rTextNode) |
const SwNumRule * | GetNormalNumRuleFromTextNode (const SwTextNode &rTextNode) |
SwNoTextNode * | GetNoTextNodeFromSwFrameFormat (const SwFrameFormat &rFormat) |
Get the SwNoTextNode associated with a SwFrameFormat if here is one. More... | |
bool | HasPageBreak (const SwNode &rNode) |
Does a node have a "page break before" applied. More... | |
tools::Polygon | PolygonFromPolyPolygon (const tools::PolyPolygon &rPolyPoly) |
Make a best fit Polygon from a PolyPolygon. More... | |
tools::Polygon | CorrectWordWrapPolygonForExport (const tools::PolyPolygon &rPolyPoly, const SwNoTextNode *pNd, bool bCorrectCrop) |
Undo all scaling / move tricks of the wrap polygon done during import. More... | |
template<class T > | |
const T & | item_cast (const SfxPoolItem &rItem) |
Provide a dynamic_cast style cast for SfxPoolItems. More... | |
template<class T > | |
const T * | item_cast (const SfxPoolItem *pItem) |
Provide a dynamic_cast style cast for SfxPoolItems. More... | |
template<class T > | |
const T * | HasItem (const ww8::PoolItems &rItems, sal_uInt16 eType) |
const SwCharFormat * | GetSwCharFormat (const SwFormatINetFormat &rINet, SwDoc &rDoc) |
bool | IsPlausableSingleWordSection (const SwFrameFormat &rTitleFormat, const SwFrameFormat &rFollowFormat) |
See if two page formats can be expressed as a single word section. More... | |
typedef std::vector<CharRunEntry> sw::util::CharRuns |
Definition at line 383 of file msfilter.hxx.
void sw::util::ClearOverridesFromSet | ( | const SwFormatCharFormat & | rFormat, |
SfxItemSet & | rSet | ||
) |
Remove properties from an SfxItemSet which a SwFormatCharFormat overrides.
Given an SfxItemSet and a SwFormatCharFormat remove from the rSet all the properties which the SwFormatCharFormat would override. An SfxItemSet contains attributes, and a SwFormatCharFormat is a "Character Style", so if the SfxItemSet contains bold and so does the character style then delete bold from the SfxItemSet
rFormat | the SwFormatCharFormat which describes the Character Style |
rSet | the SfxItemSet from which we want to remove any properties which the rFormat would override |
Definition at line 416 of file writerhelper.cxx.
References SfxItemSet::ClearItem(), SwFormatCharFormat::GetCharFormat(), SfxItemIter::GetCurItem(), SfxItemIter::NextItem(), rSet, and SfxPoolItem::Which().
Referenced by SwWW8AttrIter::OutAttr().
tools::Polygon sw::util::CorrectWordWrapPolygonForExport | ( | const tools::PolyPolygon & | rPolyPoly, |
const SwNoTextNode * | pNd, | ||
bool | bCorrectCrop | ||
) |
Undo all scaling / move tricks of the wrap polygon done during import.
Definition at line 638 of file writerhelper.cxx.
References convertTwipToMm100(), SvxGrfCrop::GetBottom(), SwAttrSet::GetCropGrf(), SwNoTextNode::GetGraphic(), Size::getHeight(), SvxGrfCrop::GetLeft(), Graphic::GetPrefSize(), SwContentNode::GetpSwAttrSet(), SvxGrfCrop::GetRight(), SvxGrfCrop::GetTop(), SwNoTextNode::GetTwipSize(), Size::getWidth(), SfxItemSet::HasItem(), Size::Height(), tools::Polygon::Move(), ww::nWrap100Percent, PolygonFromPolyPolygon(), RES_GRFATR_CROPGRF(), tools::Polygon::Scale(), and Size::Width().
Referenced by RtfAttributeOutput::FlyFrameGraphic(), DocxSdrExport::startDMLAnchorInline(), and SwEscherEx::WriteFlyFrameAttr().
SwCharFormat * sw::util::GetCharStyle | ( | SwDoc & | rDoc, |
const OUString & | rName | ||
) |
Get a Character Style which fits a given name.
Its surprisingly tricky to get a style when all you have is a name, but that's what this does
rDoc | The SwDoc document to search in |
rName | The name of the style to search for |
Definition at line 459 of file writerhelper.cxx.
References ChrFmt, SwDoc::FindCharFormatByName(), IDocumentStylePoolAccess::GetCharFormatFromPool(), SwDoc::getIDocumentStylePoolAccess(), SwStyleNameMapper::GetPoolIdFromUIName(), n, and SAL_MAX_UINT16.
Referenced by myImplHelpers::MapperImpl< SwCharFormat >::GetStyle().
ww8::Frames sw::util::GetFrames | ( | const SwDoc & | rDoc, |
SwPaM const * | pPaM | ||
) |
Get the Floating elements in a SwDoc.
Writer's FrameFormats may or may not be anchored to some text content, e.g. Page Anchored elements will not be. For the winword export we need them to have something to be anchored to. So this method returns all the floating elements in a document as a STL container of ww8::Frames which are guaranteed to have an appropriate anchor.
rDoc | The SwDoc document to get the styles from |
pPaM | The SwPam to describe the selection in the document to get the elements from. 0 means the entire document. |
Definition at line 483 of file writerhelper.cxx.
References SwDoc::GetAllFlyFormats().
Referenced by MSWordExportBase::ExportDocument().
ww8::Frames sw::util::GetFramesInNode | ( | const ww8::Frames & | rFrames, |
const SwNode & | rNode | ||
) |
Get the Frames anchored to a given node.
Given a container of frames, find the ones anchored to a given node
rFrames | The container of frames to search in |
rNode | The SwNode to check for anchors to |
Definition at line 506 of file writerhelper.cxx.
Referenced by SwWW8AttrIter::SwWW8AttrIter().
const SwNumRule * sw::util::GetNormalNumRuleFromTextNode | ( | const SwTextNode & | rTextNode | ) |
Definition at line 554 of file writerhelper.cxx.
References SwTextNode::GetNumRule(), SwTextNode::IsCountedInList(), and SwTextNode::IsNumbered().
Referenced by GetNumRuleFromTextNode().
SwNoTextNode * sw::util::GetNoTextNodeFromSwFrameFormat | ( | const SwFrameFormat & | rFormat | ) |
Get the SwNoTextNode associated with a SwFrameFormat if here is one.
There are two differing types of numbering formats that may be on a paragraph, normal and outline. The outline is that numbering you see in tools->outline numbering. There's no difference in the numbering itself, just how you get it from the SwTextNode. Needless to say the filter generally couldn't care less what type of numbering is in use.
rFormat | The SwFrameFormat that may describe a graphic |
Definition at line 568 of file writerhelper.cxx.
References SwFormat::GetContent(), SwFormatContent::GetContentIdx(), SwNodeIndex::GetNode(), and SwNode::GetNoTextNode().
Referenced by RtfAttributeOutput::FlyFrameGraphic(), SwWW8ImplReader::MapWrapIntoFlyFormat(), DocxSdrExport::startDMLAnchorInline(), SwEscherEx::WriteFlyFrameAttr(), and SwBasicEscherEx::WriteGrfFlyFrame().
const SwNumFormat * sw::util::GetNumFormatFromSwNumRuleLevel | ( | const SwNumRule & | rRule, |
int | nLevel | ||
) |
Get the Numbering Format for a given level from a numbering rule.
rRule | The numbering rule |
nLevel | The numbering level |
Definition at line 514 of file writerhelper.cxx.
References SwNumRule::Get(), and MAXLEVEL.
Referenced by SwWW8FltControlStack::GetNumFormatFromStack(), and GetNumFormatFromTextNode().
const SwNumFormat * sw::util::GetNumFormatFromTextNode | ( | const SwTextNode & | rTextNode | ) |
Get the Numbering Format used on a paragraph.
There are two differing types of numbering formats that may be on a paragraph, normal and outline. The outline is that numbering you see in tools->outline numbering. There's no difference in the numbering itself, just how you get it from the SwTextNode. Needless to say the filter generally couldn't care less what type of numbering is in use.
rTextNode | The SwTextNode that is the paragraph |
Definition at line 525 of file writerhelper.cxx.
References SwTextNode::GetActualListLevel(), SwNode::GetDoc(), GetNumFormatFromSwNumRuleLevel(), SwTextNode::GetNumRule(), SwDoc::GetOutlineNumRule(), SwTextNode::IsCountedInList(), and SwTextNode::IsNumbered().
Referenced by SwWW8ImplReader::Read_LR(), and SwWW8FltControlStack::SetAttrInDoc().
const SwNumRule * sw::util::GetNumRuleFromTextNode | ( | const SwTextNode & | rTextNode | ) |
Definition at line 549 of file writerhelper.cxx.
References GetNormalNumRuleFromTextNode().
Referenced by SwWW8ImplReader::AppendTextNode().
SwTextFormatColl * sw::util::GetParaStyle | ( | SwDoc & | rDoc, |
const OUString & | rName | ||
) |
Get a Paragraph Style which fits a given name.
Its surprisingly tricky to get a style when all you have is a name, but that's what this does
rDoc | The SwDoc document to search in |
rName | The name of the style to search for |
Definition at line 444 of file writerhelper.cxx.
References SwDoc::FindTextFormatCollByName(), SwDoc::getIDocumentStylePoolAccess(), SwStyleNameMapper::GetPoolIdFromUIName(), IDocumentStylePoolAccess::GetTextCollFromPool(), n, SAL_MAX_UINT16, and TxtColl.
Referenced by myImplHelpers::MapperImpl< SwTextFormatColl >::GetStyle().
ww8::ParaStyles sw::util::GetParaStyles | ( | const SwDoc & | rDoc | ) |
Get the Paragraph Styles of a SwDoc.
Writer's styles are in one of those dreaded macro based pre-STL containers. Give me an STL container of the paragraph styles instead.
rDoc | The SwDoc document to get the styles from |
Definition at line 431 of file writerhelper.cxx.
References SwDoc::GetTextFormatColls(), nCount, and SwVectorModifyBase< Value >::size().
Referenced by SwWW8ImplReader::SetOutlineStyles().
void sw::util::GetPoolItems | ( | const SfxItemSet & | rSet, |
ww8::PoolItems & | rItems, | ||
bool | bExportParentItemSet | ||
) |
Get the SfxPoolItems of a SfxItemSet.
Writer's SfxPoolItems (attributes) are in one of those dreaded macro based pre-STL containers. Give me an STL container of the items instead.
rSet | The SfxItemSet to get the items from |
rItems | The sw::PoolItems to put the items into |
Definition at line 380 of file writerhelper.cxx.
References SfxItemSet::Count(), SfxItemIter::GetCurItem(), SfxItemSet::GetItemState(), SfxItemSet::GetWhichByPos(), SfxItemIter::NextItem(), rSet, SfxItemSet::TotalCount(), and SfxPoolItem::Which().
Referenced by MSWordExportBase::ExportPoolItemsToCHP(), SwWW8AttrIter::OutAttr(), and MSWordExportBase::OutputItemSet().
CharRuns sw::util::GetPseudoCharRuns | ( | const SwTextNode & | rTextNd | ) |
Collect the ranges of Text which share.
Word generally requires characters which share the same direction, the same script, and occasionally (depending on the format) the same charset to be exported in independent chunks.
So this function finds these ranges and returns a STL container of CharRuns
rTextNd | The TextNode we want to ranges from |
Definition at line 531 of file writerwordglue.cxx.
References g_pBreakIt, SwTextNode::GetAttr(), SwBreakIt::GetBreakIter(), SwNode::GetDoc(), GetExtendedTextEncoding(), SwTextNode::GetText(), SwDoc::GetTextDirection(), GetWhichOfScript(), nCount, nPos, and RES_CHRATR_FONT().
const SwCharFormat * sw::util::GetSwCharFormat | ( | const SwFormatINetFormat & | rINet, |
SwDoc & | rDoc | ||
) |
Definition at line 1732 of file ww8atr.cxx.
References SwDoc::FindCharFormatByName(), IDocumentStylePoolAccess::GetCharFormatFromPool(), SwDoc::getIDocumentStylePoolAccess(), SwFormatINetFormat::GetINetFormat(), SwFormatINetFormat::GetINetFormatId(), SwFormatINetFormat::GetValue(), IsPoolUserFormat(), and nId.
Referenced by MSWordExportBase::ExportPoolItemsToCHP(), and WW8AttributeOutput::TextINetFormat().
const T * sw::util::HasItem | ( | const ww8::PoolItems & | rItems, |
sal_uInt16 | eType | ||
) |
Definition at line 323 of file writerhelper.hxx.
References eType, and SearchPoolItems().
Referenced by AttributeOutputBase::CharBackgroundBase(), RtfAttributeOutput::FormatBox(), IMPL_LINK(), and SwTextFrame::IsEmptyWithSplitFly().
bool sw::util::HasPageBreak | ( | const SwNode & | rNode | ) |
Does a node have a "page break before" applied.
Both text nodes and tables in writer can have "page break before" This function gives a unified view to both entities
rNode | The SwNode to query the page break of |
Definition at line 578 of file writerhelper.cxx.
References SvxFormatBreakItem::GetBreak(), SwNode::GetContentNode(), SwFormat::GetFormatAttr(), SwTable::GetFrameFormat(), SwTableNode::GetTable(), SwNode::GetTableNode(), SwNode::IsTableNode(), and RES_BREAK().
Referenced by wwSectionManager::InsertSegments().
bool sw::util::IsPlausableSingleWordSection | ( | const SwFrameFormat & | rTitleFormat, |
const SwFrameFormat & | rFollowFormat | ||
) |
See if two page formats can be expressed as a single word section.
Word doesn't have the idea of page descriptors and follow styles like writer does, the only thing it has is a section with a different title page. The only difference of the title page from the rest of the section is different headers/footers, everything else is the same.
So this function compares two writer page fmts and sees if the follow frame and the title frame are the same from word perspective except for the content of their headers.
Definition at line 376 of file writerwordglue.cxx.
References SwFormat::GetAttrSet(), SwFormat::GetCol(), SwFormatCol::GetColumns(), SwFormat::GetFrameSize(), lcl_getWordLRSpace(), and sw::util::HdFtDistanceGlue::StrictEqualTopBottom().
Referenced by MSWordExportBase::NeedSectionBreak(), MSWordExportBase::OutputSectionBreaks(), MSWordExportBase::SectionProperties(), and MSWordExportBase::SetCurrentPageDescFromNode().
const T & sw::util::item_cast | ( | const SfxPoolItem & | rItem | ) |
Provide a dynamic_cast style cast for SfxPoolItems.
A SfxPoolItem generally need to be cast back to its original type to be useful, which is both tedious and error prone. So item_cast is a helper template to aid the process and test if the cast is correct.
rItem | The SfxPoolItem which is to be casted |
@tplparam T A SfxPoolItem derived class to cast rItem to
std::bad_cast | Thrown if the rItem was not a T |
Definition at line 223 of file writerhelper.hxx.
const T * sw::util::item_cast | ( | const SfxPoolItem * | pItem | ) |
Provide a dynamic_cast style cast for SfxPoolItems.
A SfxPoolItem generally need to be cast back to its original type to be useful, which is both tedious and error prone. So item_cast is a helper template to aid the process and test if the cast is correct.
pItem | The SfxPoolItem which is to be casted |
@tplparam T A SfxPoolItem derived class to cast pItem to
Definition at line 244 of file writerhelper.hxx.
Clips a value to MAX/MIN 16bit value to make it safe for use as a position value to give to writer.
i.e. +-57.8cm. Sometimes we see ridiculous values for positioning in rtf and word document, this captures such ones and clips them to values which are still outside the document, but of a value that doesn't cause problems for writer's layout, e.g. see https://bz.apache.org/ooo/show_bug.cgi?id=i9245
nIn |
Definition at line 332 of file writerhelper.cxx.
Referenced by SwWW8ImplReader::MatchSdrItemsIntoFlySet(), and SwWW8ImplReader::ProcessEscherAlign().
void sw::util::MoveAttrFieldmarkInserted | ( | SwFltPosition & | rMkPos, |
SwFltPosition & | rPtPos, | ||
const SwPosition & | rPos | ||
) |
Definition at line 751 of file writerhelper.cxx.
References SwPosition::GetContentIndex(), SwNodeIndex::GetIndex(), SwPosition::GetNodeIndex(), SwPosition::GetNodes(), SwFltPosition::m_nContent, SwFltPosition::m_nNode, and SAL_WARN_IF.
Referenced by sw::util::RedlineStack::MoveAttrsFieldmarkInserted().
tools::Polygon sw::util::PolygonFromPolyPolygon | ( | const tools::PolyPolygon & | rPolyPoly | ) |
Make a best fit Polygon from a PolyPolygon.
For custom contours in writer we use a PolyPolygon, while word uses a simple polygon, so we need to try and make the best polygon from a PolyPolygon
rPolyPoly | The tools::PolyPolygon to try and turn into a Polygon |
Definition at line 595 of file writerhelper.cxx.
References a, tools::PolyPolygon::Count(), and tools::Polygon::GetSize().
Referenced by CorrectWordWrapPolygonForExport().
const SfxPoolItem * sw::util::SearchPoolItems | ( | const ww8::PoolItems & | rItems, |
sal_uInt16 | eType | ||
) |
Definition at line 407 of file writerhelper.cxx.
References eType.
Referenced by MSWordExportBase::ExportPoolItemsToCHP(), and HasItem().
void sw::util::SortByAssignedOutlineStyleListLevel | ( | ww8::ParaStyles & | rStyles | ) |
Sort sequence of Paragraph Styles by assigned outline style list level.
Sort ParaStyles in ascending order of assigned outline style list level, e.g. given Normal/Heading1/Heading2/.../Heading10 at their default assigned outline style list levels of body level/level 1/level 2/.../level 10
#i98791# adjust the sorting algorithm due to introduced outline level attribute
rStyles | The ParaStyles to sort |
Definition at line 474 of file writerhelper.cxx.
Referenced by SwWW8ImplReader::SetOutlineStyles().
void sw::util::UpdateFramePositions | ( | ww8::Frames & | rFrames | ) |
fix up frame positions, must be called after SetRedlineFlags
Definition at line 490 of file writerhelper.cxx.
References SwFormatAnchor::GetAnchorId(), and SwFormatAnchor::GetContentAnchor().
Referenced by MSWordExportBase::ExportDocument().