[Libreoffice-commits] .: Branch 'libreoffice-3-4' - sw/source

Fridrich Strba fridrich at kemper.freedesktop.org
Mon May 9 05:59:45 PDT 2011


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

New commits:
commit 444dcc3ea5cb7a51165aa564c26390feda047346
Author: Arnaud Versini <arnaud.versini at gmail.com>
Date:   Sun May 8 15:14:57 2011 +0200

    Resolving fdo#36931 : Load non blank chars from XML and check it's value.
    
    Signed-off-by: Fridrich Å trba <fridrich.strba at bluewin.ch>

diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 95abe91..edcbb2d 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 );


More information about the Libreoffice-commits mailing list