fdo#64826: fix for exporting to DOCX that didnt save track 'changes state'
Change-Id: If5b3198769a08cc751d542f8305fd7f41c73ec26 Reviewed-on: https://gerrit.libreoffice.org/3991 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
This commit is contained in:
@@ -686,18 +686,33 @@ void DocxExport::WriteSettings()
|
|||||||
// Zoom
|
// Zoom
|
||||||
OString aZoom(OString::valueOf(sal_Int32(pViewShell->GetViewOptions()->GetZoom())));
|
OString aZoom(OString::valueOf(sal_Int32(pViewShell->GetViewOptions()->GetZoom())));
|
||||||
pFS->singleElementNS(XML_w, XML_zoom, FSNS(XML_w, XML_percent), aZoom.getStr(), FSEND);
|
pFS->singleElementNS(XML_w, XML_zoom, FSNS(XML_w, XML_percent), aZoom.getStr(), FSEND);
|
||||||
|
|
||||||
|
// Track Changes
|
||||||
|
if ( settings.trackRevisions )
|
||||||
|
pFS->singleElementNS( XML_w, XML_trackRevisions, FSEND );
|
||||||
|
|
||||||
|
// Embed Fonts
|
||||||
if( pDoc->get( IDocumentSettingAccess::EMBED_FONTS ))
|
if( pDoc->get( IDocumentSettingAccess::EMBED_FONTS ))
|
||||||
pFS->singleElementNS( XML_w, XML_embedTrueTypeFonts, FSEND );
|
pFS->singleElementNS( XML_w, XML_embedTrueTypeFonts, FSEND );
|
||||||
|
|
||||||
|
// Embed System Fonts
|
||||||
if( pDoc->get( IDocumentSettingAccess::EMBED_SYSTEM_FONTS ))
|
if( pDoc->get( IDocumentSettingAccess::EMBED_SYSTEM_FONTS ))
|
||||||
pFS->singleElementNS( XML_w, XML_embedSystemFonts, FSEND );
|
pFS->singleElementNS( XML_w, XML_embedSystemFonts, FSEND );
|
||||||
|
|
||||||
|
// Default Tab Stop
|
||||||
if( settings.defaultTabStop != 0 )
|
if( settings.defaultTabStop != 0 )
|
||||||
pFS->singleElementNS( XML_w, XML_defaultTabStop, FSNS( XML_w, XML_val ),
|
pFS->singleElementNS( XML_w, XML_defaultTabStop, FSNS( XML_w, XML_val ),
|
||||||
OString::valueOf( sal_Int32( settings.defaultTabStop )).getStr(), FSEND );
|
OString::valueOf( sal_Int32( settings.defaultTabStop )).getStr(), FSEND );
|
||||||
|
|
||||||
|
// Even and Odd Headers
|
||||||
if( settings.evenAndOddHeaders )
|
if( settings.evenAndOddHeaders )
|
||||||
pFS->singleElementNS( XML_w, XML_evenAndOddHeaders, FSEND );
|
pFS->singleElementNS( XML_w, XML_evenAndOddHeaders, FSEND );
|
||||||
|
|
||||||
|
// Has Footnotes
|
||||||
if( m_pAttrOutput->HasFootnotes())
|
if( m_pAttrOutput->HasFootnotes())
|
||||||
m_pAttrOutput->WriteFootnoteEndnotePr( pFS, XML_footnotePr, pDoc->GetFtnInfo(), XML_footnote );
|
m_pAttrOutput->WriteFootnoteEndnotePr( pFS, XML_footnotePr, pDoc->GetFtnInfo(), XML_footnote );
|
||||||
|
|
||||||
|
// Has Endnotes
|
||||||
if( m_pAttrOutput->HasEndnotes())
|
if( m_pAttrOutput->HasEndnotes())
|
||||||
m_pAttrOutput->WriteFootnoteEndnotePr( pFS, XML_endnotePr, pDoc->GetEndNoteInfo(), XML_endnote );
|
m_pAttrOutput->WriteFootnoteEndnotePr( pFS, XML_endnotePr, pDoc->GetEndNoteInfo(), XML_endnote );
|
||||||
|
|
||||||
@@ -809,6 +824,9 @@ DocxExport::DocxExport( DocxExportFilter *pFilter, SwDoc *pDocument, SwPaM *pCur
|
|||||||
m_nFooters( 0 ),
|
m_nFooters( 0 ),
|
||||||
m_pVMLExport( NULL )
|
m_pVMLExport( NULL )
|
||||||
{
|
{
|
||||||
|
// Set the 'Track Revisions' flag in the settings structure
|
||||||
|
settings.trackRevisions = 0 != ( nsRedlineMode_t::REDLINE_ON & mnRedlineMode );
|
||||||
|
|
||||||
// Write the document properies
|
// Write the document properies
|
||||||
WriteProperties( );
|
WriteProperties( );
|
||||||
|
|
||||||
@@ -840,6 +858,7 @@ DocxExport::~DocxExport()
|
|||||||
DocxSettingsData::DocxSettingsData()
|
DocxSettingsData::DocxSettingsData()
|
||||||
: evenAndOddHeaders( false )
|
: evenAndOddHeaders( false )
|
||||||
, defaultTabStop( 0 )
|
, defaultTabStop( 0 )
|
||||||
|
, trackRevisions( false )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -849,6 +868,9 @@ bool DocxSettingsData::hasData() const
|
|||||||
return true;
|
return true;
|
||||||
if( defaultTabStop != 0 )
|
if( defaultTabStop != 0 )
|
||||||
return true;
|
return true;
|
||||||
|
if ( trackRevisions )
|
||||||
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -54,6 +54,7 @@ struct DocxSettingsData
|
|||||||
bool hasData() const; /// returns true if there are any non-default settings (i.e. something to write)
|
bool hasData() const; /// returns true if there are any non-default settings (i.e. something to write)
|
||||||
bool evenAndOddHeaders;
|
bool evenAndOddHeaders;
|
||||||
int defaultTabStop;
|
int defaultTabStop;
|
||||||
|
bool trackRevisions; // Should 'Track Revisions' be set
|
||||||
};
|
};
|
||||||
|
|
||||||
/// The class that does all the actual DOCX export-related work.
|
/// The class that does all the actual DOCX export-related work.
|
||||||
|
Reference in New Issue
Block a user