[ooo-build-commit] Branch 'ooo/OOO320' - 2 commits - sw/source

Jan Holesovsky kendy at kemper.freedesktop.org
Fri Dec 4 01:04:21 PST 2009


 sw/source/core/text/porfld.cxx          |    7 ++
 sw/source/core/text/porfld.hxx          |    2 
 sw/source/core/unocore/unoparagraph.cxx |    3 -
 sw/source/filter/ww8/WW8TableInfo.cxx   |   38 +++++++++++--
 sw/source/filter/ww8/WW8TableInfo.hxx   |    3 +
 sw/source/filter/ww8/wrtww8.cxx         |   93 +++++++++++++++++++++++---------
 sw/source/filter/ww8/ww8atr.cxx         |    4 -
 sw/source/ui/docvw/PostItMgr.cxx        |    1 
 sw/source/ui/shells/basesh.cxx          |    5 +
 sw/source/ui/wrtsh/select.cxx           |    1 
 10 files changed, 121 insertions(+), 36 deletions(-)

New commits:
commit 2b86fa8aa81fe47fda1cdae3208aa57dbbecb3aa
Author: Oliver Bolte <obo at openoffice.org>
Date:   Tue Dec 1 10:30:26 2009 +0000

    CWS-TOOLING: integrate CWS sw32bf08
    2009-11-25 14:26:13 +0100 od  r277635 : #i107143# method <SwFldPortion::Clone(..)>
              - pass placeholder property to created <SwFldPortion> instance

diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index 8fcdbca..913ca9e 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -82,8 +82,13 @@ SwFldPortion *SwFldPortion::Clone( const XubString &rExpand ) const
 {
     SwFont *pNewFnt;
     if( 0 != ( pNewFnt = pFnt ) )
+    {
         pNewFnt = new SwFont( *pFnt );
-    SwFldPortion* pClone = new SwFldPortion( rExpand, pNewFnt );
+    }
+    // --> OD 2009-11-25 #i107143#
+    // pass placeholder property to created <SwFldPortion> instance.
+    SwFldPortion* pClone = new SwFldPortion( rExpand, pNewFnt, bPlaceHolder );
+    // <--
     pClone->SetNextOffset( nNextOffset );
     pClone->m_bNoLength = this->m_bNoLength;
     return pClone;
diff --git a/sw/source/core/text/porfld.hxx b/sw/source/core/text/porfld.hxx
index 2292a27..5f52d45 100644
--- a/sw/source/core/text/porfld.hxx
+++ b/sw/source/core/text/porfld.hxx
@@ -60,7 +60,7 @@ protected:
     sal_Bool bAnimated : 1; 		// wird von SwGrfNumPortion benutzt
     sal_Bool bNoPaint : 1; 			// wird von SwGrfNumPortion benutzt
     sal_Bool bReplace : 1; 			// wird von SwGrfNumPortion benutzt
-    sal_Bool bPlaceHolder : 1;
+    const sal_Bool bPlaceHolder : 1;
     sal_Bool m_bNoLength : 1;       // HACK for meta suffix (no CH_TXTATR)
 
     inline void SetFont( SwFont *pNew ) { pFnt = pNew; }
commit a88403b091e696602003729ef871bb3fb993fda4
Author: Oliver Bolte <obo at openoffice.org>
Date:   Tue Dec 1 07:03:58 2009 +0000

    CWS-TOOLING: integrate CWS hb32showstoppers2
    2009-11-05 14:28:58 +0100 hbrinkm  r277370 : CWS-TOOLING: rebase CWS hb32showstoppers2 to branches/OOO320 at 277262 (milestone: OOO320:m3)
    2009-11-04 16:04:47 +0100 hbrinkm  r277357 : #i102434# write background color/shadow like WW8 does
    2009-11-03 12:22:27 +0100 os  r277319 : #i106515# call to LeaveDrawCreate() moved from SwWrtShell::UnSelectFrame() to SwPostItMgr::AssureStdModeAtShell()
    2009-10-30 14:58:39 +0100 hbrinkm  r277272 : #i103374# set default style on table row ends
    2009-10-30 13:19:38 +0100 hbrinkm  r277265 : #i106057# applied here because otherwise saving DOCs crashes
    2009-10-28 13:50:44 +0100 hbrinkm  r277240 : applied patch for OOO320_m2
    #i105052# debugging code
    #i102420# rewritten debug output for SwNodes.
    #i105052# debugging code
    sw/source/filter/ww8/wrtww8.cxx:
    MSWordExportBase::WriteText:
    Keep track of nodes already exported and assert when a node is exported for the second time.
    sw/source/filter/ww8/WW8TableInfo.cxx:
    WW8TableNodeInfo::setNext:
    Announce from where to where the next pointer points.
    #i105052# save pointer to next SwNode in WW8TableNodeInfo
    merged DEV300_m60
    #i105653# applied patch
    #i105941# crash on initialization fixed
    merged changes from hb32showstoppers
    2009-10-27 16:39:40 +0100 mst  r277223 : #i106349#: SwBaseShell::ExecUndo(): do not access members after dying

diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx
index 89032a3..812b81e 100644
--- a/sw/source/core/unocore/unoparagraph.cxx
+++ b/sw/source/core/unocore/unoparagraph.cxx
@@ -293,7 +293,6 @@ void SAL_CALL SwXParagraph::SetPropertyValues_Impl(
         const OUString* pPropertyNames = rPropertyNames.getConstArray();
         const uno::Any* pValues = rValues.getConstArray();
         const SfxItemPropertyMap*   pMap = m_pPropSet->getPropertyMap();
-        OUString sTmp;
         SwParaSelection aParaSel( & aCursor );
         for(sal_Int32 nProp = 0; nProp < rPropertyNames.getLength(); nProp++)
         {
@@ -306,7 +305,7 @@ void SAL_CALL SwXParagraph::SetPropertyValues_Impl(
                     throw beans::PropertyVetoException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + pPropertyNames[nProp], static_cast < cppu::OWeakObject * > ( this ) );
 
                 SwXTextCursor::SetPropertyValue(aCursor, *m_pPropSet,
-                                        sTmp, pValues[nProp]);
+                                        pPropertyNames[nProp], pValues[nProp]);
             }
         }
     }
diff --git a/sw/source/filter/ww8/WW8TableInfo.cxx b/sw/source/filter/ww8/WW8TableInfo.cxx
index 022b3d0..965d997 100644
--- a/sw/source/filter/ww8/WW8TableInfo.cxx
+++ b/sw/source/filter/ww8/WW8TableInfo.cxx
@@ -161,7 +161,8 @@ WW8TableNodeInfo::WW8TableNodeInfo(const SwNode * pNode)
 :
     mnDepth(0), 
     mpNode(pNode),
-    mpNext(NULL)
+    mpNext(NULL),
+    mpNextNode(NULL)
 {
 }
 
@@ -190,9 +191,7 @@ WW8TableNodeInfo::~WW8TableNodeInfo()
     }
                 
 #ifdef DEBUG
-//!! does not compile with debug=t -> unresolved external (dbg_out),
-//!! sommeone who knows what he wants to get should fix this
-//    sResult += dbg_out(*mpNode);
+    sResult += dbg_out(*mpNode);
 #endif
 
     sResult +="</tableNodeInfo>";
@@ -247,6 +246,17 @@ void WW8TableNodeInfo::setTable(const SwTable * pTable)
 void WW8TableNodeInfo::setNext(WW8TableNodeInfo * pNext)
 {
     mpNext = pNext;
+
+#ifdef DEBUG
+    ::std::clog << "<setnext><from>" << toString() << "</from><to>" 
+                << pNext->toString() << "</to></setnext>" 
+                << ::std::endl;
+#endif
+}
+
+void WW8TableNodeInfo::setNextNode(SwNode * pNode)
+{
+    mpNode = pNode;
 }
 
 void WW8TableNodeInfo::setCell(sal_uInt32 nCell)
@@ -287,6 +297,11 @@ WW8TableNodeInfo * WW8TableNodeInfo::getNext() const
     return mpNext;
 }
 
+SwNode * WW8TableNodeInfo::getNextNode() const
+{
+    return mpNextNode;
+}
+
 bool WW8TableNodeInfo::isEndOfLine() const
 {
     return getInnerForDepth(mnDepth)->isEndOfLine();
@@ -362,6 +377,14 @@ void WW8TableInfo::processSwTable(const SwTable * pTable)
         pPrev = processTableLine(pTable, pLine, n, 1, pPrev);
     }
 
+    if (pPrev != NULL)
+    {
+        SwTableNode * pTableNode = pTable->GetTableNode();
+        SwEndNode * pEndNode = pTableNode->EndOfSectionNode();
+
+        pPrev->setNextNode(pEndNode);
+    }
+
 #ifdef DEBUG
     ::std::clog << "</processSwTable>" << ::std::endl;
 #endif
@@ -602,6 +625,13 @@ const SwNode * WW8TableInfo::getNextNode(const SwNode * pNode)
         
         if (pNextInfo != NULL)
             pResult = pNextInfo->getNode();
+        else 
+        {
+            SwNode * pNextNode = pNodeInfo->getNextNode();
+
+            if (pNextNode != NULL)
+                pResult = pNextNode;
+        }
     }
     
     return pResult;
diff --git a/sw/source/filter/ww8/WW8TableInfo.hxx b/sw/source/filter/ww8/WW8TableInfo.hxx
index b5eee16..0db4637 100644
--- a/sw/source/filter/ww8/WW8TableInfo.hxx
+++ b/sw/source/filter/ww8/WW8TableInfo.hxx
@@ -97,6 +97,7 @@ private:
     const SwNode * mpNode;
     Inners_t mInners;
     WW8TableNodeInfo * mpNext;
+    SwNode * mpNextNode;
     
 public:
     typedef boost::shared_ptr<WW8TableNodeInfo> Pointer_t;
@@ -112,6 +113,7 @@ public:
     void setCell(sal_uInt32 nCell);
     void setRow(sal_uInt32 nRow);
     void setNext(WW8TableNodeInfo * pNext);
+    void setNextNode(SwNode * pNode);
     
     sal_uInt32 getDepth() const;
     bool isEndOfLine() const;
@@ -120,6 +122,7 @@ public:
     const SwTableBox * getTableBox() const;
     const SwTable * getTable() const;
     WW8TableNodeInfo * getNext() const;
+    SwNode * getNextNode() const;
 
     const Inners_t & getInners() const;
     const WW8TableNodeInfoInner::Pointer_t getFirstInner() const;
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 2f96191..3328818 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -2370,37 +2370,45 @@ void WW8AttributeOutput::TableBackgrounds( ww8::WW8TableNodeInfoInner::Pointer_t
 
     if ( m_rWW8Export.bWrtWW8 )
     {
+        sal_uInt32 aSprmIds[] = {NS_sprm::LN_TCellShd, NS_sprm::LN_TCellShadow};
+
         sal_uInt8 nBoxes0 = rTabBoxes.Count();
         if (nBoxes0 > 21)
             nBoxes0 = 21;
 
-        m_rWW8Export.InsUInt16( NS_sprm::LN_TCellShd );
-        m_rWW8Export.pO->Insert( static_cast<BYTE>(nBoxes0 * 10), m_rWW8Export.pO->Count() );
-
-        for ( sal_uInt8 n = 0; n < nBoxes0; n++ )
+        for (sal_uInt32 m = 0; m < 2; m++)
         {
-            const SwTableBox * pBox1 = rTabBoxes[n];
-            const SwFrmFmt * pFrmFmt = pBox1->GetFrmFmt();
-            const SfxPoolItem * pI = NULL;
-            Color aColor;
+            m_rWW8Export.InsUInt16( aSprmIds[m] );
+            m_rWW8Export.pO->Insert( static_cast<BYTE>(nBoxes0 * 10), 
+                                     m_rWW8Export.pO->Count() );
 
-            if ( SFX_ITEM_ON == pFrmFmt->GetAttrSet().GetItemState( RES_BACKGROUND, false, &pI ) )
+            for ( sal_uInt8 n = 0; n < nBoxes0; n++ )
             {
-                aColor = dynamic_cast<const SvxBrushItem *>(pI)->GetColor();
+                const SwTableBox * pBox1 = rTabBoxes[n];
+                const SwFrmFmt * pFrmFmt = pBox1->GetFrmFmt();
+                const SfxPoolItem * pI = NULL;
+                Color aColor;
+                
+                if ( SFX_ITEM_ON == 
+                     pFrmFmt->GetAttrSet().
+                     GetItemState( RES_BACKGROUND, false, &pI ) )
+                {
+                    aColor = dynamic_cast<const SvxBrushItem *>(pI)->GetColor();
+                }
+                else
+                    aColor = COL_AUTO;
+                
+                WW8SHDLong aSHD;
+                aSHD.setCvFore( 0xFF000000 );
+                
+                sal_uInt32 nBgColor = aColor.GetColor();
+                if ( nBgColor == COL_AUTO )
+                    aSHD.setCvBack( 0xFF000000 );
+                else
+                    aSHD.setCvBack( wwUtility::RGBToBGR( nBgColor ) );
+                
+                aSHD.Write( m_rWW8Export );
             }
-            else
-                aColor = COL_AUTO;
-
-            WW8SHDLong aSHD;
-            aSHD.setCvFore( 0xFF000000 );
-
-            sal_uInt32 nBgColor = aColor.GetColor();
-            if ( nBgColor == COL_AUTO )
-                aSHD.setCvBack( 0xFF000000 );
-            else
-                aSHD.setCvBack( wwUtility::RGBToBGR( nBgColor ) );
-
-            aSHD.Write( m_rWW8Export );
         }
     }
 }
@@ -2415,11 +2423,24 @@ void WW8Export::SectionBreaksAndFrames( const SwTxtNode& rNode )
         OutWW6FlyFrmsInCntnt( rNode );
 }
 
+#ifdef DEBUG
+struct SwNodeHash
+{
+    size_t operator()(SwNode * pNode) const { return reinterpret_cast<size_t>(pNode); }
+};
+
+typedef ::std::hash_set<SwNode *, SwNodeHash> SwNodeHashSet;
+typedef ::std::deque<SwNode *> SwNodeDeque;
+#endif
+
 void MSWordExportBase::WriteText()
 {
 #ifdef DEBUG
     ::std::clog << "<WriteText>" << ::std::endl;
-//    ::std::clog << dbg_out(pCurPam->GetDoc()->GetNodes()) << ::std::endl;
+    ::std::clog << dbg_out(pCurPam->GetDoc()->GetNodes()) << ::std::endl;
+
+    SwNodeHashSet aNodeSet;
+    SwNodeDeque aNodeDeque;
 #endif
 
     while( pCurPam->GetPoint()->nNode < pCurPam->GetMark()->nNode ||
@@ -2428,6 +2449,29 @@ void MSWordExportBase::WriteText()
     {
         SwNode * pNd = pCurPam->GetNode();
 
+#ifdef DEBUG
+        if (aNodeSet.find(pNd) == aNodeSet.end())
+        {
+            aNodeSet.insert(pNd);
+            aNodeDeque.push_back(pNd);
+        }
+        else
+        {
+            ::std::clog << "<already-done><which>" << dbg_out(*pNd) 
+                        << "</which><nodes>" << ::std::endl;
+            
+            SwNodeDeque::const_iterator aEnd = aNodeDeque.end();
+            
+            for (SwNodeDeque::const_iterator aIt = aNodeDeque.begin();
+                 aIt != aEnd; aIt++)
+            {
+                ::std::clog << dbg_out(**aIt) << ::std::endl;
+            }
+
+            ::std::clog << "</nodes></already-done>" << ::std::endl;
+        }
+#endif
+
         if ( pNd->IsTxtNode() )
             SectionBreaksAndFrames( *pNd->GetTxtNode() );
 
@@ -3601,6 +3645,7 @@ void WW8AttributeOutput::TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer
 #endif
         TableRowEnd(pNodeInfoInner->getDepth());
 
+        ShortToSVBT16(0, nStyle);
         m_rWW8Export.pO->Insert( (BYTE*)&nStyle, 2, m_rWW8Export.pO->Count() );     // Style #
         TableInfoRow(pNodeInfoInner);
         m_rWW8Export.pPapPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), m_rWW8Export.pO->Count(),
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index e379e44..f9117f8 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -966,7 +966,7 @@ void WW8AttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pTe
             TableRowEnd( pTextNodeInfoInner->getDepth() );
             
             SVBT16 nSty;
-            ShortToSVBT16( m_rWW8Export.nStyleBeforeFly, nSty );
+            ShortToSVBT16( 0, nSty );
             m_rWW8Export.pO->Insert( (BYTE*)&nSty, 2, m_rWW8Export.pO->Count() );     // Style #
             TableInfoRow( pTextNodeInfoInner );
             m_rWW8Export.pPapPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), m_rWW8Export.pO->Count(),
@@ -1559,7 +1559,7 @@ bool WW8Export::TransBrush(const Color& rCol, WW8_SHD& rShd)
         rShd = WW8_SHD();               // alles Nullen : transparent
     else
     {
-        rShd.SetFore( 8);
+        rShd.SetFore( 0);
         rShd.SetBack( TransCol( rCol ) );
         rShd.SetStyle( bWrtWW8, 0 );
     }
diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx
index 9862ace..6681e75 100644
--- a/sw/source/ui/docvw/PostItMgr.cxx
+++ b/sw/source/ui/docvw/PostItMgr.cxx
@@ -1941,6 +1941,7 @@ void SwPostItMgr::AssureStdModeAtShell()
         {
                 mpWrtShell->UnSelectFrm();
                 mpWrtShell->LeaveSelFrmMode();
+                mpWrtShell->GetView().LeaveDrawCreate();
                 mpWrtShell->EnterStdMode();
                 
                 mpWrtShell->DrawSelChanged();
diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx
index 84b6f53..a32d3e1 100644
--- a/sw/source/ui/shells/basesh.cxx
+++ b/sw/source/ui/shells/basesh.cxx
@@ -517,6 +517,9 @@ void SwBaseShell::ExecUndo(SfxRequest &rReq)
     if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( nId, FALSE, &pItem ))
         nCnt = ((SfxUInt16Item*)pItem)->GetValue();
 
+    // #i106349#: save pointer: undo/redo may delete the shell, i.e., this!
+    SfxViewFrame *const pViewFrame( GetView().GetViewFrame() );
+
     switch( nId )
     {
         case SID_UNDO:
@@ -538,7 +541,7 @@ void SwBaseShell::ExecUndo(SfxRequest &rReq)
             DBG_ERROR("falscher Dispatcher");
     }
 
-    GetView().GetViewFrame()->GetBindings().InvalidateAll(sal_False);
+    if (pViewFrame) { pViewFrame->GetBindings().InvalidateAll(sal_False); }
 }
 
 /*--------------------------------------------------------------------
diff --git a/sw/source/ui/wrtsh/select.cxx b/sw/source/ui/wrtsh/select.cxx
index 21f1882..da9e898 100644
--- a/sw/source/ui/wrtsh/select.cxx
+++ b/sw/source/ui/wrtsh/select.cxx
@@ -343,7 +343,6 @@ void SwWrtShell::UnSelectFrm()
     // Rahmenselektion aufheben mit garantiert ungueltiger Position
     Point aPt(LONG_MIN, LONG_MIN);
     SelectObj(aPt, 0);
-    GetView().LeaveDrawCreate();
     SwTransferable::ClearSelection( *this );
 }
 


More information about the ooo-build-commit mailing list