[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

Michael Stahl mstahl at redhat.com
Tue Jan 14 15:16:22 PST 2014


 sw/inc/tox.hxx             |   12 ------------
 sw/source/core/tox/tox.cxx |    7 ++++++-
 2 files changed, 6 insertions(+), 13 deletions(-)

New commits:
commit 827b48e74ff52dde46adfc8cc4750e510a92e357
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Jan 15 00:08:44 2014 +0100

    SwFormTokenToString is unused since 2004
    
    Change-Id: I18aaf40b1ac0e4bd070a55d2169b5320336f78fc

diff --git a/sw/inc/tox.hxx b/sw/inc/tox.hxx
index d8bab6e..4a60fc3 100644
--- a/sw/inc/tox.hxx
+++ b/sw/inc/tox.hxx
@@ -248,18 +248,6 @@ struct SwFormTokenEqualToFormTokenType
     }
 };
 
-/**
-   Functor that appends the string representation of a given token to a string.
-
-   @param _rText    string to append the string representation to
-   @param rToken    token whose string representation is appended
-*/
-struct SwFormTokenToString
-{
-    OUString & rText;
-    SwFormTokenToString(OUString & _rText) : rText(_rText) {}
-    void operator()(const SwFormToken & rToken) { rText += rToken.GetString(); }
-};
 
 /// Vector of tokens.
 typedef std::vector<SwFormToken> SwFormTokens;
commit c87f146a0cec31f080386d646bfb786ed6200280
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Jan 14 23:58:11 2014 +0100

    fdo#73162: sw: un-break index entries that contain text separators
    
    SwFormTokensHelper::SearchNextToken() does some check that the ">" token
    terminator is not inside a pair of TOX_STYLE_DELIMITER; this check was
    broken by commit f4fd558ac9d61fe06aa0f56d829916ef9e5ee7b9 and finds a
    ">" outside of TOX_STYLE_DELIMITER bracketing.
    
    Change-Id: Ia8587d496999c561f57fd6f107ed8b9d1e3838d4

diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx
index 9dab768..8592046 100644
--- a/sw/source/core/tox/tox.cxx
+++ b/sw/source/core/tox/tox.cxx
@@ -830,8 +830,12 @@ OUString SwFormTokensHelper::SearchNextToken( const OUString & sPattern,
     }
     else
     {
+        // apparently the TOX_STYLE_DELIMITER act as a bracketing for
+        // TOKEN_TEXT tokens so that the user can have '>' inside the text...
         const sal_Int32 nTextSeparatorFirst = sPattern.indexOf( TOX_STYLE_DELIMITER, nStt );
-        if( nTextSeparatorFirst>=0 && nTextSeparatorFirst+1<sPattern.getLength())
+        if (    nTextSeparatorFirst >= 0
+            &&  nTextSeparatorFirst + 1 < sPattern.getLength()
+            &&  nTextSeparatorFirst < nEnd)
         {
             const sal_Int32 nTextSeparatorSecond = sPattern.indexOf( TOX_STYLE_DELIMITER,
                                                                      nTextSeparatorFirst + 1 );
@@ -839,6 +843,7 @@ OUString SwFormTokensHelper::SearchNextToken( const OUString & sPattern,
             if( nEnd < nTextSeparatorSecond )
                 nEnd = sPattern.indexOf( '>', nTextSeparatorSecond );
             // FIXME: No check to verify that nEnd is still >=0?
+            assert(nEnd >= 0);
         }
 
         ++nEnd;


More information about the Libreoffice-commits mailing list