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

Caolán McNamara caolanm at redhat.com
Thu Jan 16 07:18:56 PST 2014


 sd/uiconfig/simpress/ui/optimpressgeneralpage.ui |  110 +++++++++++------------
 sw/source/core/doc/docbm.cxx                     |  103 +++++++++++++--------
 2 files changed, 118 insertions(+), 95 deletions(-)

New commits:
commit 5eaa0135c3ffc46ce601ea4cbaaa17eabe44e6ee
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jan 16 15:16:40 2014 +0000

    place some elements side by side to regain a line
    
    Change-Id: I9b838b6c00bc6e456adcf5d63c9936c08bf0d1aa

diff --git a/sd/uiconfig/simpress/ui/optimpressgeneralpage.ui b/sd/uiconfig/simpress/ui/optimpressgeneralpage.ui
index 750c9f9..595f8f0 100644
--- a/sd/uiconfig/simpress/ui/optimpressgeneralpage.ui
+++ b/sd/uiconfig/simpress/ui/optimpressgeneralpage.ui
@@ -183,60 +183,8 @@
                   </object>
                   <packing>
                     <property name="left_attach">0</property>
-                    <property name="top_attach">1</property>
-                    <property name="width">2</property>
-                    <property name="height">1</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkCheckButton" id="objalwymov">
-                    <property name="label" translatable="yes">Objects always moveable</property>
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">False</property>
-                    <property name="use_underline">True</property>
-                    <property name="xalign">0</property>
-                    <property name="draw_indicator">True</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">0</property>
-                    <property name="top_attach">2</property>
-                    <property name="width">2</property>
-                    <property name="height">1</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkCheckButton" id="backgroundback">
-                    <property name="label" translatable="yes">Use background cache</property>
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">False</property>
-                    <property name="use_underline">True</property>
-                    <property name="xalign">0</property>
-                    <property name="draw_indicator">True</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">0</property>
                     <property name="top_attach">0</property>
-                    <property name="width">2</property>
-                    <property name="height">1</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkCheckButton" id="distrotcb">
-                    <property name="label" translatable="yes">Do not distort objects in curve</property>
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="receives_default">False</property>
-                    <property name="double_buffered">False</property>
-                    <property name="use_underline">True</property>
-                    <property name="xalign">0</property>
-                    <property name="draw_indicator">True</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">0</property>
-                    <property name="top_attach">3</property>
-                    <property name="width">2</property>
+                    <property name="width">1</property>
                     <property name="height">1</property>
                   </packing>
                 </child>
@@ -277,7 +225,7 @@
                   </object>
                   <packing>
                     <property name="left_attach">0</property>
-                    <property name="top_attach">4</property>
+                    <property name="top_attach">2</property>
                     <property name="width">1</property>
                     <property name="height">1</property>
                   </packing>
@@ -324,7 +272,59 @@
                   </object>
                   <packing>
                     <property name="left_attach">1</property>
-                    <property name="top_attach">4</property>
+                    <property name="top_attach">2</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkCheckButton" id="objalwymov">
+                    <property name="label" translatable="yes">Objects always moveable</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="use_underline">True</property>
+                    <property name="xalign">0</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="top_attach">0</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkCheckButton" id="distrotcb">
+                    <property name="label" translatable="yes">Do not distort objects in curve</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="double_buffered">False</property>
+                    <property name="use_underline">True</property>
+                    <property name="xalign">0</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="top_attach">1</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkCheckButton" id="backgroundback">
+                    <property name="label" translatable="yes">Use background cache</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="use_underline">True</property>
+                    <property name="xalign">0</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">1</property>
                     <property name="width">1</property>
                     <property name="height">1</property>
                   </packing>
commit 4b6b51182a9a600805729313278eb707c6ebfb14
Author: Oliver-Rainer Wittmann <orw at apache.org>
Date:   Thu Jan 16 11:47:18 2014 +0000

    Resolves: #i124030# do not delete UNO mark which are not expanded...
    
    and only touch the start of the given range.
    
    (cherry picked from commit ae295f7d009842cdceb50c4daffe948ede2b4b88)
    
    Conflicts:
    	sw/source/core/doc/docbm.cxx
    
    Change-Id: Id7317eeb8e9c063c9d8b30bca97ed0afee3ec8c5

diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index dac5379a..97b3298 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -50,7 +50,6 @@
 #include <edimp.hxx>
 #include <stdio.h>
 
-using namespace ::std;
 using namespace ::boost;
 using namespace ::sw::mark;
 
@@ -58,12 +57,19 @@ namespace
 {
     static bool lcl_GreaterThan( const SwPosition& rPos, const SwNodeIndex& rNdIdx, const SwIndex* pIdx )
     {
-        return pIdx ? ( rPos.nNode > rNdIdx || ( rPos.nNode == rNdIdx && rPos.nContent >= pIdx->GetIndex() )) : rPos.nNode >= rNdIdx;
+        return pIdx != NULL
+               ? ( rPos.nNode > rNdIdx
+                   || ( rPos.nNode == rNdIdx
+                        && rPos.nContent >= pIdx->GetIndex() ) )
+               : rPos.nNode >= rNdIdx;
     }
 
     static bool lcl_Lower( const SwPosition& rPos, const SwNodeIndex& rNdIdx, const SwIndex* pIdx )
     {
-        return rPos.nNode < rNdIdx || ( pIdx && rPos.nNode == rNdIdx && rPos.nContent < pIdx->GetIndex() );
+        return rPos.nNode < rNdIdx
+               || ( pIdx != NULL
+                    && rPos.nNode == rNdIdx
+                    && rPos.nContent < pIdx->GetIndex() );
     }
 
     static bool lcl_MarkOrderingByStart(const IDocumentMarkAccess::pMark_t& rpFirst,
@@ -91,9 +97,9 @@ namespace
     }
 
     SAL_WNODEPRECATED_DECLARATIONS_PUSH
-    static inline auto_ptr<SwPosition> lcl_PositionFromCntntNode(SwCntntNode * const pCntntNode, const bool bAtEnd=false)
+    static inline ::std::auto_ptr<SwPosition> lcl_PositionFromCntntNode(SwCntntNode * const pCntntNode, const bool bAtEnd=false)
     {
-        auto_ptr<SwPosition> pResult(new SwPosition(*pCntntNode));
+        ::std::auto_ptr<SwPosition> pResult(new SwPosition(*pCntntNode));
         pResult->nContent.Assign(pCntntNode, bAtEnd ? pCntntNode->Len() : 0);
         return pResult;
     }
@@ -104,7 +110,7 @@ namespace
     // else set it to the end of the node before rStt
     // else set it to the CntntNode of the Pos outside the Range
     SAL_WNODEPRECATED_DECLARATIONS_PUSH
-    static inline auto_ptr<SwPosition> lcl_FindExpelPosition(const SwNodeIndex& rStt,
+    static inline ::std::auto_ptr<SwPosition> lcl_FindExpelPosition(const SwNodeIndex& rStt,
         const SwNodeIndex& rEnd,
         const SwPosition& rOtherPosition)
     {
@@ -118,7 +124,7 @@ namespace
             pNode = rStt.GetNodes().GoPrevious(&aStt), bAtEnd = true;
         if(pNode)
             return lcl_PositionFromCntntNode(pNode, bAtEnd);
-        return auto_ptr<SwPosition>(new SwPosition(rOtherPosition));
+        return ::std::auto_ptr<SwPosition>(new SwPosition(rOtherPosition));
     }
     SAL_WNODEPRECATED_DECLARATIONS_POP
 
@@ -149,7 +155,7 @@ namespace
             rMarks.begin(),
             pCandidatesEnd,
             back_inserter(vCandidates),
-            boost::bind(logical_not<bool>(), boost::bind(&IMark::EndsBefore, _1, rPos)));
+            boost::bind( ::std::logical_not<bool>(), boost::bind( &IMark::EndsBefore, _1, rPos ) ) );
         // no candidate left => we are in front of the first mark or there are none
         if(!vCandidates.size()) return NULL;
         // return the highest (last) candidate using mark end ordering
@@ -626,8 +632,8 @@ namespace sw { namespace mark
             const SwIndex* pSttIdx,
             const SwIndex* pEndIdx )
     {
-        vector<const_iterator_t> vMarksToDelete;
-        bool isSortingNeeded = false;
+        ::std::vector<const_iterator_t> vMarksToDelete;
+        bool bIsSortingNeeded = false;
 
         // copy all bookmarks in the move area to a vector storing all position data as offset
         // reassignment is performed after the move
@@ -642,61 +648,77 @@ namespace sw { namespace mark
 
             ::sw::mark::MarkBase* pMark = dynamic_cast< ::sw::mark::MarkBase* >(ppMark->get());
             // on position ??
-            bool isPosInRange = (lcl_GreaterThan(pMark->GetMarkPos(), rStt, pSttIdx) &&
-                lcl_Lower(pMark->GetMarkPos(), rEnd, pEndIdx));
-            bool isOtherPosInRange = (pMark->IsExpanded() &&
-                lcl_GreaterThan(pMark->GetOtherMarkPos(), rStt, pSttIdx) &&
-                lcl_Lower(pMark->GetOtherMarkPos(), rEnd, pEndIdx));
+            bool bIsPosInRange = lcl_GreaterThan(pMark->GetMarkPos(), rStt, pSttIdx)
+                                 && lcl_Lower(pMark->GetMarkPos(), rEnd, pEndIdx);
+            bool bIsOtherPosInRange = pMark->IsExpanded()
+                                      && lcl_GreaterThan(pMark->GetOtherMarkPos(), rStt, pSttIdx)
+                                      && lcl_Lower(pMark->GetOtherMarkPos(), rEnd, pEndIdx);
             // special case: completely in range, touching the end?
             if ( pEndIdx != NULL
-                 && ( ( isOtherPosInRange
+                 && ( ( bIsOtherPosInRange
                         && pMark->GetMarkPos().nNode == rEnd
                         && pMark->GetMarkPos().nContent == *pEndIdx )
-                      || ( isPosInRange
+                      || ( bIsPosInRange
                            && pMark->IsExpanded()
                            && pMark->GetOtherMarkPos().nNode == rEnd
                            && pMark->GetOtherMarkPos().nContent == *pEndIdx ) ) )
             {
-                isPosInRange = true, isOtherPosInRange = true;
+                bIsPosInRange = true, bIsOtherPosInRange = true;
             }
 
-            if(isPosInRange && (isOtherPosInRange || !pMark->IsExpanded()))
+            if ( bIsPosInRange
+                 && ( bIsOtherPosInRange
+                      || !pMark->IsExpanded() ) )
             {
                 // completely in range
 
-                // #i92125#
-                bool bKeepCrossRefBkmk( false );
+                bool bDeleteMark = true;
                 {
-                    if ( rStt == rEnd &&
-                         ( IDocumentMarkAccess::GetType(*pMark) ==
-                            IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK ||
-                           IDocumentMarkAccess::GetType(*pMark) ==
-                            IDocumentMarkAccess::CROSSREF_NUMITEM_BOOKMARK ) )
+                    switch ( IDocumentMarkAccess::GetType( *pMark ) )
                     {
-                        bKeepCrossRefBkmk = true;
+                    case IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK:
+                    case IDocumentMarkAccess::CROSSREF_NUMITEM_BOOKMARK:
+                        // no delete of cross-reference bookmarks, if range is inside one paragraph
+                        bDeleteMark = rStt != rEnd;
+                        break;
+                    case IDocumentMarkAccess::UNO_BOOKMARK:
+                        // no delete of UNO mark, if it is not expanded and only touches the start of the range
+                        bDeleteMark = bIsOtherPosInRange
+                                      || pMark->IsExpanded()
+                                      || pSttIdx == NULL
+                                      || !( pMark->GetMarkPos().nNode == rStt
+                                            && pMark->GetMarkPos().nContent == *pSttIdx );
+                        break;
+                    default:
+                        bDeleteMark = true;
+                        break;
                     }
                 }
-                if ( !bKeepCrossRefBkmk )
+
+                if ( bDeleteMark )
                 {
-                    if(pSaveBkmk)
-                        pSaveBkmk->push_back(SaveBookmark(true, true, *pMark, rStt, pSttIdx));
+                    if ( pSaveBkmk )
+                    {
+                        pSaveBkmk->push_back( SaveBookmark( true, true, *pMark, rStt, pSttIdx ) );
+                    }
                     vMarksToDelete.push_back(ppMark);
                 }
             }
-            else if ( isPosInRange ^ isOtherPosInRange )
+            else if ( bIsPosInRange ^ bIsOtherPosInRange )
             {
                 // the bookmark is partitially in the range
                 // move position of that is in the range out of it
+
                 SAL_WNODEPRECATED_DECLARATIONS_PUSH
-                auto_ptr< SwPosition > pNewPos;
+                ::std::auto_ptr< SwPosition > pNewPos;
                 {
                     if ( pEndIdx != NULL )
                     {
-                        pNewPos = auto_ptr< SwPosition >( new SwPosition( rEnd, *pEndIdx ) );
+                        pNewPos = ::std::auto_ptr< SwPosition >( new SwPosition( rEnd, *pEndIdx ) );
                     }
                     else
                     {
-                        pNewPos = lcl_FindExpelPosition( rStt, rEnd, isPosInRange ? pMark->GetOtherMarkPos() : pMark->GetMarkPos() );
+                        pNewPos = lcl_FindExpelPosition( rStt, rEnd, bIsPosInRange ? pMark->GetOtherMarkPos() : pMark->GetMarkPos() );
                     }
                 }
 
@@ -721,13 +743,13 @@ namespace sw { namespace mark
                 SAL_WNODEPRECATED_DECLARATIONS_POP
                 if ( bMoveMark )
                 {
-                    if ( isPosInRange )
+                    if ( bIsPosInRange )
                         pMark->SetMarkPos(*pNewPos);
                     else
                         pMark->SetOtherMarkPos(*pNewPos);
 
                     // illegal selection? collapse the mark and restore sorting later
-                    isSortingNeeded |= lcl_FixCorrectedMark( isPosInRange, isOtherPosInRange, pMark );
+                    bIsSortingNeeded |= lcl_FixCorrectedMark( bIsPosInRange, bIsOtherPosInRange, pMark );
                 }
             }
         }
@@ -736,13 +758,13 @@ namespace sw { namespace mark
             // fdo#61016 delay the deletion of the fieldmark characters
             // to prevent that from deleting the marks on that position
             // which would invalidate the iterators in vMarksToDelete
-            vector< ::boost::shared_ptr<ILazyDeleter> > vDelay;
+            std::vector< ::boost::shared_ptr<ILazyDeleter> > vDelay;
             vDelay.reserve(vMarksToDelete.size());
             // we just remembered the iterators to delete, so we do not need to
             // search for the boost::shared_ptr<> (the entry in m_vAllMarks) again.
             // reverse iteration, since erasing an entry invalidates iterators
             // behind it (the iterators in vMarksToDelete are sorted)
-            for (vector<const_iterator_t>::reverse_iterator pppMark
+            for (std::vector<const_iterator_t>::reverse_iterator pppMark
                     = vMarksToDelete.rbegin();
                 pppMark != vMarksToDelete.rend();
                 ++pppMark)
@@ -750,7 +772,7 @@ namespace sw { namespace mark
                 vDelay.push_back(deleteMark(*pppMark));
             }
         } // scope to kill vDelay
-        if(isSortingNeeded)
+        if(bIsSortingNeeded)
             sortMarks();
 #if 0
         OSL_TRACE("deleteMarks");
@@ -871,7 +893,7 @@ namespace sw { namespace mark
             find_if(
                 pMarkLow,
                 pMarkHigh,
-                boost::bind(equal_to<const IMark*>(), boost::bind(&boost::shared_ptr<IMark>::get, _1), pMark));
+                boost::bind( ::std::equal_to<const IMark*>(), boost::bind(&boost::shared_ptr<IMark>::get, _1), pMark ) );
         if(pMarkFound != pMarkHigh)
             deleteMark(pMarkFound);
     }
@@ -1301,6 +1323,7 @@ void SaveBookmark::SetInDoc(
     }
 }
 
+
 // _DelBookmarks, _{Save,Restore}CntntIdx
 
 void _DelBookmarks(


More information about the Libreoffice-commits mailing list