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

Miklos Vajna vmiklos at suse.cz
Fri Mar 8 10:06:13 PST 2013


 sw/source/core/table/swtable.cxx |    5 +----
 sw/source/core/txtnode/ndtxt.cxx |    2 +-
 2 files changed, 2 insertions(+), 5 deletions(-)

New commits:
commit 332fa1344aaaf8ff190c594fe5829cf1551c5211
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Fri Mar 8 18:11:16 2013 +0100

    SwTableBox::IsValidNumTxtNd: Allow trivial formatting
    
    Not allowing flys or footnotes during string -> number conversion is
    fine, but I don't see what's the reason for rejecting simple formatting
    (like bold) completely.
    
    Change-Id: I8f54aebeb6ea35d099a88570d3f7d365c7325dc0

diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index b54531a..0b54d93 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -2518,7 +2518,6 @@ sal_uLong SwTableBox::IsValidNumTxtNd( sal_Bool bCheckAttr ) const
             if( bCheckAttr )
             {
                 const SwpHints* pHts = pTextNode->GetpSwpHints();
-                const String& rTxt = pTextNode->GetTxt();
                 // do some tests if there's only text in the node!
                 // Flys/fields/...
                 if( pHts )
@@ -2527,9 +2526,7 @@ sal_uLong SwTableBox::IsValidNumTxtNd( sal_Bool bCheckAttr ) const
                     for( sal_uInt16 n = 0; n < pHts->Count(); ++n )
                     {
                         const SwTxtAttr* pAttr = (*pHts)[ n ];
-                        if( RES_TXTATR_NOEND_BEGIN <= pAttr->Which() ||
-                            *pAttr->GetStart() ||
-                            *pAttr->GetAnyEnd() < rTxt.Len() )
+                        if( RES_TXTATR_NOEND_BEGIN <= pAttr->Which() )
                         {
                             if ((*pAttr->GetStart() == nNextSetField) &&
                                 (pAttr->Which() == RES_TXTATR_FIELD))
commit 73422d433bde55a107e4cfebc72a099cbd9b5933
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Fri Mar 8 18:51:53 2013 +0100

    SwTxtNode::GetRedlineTxt: fix string conversion
    
    As I understand it, String allowed the length parameter to be longer
    than the remaining string, in which case it simply returned the
    substring till the end of the string. In case of OUString, "!!br0ken!!"
    is returned instead, so make sure the length is never longer then the
    remaining string.
    
    Change-Id: I69499d74f1d9ba8ed6d9ba1a18d10b45ce319bf5

diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 0070f9e..6421edd 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -3308,7 +3308,7 @@ XubString SwTxtNode::GetRedlineTxt( xub_StrLen nIdx, xub_StrLen nLen,
         }
     }
 
-    XubString aTxt(GetTxt().copy(nIdx, nLen));
+    XubString aTxt(nLen > GetTxt().getLength() ? GetTxt().copy(nIdx) : GetTxt().copy(nIdx, nLen));
 
     xub_StrLen nTxtStt = nIdx, nIdxEnd = nIdx + aTxt.Len();
     for( sal_uInt16 n = 0; n < aRedlArr.size(); n += 2 )


More information about the Libreoffice-commits mailing list