summaryrefslogtreecommitdiff
path: root/src/xmlcomposer.cpp
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2005-06-08 00:33:16 +0000
committerStef Walter <stef@memberwebs.com>2005-06-08 00:33:16 +0000
commit1d1ffe40fdd0bea28d10230a09d5478d95a68128 (patch)
treef9bbed6cb9dda3844962cd08e4fe58e313fc15c1 /src/xmlcomposer.cpp
parent519fae2932fd293b6a3368749a87c3c34698a277 (diff)
Add 'indent' attriute to <para> tags for paragraph indent.
Diffstat (limited to 'src/xmlcomposer.cpp')
-rw-r--r--src/xmlcomposer.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/xmlcomposer.cpp b/src/xmlcomposer.cpp
index c081764..f10ce0c 100644
--- a/src/xmlcomposer.cpp
+++ b/src/xmlcomposer.cpp
@@ -384,6 +384,7 @@ void XmlComposer::BaseAnalyser::applyParaFormatting(RtfFormatting* format,
if(DO_EXTRAS())
{
+ // Paragraph alignment
switch(format->paraAlign())
{
case RtfFormatting::CENTER:
@@ -396,6 +397,10 @@ void XmlComposer::BaseAnalyser::applyParaFormatting(RtfFormatting* format,
el.setAttribute(kAtAlign, kValJustify);
break;
};
+
+ // Paragraph left indent
+ if(format->paraIndent() != 0)
+ el.setAttribute(kAtIndent, formatInt(format->paraIndent()));
}
// These fix elements are later picked up in XmlFixups::fixBlocks
@@ -484,6 +489,10 @@ bool XmlComposer::BaseAnalyser::processTextContent(const string& cw, int flags,
else if(cw == "qj")
format.paraSetAlign(RtfFormatting::JUSTIFY);
+ // Paragraph indent
+ else if(cw == "li")
+ format.paraSetIndent(param / 20); // Convert from twips to points
+
// A line break
else if(cw == "line")
el = m_composer->createElement(kElLine);