diff options
-rw-r--r-- | sw/source/core/unocore/unoparagraph.cxx | 3 | ||||
-rw-r--r-- | sw/source/filter/ww8/WW8TableInfo.cxx | 38 | ||||
-rw-r--r-- | sw/source/filter/ww8/WW8TableInfo.hxx | 3 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.cxx | 89 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8atr.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/docvw/PostItMgr.cxx | 1 | ||||
-rw-r--r-- | sw/source/ui/shells/basesh.cxx | 5 | ||||
-rw-r--r-- | sw/source/ui/wrtsh/select.cxx | 1 |
8 files changed, 112 insertions, 32 deletions
diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx index 227b8cf58e42..fe750469fade 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 79cb9b714187..021bbea5f380 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 a2d03337fb29..035464fb751b 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 ceaff6b00610..dcef287a1537 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(); - } - else - aColor = COL_AUTO; + 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 ); + WW8SHDLong aSHD; + aSHD.setCvFore( 0xFF000000 ); - sal_uInt32 nBgColor = aColor.GetColor(); - if ( nBgColor == COL_AUTO ) - aSHD.setCvBack( 0xFF000000 ); - else - aSHD.setCvBack( wwUtility::RGBToBGR( nBgColor ) ); + sal_uInt32 nBgColor = aColor.GetColor(); + if ( nBgColor == COL_AUTO ) + aSHD.setCvBack( 0xFF000000 ); + else + aSHD.setCvBack( wwUtility::RGBToBGR( nBgColor ) ); - aSHD.Write( m_rWW8Export ); + 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() ); @@ -3600,6 +3644,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 ddb8e13bb867..3b91de937668 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 6bea77137ac6..3c32ef04e9e1 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 9f5ee6195e81..6bb599e44867 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 b46cbdb3a1a5..44a854a7ad4d 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 ); } |