incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject svn commit: r1172110 - in /incubator/ooo/trunk/main/sw: inc/section.hxx source/core/docnode/ndsect.cxx source/core/docnode/section.cxx source/core/layout/sectfrm.cxx
Date Sat, 17 Sep 2011 22:38:46 GMT
Author: mst
Date: Sat Sep 17 22:38:45 2011
New Revision: 1172110

URL: http://svn.apache.org/viewvc?rev=1172110&view=rev
Log:
sw34bf06: #i117863# - use hint which allows to specify, if content is saved or not for deletion
of <SwFrm> instances triggered from <SwSectionNode> resp. <SwSectionFmt>
methods

# HG changeset patch
# User Oliver-Rainer Wittmann <od@openoffice.org>
# Date 1302872091 -7200
# Node ID d2030e65b6b95bc3796cb3e09aa229edef8c3c0a
# Parent  5438b9c546584ebd17553c1c5b6a3f6cdbd1c7de

Modified:
    incubator/ooo/trunk/main/sw/inc/section.hxx   (contents, props changed)
    incubator/ooo/trunk/main/sw/source/core/docnode/ndsect.cxx   (contents, props changed)
    incubator/ooo/trunk/main/sw/source/core/docnode/section.cxx   (contents, props changed)
    incubator/ooo/trunk/main/sw/source/core/layout/sectfrm.cxx   (contents, props changed)

Modified: incubator/ooo/trunk/main/sw/inc/section.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/inc/section.hxx?rev=1172110&r1=1172109&r2=1172110&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/inc/section.hxx (original)
+++ incubator/ooo/trunk/main/sw/inc/section.hxx Sat Sep 17 22:38:45 2011
@@ -35,6 +35,9 @@
 #include <tools/rtti.hxx>
 #include <tools/ref.hxx>
 #include <svl/svarray.hxx>
+// --> OD #i117863#
+#include <svl/smplhint.hxx>
+// <--
 #include <sfx2/lnkbase.hxx>
 #include <sfx2/Metadatable.hxx>
 
@@ -280,6 +283,27 @@ public:
 
 };
 
+// --> OD #i117863#
+class SwSectionFrmMoveAndDeleteHint : public SfxSimpleHint
+{
+    public:
+        SwSectionFrmMoveAndDeleteHint( const sal_Bool bSaveCntnt )
+            : SfxSimpleHint( SFX_HINT_DYING )
+            , mbSaveCntnt( bSaveCntnt )
+        {}
+
+        ~SwSectionFrmMoveAndDeleteHint()
+        {}
+        
+        sal_Bool IsSaveCntnt() const
+        {
+            return mbSaveCntnt;
+        }
+    
+    private:
+        const sal_Bool mbSaveCntnt;
+};            
+// <--
 
 enum SectionSort { SORTSECT_NOT, SORTSECT_NAME, SORTSECT_POS };
 

Propchange: incubator/ooo/trunk/main/sw/inc/section.hxx
------------------------------------------------------------------------------
    svn:executable = *

Modified: incubator/ooo/trunk/main/sw/source/core/docnode/ndsect.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/core/docnode/ndsect.cxx?rev=1172110&r1=1172109&r2=1172110&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/core/docnode/ndsect.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/core/docnode/ndsect.cxx Sat Sep 17 22:38:45 2011
@@ -1067,7 +1067,10 @@ SwFrm* SwClearDummies( SwFrm* pFrm )
 SwSectionNode::~SwSectionNode()
 {
     // mba: test if iteration works as clients will be removed in callback
-    m_pSection->GetFmt()->CallSwClientNotify( SfxSimpleHint( SFX_HINT_DYING ) );
+    // --> OD #i117863#
+    // use hint which allows to specify, if the content shall be saved or not
+    m_pSection->GetFmt()->CallSwClientNotify( SwSectionFrmMoveAndDeleteHint( sal_True
) );
+    // <--
     SwSectionFmt* pFmt = m_pSection->GetFmt();
 	if( pFmt )
 	{

Propchange: incubator/ooo/trunk/main/sw/source/core/docnode/ndsect.cxx
------------------------------------------------------------------------------
    svn:executable = *

Modified: incubator/ooo/trunk/main/sw/source/core/docnode/section.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/core/docnode/section.cxx?rev=1172110&r1=1172109&r2=1172110&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/core/docnode/section.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/core/docnode/section.cxx Sat Sep 17 22:38:45 2011
@@ -701,7 +701,10 @@ SwSectionFmt::~SwSectionFmt()
 				}
 			}
             // mba: test iteration; objects are removed while iterating
-            CallSwClientNotify( SfxSimpleHint(SFX_HINT_DYING) );
+            // --> OD #i117863#
+            // use hint which allows to specify, if the content shall be saved or not
+            CallSwClientNotify( SwSectionFrmMoveAndDeleteHint( sal_True ) );
+            // <--
 
 			// hebe die Section doch mal auf
 			SwNodeRange aRg( *pSectNd, 0, *pSectNd->EndOfSectionNode() );
@@ -731,7 +734,10 @@ void SwSectionFmt::DelFrms()
 	{
         // #147431# : First delete the <SwSectionFrm> of the <SwSectionFmt> instance
         // mba: test iteration as objects are removed in iteration
-        CallSwClientNotify( SfxSimpleHint(SFX_HINT_DYING) );
+        // --> OD #i117863#
+        // use hint which allows to specify, if the content shall be saved or not
+        CallSwClientNotify( SwSectionFrmMoveAndDeleteHint( sal_False ) );
+        // <--
  
         // Then delete frames of the nested <SwSectionFmt> instances
         SwIterator<SwSectionFmt,SwSectionFmt> aIter( *this );

Propchange: incubator/ooo/trunk/main/sw/source/core/docnode/section.cxx
------------------------------------------------------------------------------
    svn:executable = *

Modified: incubator/ooo/trunk/main/sw/source/core/layout/sectfrm.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/core/layout/sectfrm.cxx?rev=1172110&r1=1172109&r2=1172110&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/core/layout/sectfrm.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/core/layout/sectfrm.cxx Sat Sep 17 22:38:45 2011
@@ -2479,11 +2479,14 @@ void SwSectionFrm::Modify( const SfxPool
 
 void SwSectionFrm::SwClientNotify( const SwModify& rMod, const SfxHint& rHint )
 {
-    const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
-    if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING && &rMod
== GetRegisteredIn() )
+    // --> OD #i117863#
+    const SwSectionFrmMoveAndDeleteHint* pHint = 
+                    dynamic_cast<const SwSectionFrmMoveAndDeleteHint*>(&rHint);
+    if ( pHint && pHint->GetId() == SFX_HINT_DYING && &rMod == GetRegisteredIn()
)
     {
-        SwSectionFrm::MoveCntntAndDelete( this, sal_True );
+        SwSectionFrm::MoveCntntAndDelete( this, pHint->IsSaveCntnt() );
     }
+    // <--
 }
 
 void SwSectionFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,

Propchange: incubator/ooo/trunk/main/sw/source/core/layout/sectfrm.cxx
------------------------------------------------------------------------------
    svn:executable = *



Mime
View raw message