summaryrefslogtreecommitdiff
path: root/src/xmlcomposer.cpp
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2005-06-07 23:19:51 +0000
committerStef Walter <stef@memberwebs.com>2005-06-07 23:19:51 +0000
commit651b7adf13ebc575b4685254c675cc7d35b7fbed (patch)
treeb0f635a5d8b78a78fa8b1d0f6fa7c246b5578ecb /src/xmlcomposer.cpp
parent56f7f66eb13eefb3ea86e9280e321751d8df2761 (diff)
Add 'align' attribute to <para> tag for paragraph alignment.
Diffstat (limited to 'src/xmlcomposer.cpp')
-rw-r--r--src/xmlcomposer.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/xmlcomposer.cpp b/src/xmlcomposer.cpp
index aa7485f..2f0a5ee 100644
--- a/src/xmlcomposer.cpp
+++ b/src/xmlcomposer.cpp
@@ -382,6 +382,19 @@ void XmlComposer::BaseAnalyser::applyParaFormatting(RtfFormatting* format,
else
el.removeAttribute(kElStyle);
+ switch(format->paraAlign())
+ {
+ case RtfFormatting::CENTER:
+ el.setAttribute(kAtAlign, kValCenter);
+ break;
+ case RtfFormatting::RIGHT:
+ el.setAttribute(kAtAlign, kValRight);
+ break;
+ case RtfFormatting::JUSTIFY:
+ el.setAttribute(kAtAlign, kValJustify);
+ break;
+ };
+
// These fix elements are later picked up in XmlFixups::fixBlocks
el.setAttribute(kAtFix, fix);
}
@@ -452,6 +465,22 @@ bool XmlComposer::BaseAnalyser::processTextContent(const string& cw, int flags,
else if(cw == "s" && HAS_PARAM)
format.paraSetStyle(param);
+ // Left para alignment
+ else if(cw == "ql")
+ format.paraSetAlign(RtfFormatting::LEFT);
+
+ // Center para alignment
+ else if(cw == "qc")
+ format.paraSetAlign(RtfFormatting::CENTER);
+
+ // Right para alignment
+ else if(cw == "qr")
+ format.paraSetAlign(RtfFormatting::RIGHT);
+
+ // Justify para alignment
+ else if(cw == "qj")
+ format.paraSetAlign(RtfFormatting::JUSTIFY);
+
// A line break
else if(cw == "line")
el = m_composer->createElement(kElLine);