diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2013-03-20 19:06:12 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2013-03-28 18:01:00 +0100 |
commit | 2716dc0d4231f83fc2e1f3939bdce49c7b171e6c (patch) | |
tree | 10cd11d0ef33e980672a22f9deab3123e450cf32 /sw | |
parent | 16b446937e026ff5edd097e99b8d9be6ba314562 (diff) |
export placeholder (RES_JUMPEDITFLD) to .docx (part of bnc#779630)
Change-Id: Idbf2b1e04eebab703ba3e6c3fac8e50829833c70
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/attributeoutputbase.hxx | 1 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 32 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.hxx | 3 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfattributeoutput.cxx | 5 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfattributeoutput.hxx | 1 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8atr.cxx | 10 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8attributeoutput.hxx | 1 |
7 files changed, 52 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx b/sw/source/filter/ww8/attributeoutputbase.hxx index a0091627b6cd..62b80c71b5cd 100644 --- a/sw/source/filter/ww8/attributeoutputbase.hxx +++ b/sw/source/filter/ww8/attributeoutputbase.hxx @@ -568,6 +568,7 @@ protected: virtual void SetField( const SwField& rFld, ww::eField eType, const String& rCmd ) = 0; virtual void PostitField( const SwField* pFld ) = 0; virtual bool DropdownField( const SwField* pFld ) = 0; + virtual bool PlaceholderField( const SwField* pFld ) = 0; virtual bool AnalyzeURL( const String& rUrl, const String& rTarget, String* pLinkURL, String* pMark ); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index bbe5231d4a4c..be4f9ed8c8f6 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -622,6 +622,7 @@ void DocxAttributeOutput::EndRun() m_pSerializer->endElementNS( XML_w, XML_r ); WritePostponedMath(); + WritePendingPlaceholder(); if ( m_closeHyperlinkInThisRun ) { @@ -3781,6 +3782,36 @@ bool DocxAttributeOutput::DropdownField( const SwField* pFld ) return bExpand; } +bool DocxAttributeOutput::PlaceholderField( const SwField* pFld ) +{ + assert( pendingPlaceholder == NULL ); + pendingPlaceholder = pFld; + return false; // do not expand +} + +void DocxAttributeOutput::WritePendingPlaceholder() +{ + if( pendingPlaceholder == NULL ) + return; + const SwField* pFld = pendingPlaceholder; + pendingPlaceholder = NULL; + m_pSerializer->startElementNS( XML_w, XML_sdt, FSEND ); + m_pSerializer->startElementNS( XML_w, XML_sdtPr, FSEND ); + if( !pFld->GetPar2().isEmpty()) + m_pSerializer->singleElementNS( XML_w, XML_alias, + FSNS( XML_w, XML_val ), OUStringToOString( pFld->GetPar2(), RTL_TEXTENCODING_UTF8 ), FSEND ); + m_pSerializer->singleElementNS( XML_w, XML_temporary, FSEND ); + m_pSerializer->singleElementNS( XML_w, XML_showingPlcHdr, FSEND ); + m_pSerializer->singleElementNS( XML_w, XML_text, FSEND ); + m_pSerializer->endElementNS( XML_w, XML_sdtPr ); + m_pSerializer->startElementNS( XML_w, XML_sdtContent, FSEND ); + m_pSerializer->startElementNS( XML_w, XML_r, FSEND ); + RunText( pFld->GetPar1()); + m_pSerializer->endElementNS( XML_w, XML_r ); + m_pSerializer->endElementNS( XML_w, XML_sdtContent ); + m_pSerializer->endElementNS( XML_w, XML_sdt ); +} + void DocxAttributeOutput::SetField( const SwField& rFld, ww::eField eType, const String& rCmd ) { // field bookmarks are handled in the EndRun method @@ -4834,6 +4865,7 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri m_startedHyperlink( false ), m_postponedGraphic( NULL ), m_postponedMath( NULL ), + pendingPlaceholder( NULL ), m_postitFieldsMaxId( 0 ), m_anchorId( 0 ), m_nextFontId( 1 ), diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx index 94edd1b36786..8689d53bd407 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -326,6 +326,7 @@ private: void FinishTableRowCell( ww8::WW8TableNodeInfoInner::Pointer_t pInner, bool bForceEmptyParagraph = false ); void WriteFFData( const FieldInfos& rInfos ); + void WritePendingPlaceholder(); void EmbedFontStyle( const OUString& name, int tag, FontFamily family, FontItalic italic, FontWeight weight, FontPitch pitch, rtl_TextEncoding encoding ); @@ -532,6 +533,7 @@ protected: virtual void SetField( const SwField& rFld, ww::eField eType, const String& rCmd ); virtual void PostitField( const SwField* pFld ); virtual bool DropdownField( const SwField* pFld ); + virtual bool PlaceholderField( const SwField* pFld ); virtual bool AnalyzeURL( const String& rURL, const String& rTarget, String* pLinkURL, String* pMark ); @@ -627,6 +629,7 @@ private: }; std::list< PostponedGraphic >* m_postponedGraphic; const SwOLENode* m_postponedMath; + const SwField* pendingPlaceholder; std::vector< const SwPostItField* > m_postitFields; unsigned int m_postitFieldsMaxId; int m_anchorId; diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 6d9320ee995b..47ad371d8d0a 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -3074,6 +3074,11 @@ bool RtfAttributeOutput::DropdownField( const SwField* /*pFld*/ ) return true; } +bool RtfAttributeOutput::PlaceholderField( const SwField* ) +{ + return true; // expand to text? +} + RtfAttributeOutput::RtfAttributeOutput( RtfExport &rExport ) : m_rExport( rExport ), m_bStrikeDouble( false ), diff --git a/sw/source/filter/ww8/rtfattributeoutput.hxx b/sw/source/filter/ww8/rtfattributeoutput.hxx index 83fb58c399a7..fb40139341f4 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.hxx +++ b/sw/source/filter/ww8/rtfattributeoutput.hxx @@ -407,6 +407,7 @@ protected: virtual void SetField( const SwField& rFld, ww::eField eType, const String& rCmd ); virtual void PostitField( const SwField* pFld ); virtual bool DropdownField( const SwField* pFld ); + virtual bool PlaceholderField( const SwField* pFld ); /// Reference to the export, where to get the data from RtfExport &m_rExport; diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 4f9161fd7685..fe01be8b9267 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -2473,6 +2473,11 @@ bool WW8AttributeOutput::DropdownField( const SwField* pFld ) return bExpand; } +bool WW8AttributeOutput::PlaceholderField( const SwField* ) +{ + return true; // expand to text? +} + void WW8AttributeOutput::RefField( const SwField &rFld, const String &rRef) { String sStr( FieldString( ww::eREF ) ); @@ -2922,7 +2927,7 @@ void AttributeOutputBase::TextField( const SwFmtFld& rField ) } } break; - case RES_HIDDENTXTFLD: + case RES_HIDDENTXTFLD: { String sExpand(pFld->GetPar2()); if (sExpand.Len()) @@ -2931,6 +2936,9 @@ void AttributeOutputBase::TextField( const SwFmtFld& rField ) } } break; + case RES_JUMPEDITFLD: + bWriteExpand = PlaceholderField( pFld ); + break; default: bWriteExpand = true; break; diff --git a/sw/source/filter/ww8/ww8attributeoutput.hxx b/sw/source/filter/ww8/ww8attributeoutput.hxx index 1ebceed377ff..4c64635c62db 100644 --- a/sw/source/filter/ww8/ww8attributeoutput.hxx +++ b/sw/source/filter/ww8/ww8attributeoutput.hxx @@ -391,6 +391,7 @@ protected: virtual void SetField( const SwField& rFld, ww::eField eType, const String& rCmd ); virtual void PostitField( const SwField* pFld ); virtual bool DropdownField( const SwField* pFld ); + virtual bool PlaceholderField( const SwField* pFld ); virtual bool AnalyzeURL( const String& rURL, const String& rTarget, String* pLinkURL, String* pMark ); |