From 651b7adf13ebc575b4685254c675cc7d35b7fbed Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Tue, 7 Jun 2005 23:19:51 +0000 Subject: Add 'align' attribute to tag for paragraph alignment. --- src/xmlcomposer.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/xmlcomposer.cpp') 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); -- cgit v1.2.3