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

Tsutomu Uchino hanya at apache.org
Mon Jan 19 04:37:12 PST 2015


 offapi/com/sun/star/util/XProtectable.idl |    8 ++++++++
 sw/source/core/doc/docredln.cxx           |   26 ++++++++++++++++++++++----
 2 files changed, 30 insertions(+), 4 deletions(-)

New commits:
commit b698b9362b1a4ab58e0307a20f65dea796087344
Author: Tsutomu Uchino <hanya at apache.org>
Date:   Fri Jan 16 17:02:52 2015 +0000

    Related: #i34459# add description about IllegalArgumentException...
    
    thrown by unprotect method and about some arguments
    
    (cherry picked from commit abaff3a9330500a7394767081bfb52788028ff0c)
    
    Change-Id: I3ee203279647a506e6cb860387aac3e4379c9c75

diff --git a/offapi/com/sun/star/util/XProtectable.idl b/offapi/com/sun/star/util/XProtectable.idl
index 06eaa62..62e8b12 100644
--- a/offapi/com/sun/star/util/XProtectable.idl
+++ b/offapi/com/sun/star/util/XProtectable.idl
@@ -33,10 +33,18 @@ module com {  module sun {  module star {  module util {
 published interface XProtectable: com::sun::star::uno::XInterface
 {
     /** activates the protection.
+
+        @param aPassword
+            a string to specify new password.
      */
     void protect( [in] string aPassword );
 
     /** removes the protection.
+
+        @param aPassword
+            a string to match with the current password.
+        @throws com::sun::star::lang::IllegalArgumentException
+            if invalid password is specified.
      */
     void unprotect( [in] string aPassword )
             raises( com::sun::star::lang::IllegalArgumentException );
commit 36e158ce7a0effb130936ba4598a193102faa6a1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jan 19 12:09:17 2015 +0000

    if we change the keys we have to resort based on the new keys
    
    Change-Id: Ied95c2d1490554d9ba5402c936a9720c8a325771

diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 960a15d..b2f1eea 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -1336,6 +1336,8 @@ void SwRangeRedline::MoveFromSection()
         SwDoc* pDoc = GetDoc();
         const SwRedlineTbl& rTbl = pDoc->getIDocumentRedlineAccess().GetRedlineTbl();
         std::vector<SwPosition*> aBeforeArr, aBehindArr;
+        typedef std::map<sal_uInt16, SwRangeRedline*> IndexAndRange;
+        IndexAndRange aIndexAndRangeMap;
         sal_uInt16 nMyPos = rTbl.GetPos( this );
         OSL_ENSURE( this, "this is not in the array?" );
         bool bBreak = false;
@@ -1346,12 +1348,16 @@ void SwRangeRedline::MoveFromSection()
             bBreak = true;
             if( rTbl[ n ]->GetBound(true) == *GetPoint() )
             {
-                aBehindArr.push_back( &rTbl[ n ]->GetBound(true) );
+                SwRangeRedline* pRedl = rTbl[n];
+                aBehindArr.push_back(&pRedl->GetBound(true));
+                aIndexAndRangeMap.insert(std::make_pair(n, pRedl));
                 bBreak = false;
             }
             if( rTbl[ n ]->GetBound(false) == *GetPoint() )
             {
-                aBehindArr.push_back( &rTbl[ n ]->GetBound(false) );
+                SwRangeRedline* pRedl = rTbl[n];
+                aBehindArr.push_back(&pRedl->GetBound(false));
+                aIndexAndRangeMap.insert(std::make_pair(n, pRedl));
                 bBreak = false;
             }
         }
@@ -1361,12 +1367,16 @@ void SwRangeRedline::MoveFromSection()
             bBreak = true;
             if( rTbl[ n ]->GetBound(true) == *GetPoint() )
             {
-                aBeforeArr.push_back( &rTbl[ n ]->GetBound(true) );
+                SwRangeRedline* pRedl = rTbl[n];
+                aBeforeArr.push_back(&pRedl->GetBound(true));
+                aIndexAndRangeMap.insert(std::make_pair(n, pRedl));
                 bBreak = false;
             }
             if( rTbl[ n ]->GetBound(false) == *GetPoint() )
             {
-                aBeforeArr.push_back( &rTbl[ n ]->GetBound(false) );
+                SwRangeRedline* pRedl = rTbl[n];
+                aBeforeArr.push_back(&pRedl->GetBound(false));
+                aIndexAndRangeMap.insert(std::make_pair(n, pRedl));
                 bBreak = false;
             }
         }
@@ -1420,6 +1430,7 @@ void SwRangeRedline::MoveFromSection()
             if( pColl && pCNd )
                 pCNd->ChgFmtColl( pColl );
         }
+
         // #i95771#
         // Under certain conditions the previous <SwDoc::Move(..)> has already
         // removed the change tracking section of this <SwRangeRedline> instance from
@@ -1440,6 +1451,13 @@ void SwRangeRedline::MoveFromSection()
             *aBeforeArr[ n ] = *Start();
         for( n = 0; n < aBehindArr.size(); ++n )
             *aBehindArr[ n ] = *End();
+        SwRedlineTbl& rResortTbl = const_cast<SwRedlineTbl&>(rTbl);
+        for (auto& a : aIndexAndRangeMap)
+        {
+            // re-insert
+            rResortTbl.Remove(a.first);
+            rResortTbl.Insert(a.second);
+        }
     }
     else
         InvalidateRange();


More information about the Libreoffice-commits mailing list