[Libreoffice-commits] core.git: writerfilter/source

Miklos Vajna vmiklos at suse.cz
Fri Jun 7 08:13:12 PDT 2013


 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   20 ++++++++++----------
 writerfilter/source/rtftok/rtfdocumentimpl.hxx |    2 +-
 2 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit 288a606ae780c9f0b7a0241b31ea644addd37fd8
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Fri Jun 7 17:09:26 2013 +0200

    RTFDocumentImpl::checkUnicode: make this a bit more readable
    
    by not using default parameter values.
    
    Change-Id: I82c84e3563cba60682d297eb1b1d8a139160d579

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 921f30e..345912d 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -320,7 +320,7 @@ bool RTFDocumentImpl::isSubstream() const
 
 void RTFDocumentImpl::finishSubstream()
 {
-    checkUnicode();
+    checkUnicode(/*bUnicode =*/ true, /*bHex =*/ true);
     // At the end of a footnote stream, we need to emit a run break when importing from Word.
     // We can't do so unconditionally, as Writer already writes a \par at the end of the footnote.
     if (m_bNeedCr)
@@ -881,7 +881,7 @@ int RTFDocumentImpl::resolveChars(char ch)
     }
 
     if (m_aStates.top().nInternalState != INTERNAL_HEX)
-        checkUnicode(false, true);
+        checkUnicode(/*bUnicode =*/ false, /*bHex =*/ true);
 
     OStringBuffer aBuf;
 
@@ -895,7 +895,7 @@ int RTFDocumentImpl::resolveChars(char ch)
             {
                 if (!bUnicodeChecked)
                 {
-                    checkUnicode(true, false);
+                    checkUnicode(/*bUnicode =*/ true, /*bHex =*/ false);
                     bUnicodeChecked = true;
                 }
                 aBuf.append(ch);
@@ -1214,7 +1214,7 @@ void RTFDocumentImpl::replayBuffer(RTFBuffer_t& rBuffer)
 
 int RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword)
 {
-    checkUnicode();
+    checkUnicode(/*bUnicode =*/ true, /*bHex =*/ true);
     setNeedSect();
     RTFSkipDestination aSkip(*this);
     switch (nKeyword)
@@ -1690,7 +1690,7 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword)
 int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
 {
     if (nKeyword != RTF_HEXCHAR)
-        checkUnicode();
+        checkUnicode(/*bUnicode =*/ true, /*bHex =*/ true);
     setNeedSect();
     RTFSkipDestination aSkip(*this);
 
@@ -1968,7 +1968,7 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
 
 int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
 {
-    checkUnicode();
+    checkUnicode(/*bUnicode =*/ true, /*bHex =*/ true);
     setNeedSect();
     RTFSkipDestination aSkip(*this);
     int nParam = -1;
@@ -2677,7 +2677,7 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
 
 int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
 {
-    checkUnicode(nKeyword != RTF_U, true);
+    checkUnicode(/*bUnicode =*/ nKeyword != RTF_U, /*bHex =*/ true);
     setNeedSect();
     RTFSkipDestination aSkip(*this);
     int nSprm = 0;
@@ -3579,7 +3579,7 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
 
 int RTFDocumentImpl::dispatchToggle(RTFKeyword nKeyword, bool bParam, int nParam)
 {
-    checkUnicode();
+    checkUnicode(/*bUnicode =*/ true, /*bHex =*/ true);
     setNeedSect();
     RTFSkipDestination aSkip(*this);
     int nSprm = -1;
@@ -3680,7 +3680,7 @@ int RTFDocumentImpl::pushState()
 {
     //SAL_INFO("writerfilter", OSL_THIS_FUNC << " before push: " << m_pTokenizer->getGroup());
 
-    checkUnicode();
+    checkUnicode(/*bUnicode =*/ true, /*bHex =*/ true);
     m_nGroupStartPos = Strm().Tell();
 
     if (m_aStates.empty())
@@ -3779,7 +3779,7 @@ int RTFDocumentImpl::popState()
     //SAL_INFO("writerfilter", OSL_THIS_FUNC << " before pop: m_pTokenizer->getGroup() " << m_pTokenizer->getGroup() <<
     //                         ", dest state: " << m_aStates.top().nDestinationState);
 
-    checkUnicode();
+    checkUnicode(/*bUnicode =*/ true, /*bHex =*/ true);
     RTFParserState aState(m_aStates.top());
     m_bWasInFrame = aState.aFrame.inFrame();
 
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index 76752d7..0ba51b6 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -490,7 +490,7 @@ namespace writerfilter {
                 void sectBreak(bool bFinal);
                 void replayBuffer(RTFBuffer_t& rBuffer);
                 /// If we have some unicode or hex characters to send.
-                void checkUnicode(bool bUnicode = true, bool bHex = true);
+                void checkUnicode(bool bUnicode, bool bHex);
                 /// If we need a final section break at the end of the document.
                 void setNeedSect(bool bNeedSect = true);
 


More information about the Libreoffice-commits mailing list