Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


On Tue, Aug 23, 2011 at 04:41:59PM +0100, Caolán McNamara <caolanm@redhat.com> wrote:
d) I'm not sure there's any good reason to set the DocStat in the
(current) rtf filter.

You mean something like this? Given that the idl says these properties
are readonly (I did not notice that so far), I don't think there is a
reason to set them.

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 0fef1e8..4d91514 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2416,34 +2416,7 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
         case RTF_NOFWORDS:
         case RTF_NOFCHARS:
         case RTF_NOFCHARSWS:
-            if (m_xDocumentProperties.is())
-            {
-                uno::Sequence<beans::NamedValue> aSet = 
m_xDocumentProperties->getDocumentStatistics();
-                OUString aName;
-                switch (nKeyword)
-                {
-                    case RTF_NOFPAGES: aName = OUString(RTL_CONSTASCII_USTRINGPARAM("PageCount")); 
break;
-                    case RTF_NOFWORDS: aName = OUString(RTL_CONSTASCII_USTRINGPARAM("WordCount")); 
break;
-                    case RTF_NOFCHARS: aName = 
OUString(RTL_CONSTASCII_USTRINGPARAM("CharacterCount")); break;
-                    case RTF_NOFCHARSWS: aName = 
OUString(RTL_CONSTASCII_USTRINGPARAM("NonWhitespaceCharacterCount")); break;
-                    default: break;
-                }
-                if (aName.getLength())
-                {
-                    bool bFound = false;
-                    int nLen = aSet.getLength();
-                    for (int i = 0; i < nLen; ++i)
-                        if (aSet[i].Name.equals(aName))
-                            aSet[i].Value = uno::makeAny(sal_Int32(nParam));
-                    if (!bFound)
-                    {
-                        aSet.realloc(nLen + 1);
-                        aSet[nLen].Name = aName;
-                        aSet[nLen].Value = uno::makeAny(sal_Int32(nParam));
-                    }
-                    m_xDocumentProperties->setDocumentStatistics(aSet);
-                }
-            }
+            // Ignore document statistics, Writer will calculate them.
             break;
         case RTF_VERSION:
             if (m_xDocumentProperties.is())

Attachment: pgp0wDSeX7mps.pgp
Description: PGP signature


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.