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


Hi,

This patch resolve issue 36931.

Thanks for pushing.

-- 
Arnaud Versini
From 19eed4c7532feeb55db7eece3f9cd6d7fee932cb Mon Sep 17 00:00:00 2001
From: Arnaud Versini <arnaud.versini@gmail.com>
Date: Sun, 8 May 2011 15:14:57 +0200
Subject: [PATCH] Resolving fdo#36931 : Load non blank chars from XML and check it's value.

---
 sw/source/core/doc/doc.cxx       |    2 +-
 sw/source/filter/xml/xmlmeta.cxx |    4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index e5d8fd0..6bd08fd 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -1947,7 +1947,7 @@ void SwDoc::ResetModified()
     mbModified = sal_False;
     // If there is already a document statistic, we assume that
     // it is correct. In this case we reset the modified flag.
-    if ( 0 != pDocStat->nChar )
+    if ( 0 != pDocStat->nCharExcludingSpaces )
         pDocStat->bModified = sal_False;
     GetIDocumentUndoRedo().SetUndoNoModifiedPosition();
     if( nCall && aOle2Link.IsSet() )
diff --git a/sw/source/filter/xml/xmlmeta.cxx b/sw/source/filter/xml/xmlmeta.cxx
index 6b046a9..ca9e473 100644
--- a/sw/source/filter/xml/xmlmeta.cxx
+++ b/sw/source/filter/xml/xmlmeta.cxx
@@ -94,6 +94,7 @@ enum SvXMLTokenMapAttrs
     XML_TOK_META_STAT_PARA = 16,
     XML_TOK_META_STAT_WORD = 32,
     XML_TOK_META_STAT_CHAR = 64,
+    XML_TOK_META_STAT_NON_WHITE_SPACE_CHAR = 128,
     XML_TOK_META_STAT_END=XML_TOK_UNKNOWN
 };
 
@@ -112,6 +113,7 @@ static const struct statistic s_stats [] = {
     { XML_TOK_META_STAT_PARA,  "ParagraphCount", 0, &SwDocStat::nPara },
     { XML_TOK_META_STAT_WORD,  "WordCount",      0, &SwDocStat::nWord },
     { XML_TOK_META_STAT_CHAR,  "CharacterCount", 0, &SwDocStat::nChar },
+    { XML_TOK_META_STAT_NON_WHITE_SPACE_CHAR,  "NonWhitespaceCharacterCount", 0, 
&SwDocStat::nCharExcludingSpaces },
     { XML_TOK_META_STAT_END,   0,                0, 0                 }
 };
 
@@ -149,7 +151,7 @@ void SwXMLImport::SetStatistics(
         }
     }
 
-    if( 127 == nTokens )
+    if( 255 == nTokens )
         aDocStat.bModified = sal_False;
     if( nTokens )
         pDoc->SetDocStat( aDocStat );
-- 
1.7.4.1


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.