Kaydet (Commit) 8acb6155 authored tarafından Miklos Vajna's avatar Miklos Vajna

clean up RtfExport::WriteInfo()

The \vern output was never parsed, and Word uses the generator field, so
let us do the same. And with the standard generator string, if we ever
need to parse it, we already have a parser for it in the ODF filter.

Change-Id: I57f25a6414b2b753a23cf82b691e364d84e4bb44
üst b40ca093
......@@ -1204,6 +1204,7 @@
#define LO_STRING_SVTOOLS_RTF_LISTPICTURE "\\listpicture"
#define LO_STRING_SVTOOLS_RTF_LEVELPICTURE "\\levelpicture"
#define LO_STRING_SVTOOLS_RTF_BRDRSH "\\brdrsh"
#define LO_STRING_SVTOOLS_RTF_GENERATOR "\\generator"
#endif // INCLUDED_SVTOOLS_RTFKEYWD_HXX
......
......@@ -57,6 +57,7 @@
#include <svtools/rtfkeywd.hxx>
#include <filter/msfilter/rtfutil.hxx>
#include <unotools/configmgr.hxx>
#include <unotools/docinfohelper.hxx>
#include <vcl/svapp.hxx>
#if OSL_DEBUG_LEVEL > 1
......@@ -425,6 +426,8 @@ void RtfExport::WriteMainText()
void RtfExport::WriteInfo()
{
OString aGenerator = OUStringToOString(utl::DocInfoHelper::GetGeneratorString(), RTL_TEXTENCODING_UTF8);
Strm().WriteCharPtr("{" OOO_STRING_SVTOOLS_RTF_IGNORE LO_STRING_SVTOOLS_RTF_GENERATOR " ").WriteCharPtr(aGenerator.getStr()).WriteChar('}');
Strm().WriteChar('{').WriteCharPtr(OOO_STRING_SVTOOLS_RTF_INFO);
SwDocShell* pDocShell(pDoc->GetDocShell());
......@@ -453,18 +456,6 @@ void RtfExport::WriteInfo()
OutDateTime(OOO_STRING_SVTOOLS_RTF_PRINTIM, xDocProps->getPrintDate());
}
Strm().WriteChar('{').WriteCharPtr(OOO_STRING_SVTOOLS_RTF_COMMENT).WriteCharPtr(" ");
Strm().WriteCharPtr(OUStringToOString(utl::ConfigManager::getProductName(), eCurrentEncoding).getStr()).WriteCharPtr("}{").WriteCharPtr(OOO_STRING_SVTOOLS_RTF_VERN);
// The convention that we follow is that the version number
// should be a non-negative 32-bit int
#if LIBO_VERSION_MAJOR > 127
#error Major version number must be less than 128
#elif LIBO_VERSION_MINOR > 255 || LIBO_VERSION_MICRO > 255 || LIBO_VERSION_PATCH > 255
#error Minor, micro and patchlevel version numbers must be less than 256
#endif
Strm().WriteNumber((sal_Int32) LIBO_VERSION_ENCODED_IN_32BITS).WriteChar('}');
Strm().WriteChar('}');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment