summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2011-08-10 12:57:11 +0200
committerLuboš Luňák <l.lunak@suse.cz>2011-08-11 16:02:49 +0200
commita36f220339b116f45247e4d232c4b8b826857630 (patch)
tree1dbdf3d2d368753e3c2f4a0a48a8a18f1cf95214 /sw
parent0ed9ed793d232d9ccf92f770b4ae6c373186c2b1 (diff)
finish implementation of writing of comments to .docx
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx6
-rw-r--r--sw/source/filter/ww8/docxexport.cxx52
-rw-r--r--sw/source/filter/ww8/docxexport.hxx2
3 files changed, 58 insertions, 2 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 89cbd7c5bd6c..da091ee7ed7d 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -3329,9 +3329,11 @@ void DocxAttributeOutput::WritePostitFields()
++i )
{
OString idstr = OString::valueOf( sal_Int32( i ));
-// TODO const SwPostItField* f = m_postitFields[ i ];
+ const SwPostItField* f = m_postitFields[ i ];
m_pSerializer->startElementNS( XML_w, XML_comment, FSNS( XML_w, XML_id ), idstr.getStr(),
- /*TODO*/ FSEND );
+ FSNS( XML_w, XML_author ), rtl::OUStringToOString( f->GetPar1(), RTL_TEXTENCODING_UTF8 ).getStr(),
+ FSNS( XML_w, XML_date ), impl_DateTimeToOString(f->GetDateTime()).getStr(), FSEND );
+ GetExport().WriteOutliner( *f->GetTextObject(), TXT_ATN );
m_pSerializer->endElementNS( XML_w, XML_comment );
}
}
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index 9920350d66cd..bec163ae6f4a 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -54,6 +54,9 @@
#include <section.hxx>
#include <ftninfo.hxx>
+#include <editeng/editobj.hxx>
+#include <editeng/outlobj.hxx>
+
#include <docary.hxx>
#include <numrule.hxx>
#include <charfmt.hxx>
@@ -745,6 +748,55 @@ bool DocxExport::ignoreAttributeForStyles( sal_uInt16 nWhich ) const
return MSWordExportBase::ignoreAttributeForStyles( nWhich );
}
+void DocxExport::WriteOutliner(const OutlinerParaObject& rParaObj, sal_uInt8 nTyp)
+{
+ const EditTextObject& rEditObj = rParaObj.GetTextObject();
+ MSWord_SdrAttrIter aAttrIter( *this, rEditObj, nTyp );
+
+ sal_uInt16 nPara = rEditObj.GetParagraphCount();
+ for( sal_uInt16 n = 0; n < nPara; ++n )
+ {
+ if( n )
+ aAttrIter.NextPara( n );
+
+ AttrOutput().StartParagraph( ww8::WW8TableNodeInfo::Pointer_t());
+ rtl_TextEncoding eChrSet = aAttrIter.GetNodeCharSet();
+ String aStr( rEditObj.GetText( n ));
+ xub_StrLen nAktPos = 0;
+ xub_StrLen nEnd = aStr.Len();
+ do {
+ AttrOutput().StartRun( NULL );
+ xub_StrLen nNextAttr = aAttrIter.WhereNext();
+ rtl_TextEncoding eNextChrSet = aAttrIter.GetNextCharSet();
+
+ if( nNextAttr > nEnd )
+ nNextAttr = nEnd;
+
+ bool bTxtAtr = aAttrIter.IsTxtAttr( nAktPos );
+ if( !bTxtAtr )
+ {
+ if( nAktPos == 0 && nNextAttr - nAktPos == aStr.Len())
+ AttrOutput().RunText( aStr, eChrSet );
+ else
+ {
+ String tmp( aStr.Copy( nAktPos, nNextAttr - nAktPos ));
+ AttrOutput().RunText( tmp, eChrSet );
+ }
+ }
+ AttrOutput().StartRunProperties();
+ aAttrIter.OutAttr( nAktPos );
+ AttrOutput().EndRunProperties( NULL );
+
+ nAktPos = nNextAttr;
+ eChrSet = eNextChrSet;
+ aAttrIter.NextPos();
+ AttrOutput().EndRun();
+ } while( nAktPos < nEnd );
+// aAttrIter.OutParaAttr(false);
+ AttrOutput().EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t());
+ }
+}
+
DocxExport::DocxExport( DocxExportFilter *pFilter, SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM *pOriginalPam )
: MSWordExportBase( pDocument, pCurrentPam, pOriginalPam ),
m_pFilter( pFilter ),
diff --git a/sw/source/filter/ww8/docxexport.hxx b/sw/source/filter/ww8/docxexport.hxx
index faed1e0cf7e9..3eaec51f5417 100644
--- a/sw/source/filter/ww8/docxexport.hxx
+++ b/sw/source/filter/ww8/docxexport.hxx
@@ -152,6 +152,8 @@ public:
/// Returns the relationd id
rtl::OString OutputChart( com::sun::star::uno::Reference< com::sun::star::frame::XModel >& xModel, sal_Int32 nCount );
+ void WriteOutliner(const OutlinerParaObject& rOutliner, sal_uInt8 nTyp);
+
protected:
/// Format-dependant part of the actual export.
virtual void ExportDocument_Impl();