summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2009-12-01 07:03:58 +0000
committerOliver Bolte <obo@openoffice.org>2009-12-01 07:03:58 +0000
commita88403b091e696602003729ef871bb3fb993fda4 (patch)
tree7b93e60aaeb7f658cd369882687e74a869f298fb /sw
parent0d08134ba677f64b223a9b190d568d10b32f8f47 (diff)
CWS-TOOLING: integrate CWS hb32showstoppers2
2009-11-05 14:28:58 +0100 hbrinkm r277370 : CWS-TOOLING: rebase CWS hb32showstoppers2 to branches/OOO320@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
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/unocore/unoparagraph.cxx3
-rw-r--r--sw/source/filter/ww8/WW8TableInfo.cxx38
-rw-r--r--sw/source/filter/ww8/WW8TableInfo.hxx3
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx93
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx4
-rw-r--r--sw/source/ui/docvw/PostItMgr.cxx1
-rw-r--r--sw/source/ui/shells/basesh.cxx5
-rw-r--r--sw/source/ui/wrtsh/select.cxx1
8 files changed, 114 insertions, 34 deletions
diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx
index 89032a3b20..812b81e928 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 022b3d045b..965d997955 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 b5eee16dd6..0db4637465 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 2f96191513..332881836e 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 e379e44a65..f9117f8c13 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 9862ace5cd..6681e755f1 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 84b6f53a57..a32d3e1f1b 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 21f1882f9e..da9e898de6 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 );
}