diff options
author | Petr Mladek <pmladek@suse.cz> | 2012-11-05 14:34:27 +0100 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2012-11-05 14:34:27 +0100 |
commit | ef15a5a4acd3174752484c6aeb570d4d6444b645 (patch) | |
tree | 3d1d5b58f85737aa46241aea4c4dabea520cecc2 /sw | |
parent | a1b0ce05e851e9724c046888a01869eddf9e9db2 (diff) | |
parent | c309ce0227a14330094191c1ef15fa00899defcb (diff) |
Merge remote-tracking branch 'origin/libreoffice-3-6-3' into suse-3.6
Conflicts:
desktop/source/app/sofficemain.cxx
instsetoo_native/util/openoffice.lst
solenv/inc/minor.mk
Change-Id: I3e9510067c7173f6c71368e70ba6dfe168c5318e
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/printdata.hxx | 2 | ||||
-rw-r--r-- | sw/inc/swtable.hxx | 1 | ||||
-rw-r--r-- | sw/inc/unotxdoc.hxx | 5 | ||||
-rw-r--r-- | sw/source/core/crsr/crsrsh.cxx | 15 | ||||
-rwxr-xr-x[-rw-r--r--] | sw/source/core/doc/dbgoutsw.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/table/swtable.cxx | 14 | ||||
-rw-r--r-- | sw/source/core/undo/untbl.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/view/printdata.cxx | 5 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8esh.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par2.cxx | 1 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par6.cxx | 76 | ||||
-rw-r--r-- | sw/source/filter/xml/xmltble.cxx | 11 | ||||
-rw-r--r-- | sw/source/ui/app/applab.cxx | 77 | ||||
-rw-r--r-- | sw/source/ui/dbui/dbmgr.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/uno/unotxdoc.cxx | 26 |
16 files changed, 94 insertions, 165 deletions
diff --git a/sw/inc/printdata.hxx b/sw/inc/printdata.hxx index 02d56b8a20b2..a64ece90e1d1 100644 --- a/sw/inc/printdata.hxx +++ b/sw/inc/printdata.hxx @@ -42,7 +42,6 @@ class SwDoc; class SwDocShell; -class ViewShell; class _SetGetExpFlds; class SwViewOption; class OutputDevice; @@ -278,6 +277,7 @@ public: void ViewOptionAdjustStart( ViewShell &rSh, const SwViewOption &rViewOptions); void ViewOptionAdjust( SwPrintData const* const pPrtOptions ); void ViewOptionAdjustStop(); + void ViewOptionAdjustCrashPreventionKludge(); bool HasSwPrtOptions() const { return m_pPrtOptions != 0; } SwPrintData const* GetSwPrtOptions() const { return m_pPrtOptions.get(); } diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx index 29c779a51ed2..a3525882c142 100644 --- a/sw/inc/swtable.hxx +++ b/sw/inc/swtable.hxx @@ -422,6 +422,7 @@ public: SwFrmFmt* ClaimFrmFmt(); void ChgFrmFmt( SwTableBoxFmt *pNewFmt ); + void RemoveFromTable(); const SwStartNode *GetSttNd() const { return pSttNd; } sal_uLong GetSttIdx() const; diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx index 9d94f18323ee..63004fb7e4b0 100644 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -586,7 +586,7 @@ public: -----------------------------------------------------------------------*/ class SwViewOptionAdjust_Impl { - ViewShell & m_rShell; + ViewShell * m_pShell; SwViewOption m_aOldViewOptions; public: @@ -594,7 +594,8 @@ public: ~SwViewOptionAdjust_Impl(); void AdjustViewOptions( SwPrintData const* const pPrtOptions ); bool checkShell( const ViewShell& rCompare ) const - { return &rCompare == &m_rShell; } + { return &rCompare == m_pShell; } + void DontTouchThatViewShellItSmellsFunny() { m_pShell = 0; } }; diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index ca62c557e9f5..1493d14cd180 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -2012,26 +2012,27 @@ void SwCrsrShell::Combine() return; SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen - SwCrsrSaveState aSaveState( *pCurCrsr ); + // rhbz#689053: IsSelOvr must restore the saved stack position, not the + // current one, because current point + stack mark may be invalid PaM + SwCrsrSaveState aSaveState(*pCrsrStk); if( pCrsrStk->HasMark() ) // nur wenn GetMark gesetzt wurde { bool const bResult = CheckNodesRange( pCrsrStk->GetMark()->nNode, pCurCrsr->GetPoint()->nNode, sal_True ); OSL_ENSURE(bResult, "StackCrsr & act. Crsr not in same Section."); (void) bResult; // non-debug: unused - // kopiere das GetMark - if( !pCurCrsr->HasMark() ) - pCurCrsr->SetMark(); - *pCurCrsr->GetMark() = *pCrsrStk->GetMark(); - pCurCrsr->GetMkPos() = pCrsrStk->GetMkPos(); } + *pCrsrStk->GetPoint() = *pCurCrsr->GetPoint(); + pCrsrStk->GetPtPos() = pCurCrsr->GetPtPos(); SwShellCrsr * pTmp = 0; if( pCrsrStk->GetNext() != pCrsrStk ) { pTmp = dynamic_cast<SwShellCrsr*>(pCrsrStk->GetNext()); } - delete pCrsrStk; + delete pCurCrsr; + pCurCrsr = pCrsrStk; + pCrsrStk->MoveTo(0); // remove from ring pCrsrStk = pTmp; if( !pCurCrsr->IsInProtectTable( sal_True ) && !pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE | diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx index b14e07d0cd7f..ad42cff7539d 100644..100755 --- a/sw/source/core/doc/dbgoutsw.cxx +++ b/sw/source/core/doc/dbgoutsw.cxx @@ -973,12 +973,9 @@ String lcl_TokenType2Str(FormTokenType nType) case TOKEN_END: return String("END", RTL_TEXTENCODING_ASCII_US); default: + OSL_FAIL("should not be reached"); return String("??", RTL_TEXTENCODING_ASCII_US); } - - OSL_FAIL("should not be reached"); - - return String("??", RTL_TEXTENCODING_ASCII_US); } String lcl_dbg_out(const SwFormToken & rToken) diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index 3a57a7586b4f..69e755b09a70 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -1747,10 +1747,9 @@ SwTableBox::SwTableBox( SwTableBoxFmt* pFmt, const SwStartNode& rSttNd, SwTableL rSrtArr.Insert( p ); // eintragen } -SwTableBox::~SwTableBox() +void SwTableBox::RemoveFromTable() { - // Inhaltstragende Box ? - if( !GetFrmFmt()->GetDoc()->IsInDtor() && pSttNd ) + if (pSttNd) // box containing contents? { // an der Table austragen const SwTableNode* pTblNd = pSttNd->FindTableNode(); @@ -1759,6 +1758,15 @@ SwTableBox::~SwTableBox() GetTabSortBoxes(); SwTableBox *p = this; // error: &this rSrtArr.Remove( p ); // austragen + pSttNd = 0; // clear it so this is only run once + } +} + +SwTableBox::~SwTableBox() +{ + if (!GetFrmFmt()->GetDoc()->IsInDtor()) + { + RemoveFromTable(); } // ist die TabelleBox der letzte Client im FrameFormat, kann dieses diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index 11dbb4b7eeaa..e3a6af5d7a6a 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -1755,7 +1755,11 @@ void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext) rDoc.GetNodes()._MoveNodes( aRg, rDoc.GetNodes(), aInsPos, sal_False ); } else + { // first disconnect box from node, otherwise ~SwTableBox would + // access pBox->pSttNd, deleted by DeleteSection + pBox->RemoveFromTable(); rDoc.DeleteSection( rDoc.GetNodes()[ nIdx ] ); + } aDelBoxes.insert( aDelBoxes.end(), pBox ); } } @@ -1771,6 +1775,7 @@ void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext) // TL_CHART2: notify chart about box to be removed if (pPCD) pPCD->DeleteBox( &pTblNd->GetTable(), *pBox ); + pBox->RemoveFromTable(); // ~SwTableBox would access pBox->pSttNd aDelBoxes.insert( aDelBoxes.end(), pBox ); rDoc.DeleteSection( rDoc.GetNodes()[ nIdx ] ); } diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx index 4e6d37f1cab1..99888555d2dd 100644 --- a/sw/source/core/view/printdata.cxx +++ b/sw/source/core/view/printdata.cxx @@ -131,6 +131,11 @@ void SwRenderData::ViewOptionAdjustStop() m_pViewOptionAdjust.reset(); } +void SwRenderData::ViewOptionAdjustCrashPreventionKludge() +{ + m_pViewOptionAdjust->DontTouchThatViewShellItSmellsFunny(); +} + void SwRenderData::MakeSwPrtOptions( SwDocShell const*const pDocShell, diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index b9f2295c407b..1b780e0a0333 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -546,7 +546,11 @@ void DocxAttributeOutput::EndRun() if ( m_closeHyperlinkInPreviousRun ) { - m_pSerializer->endElementNS( XML_w, XML_hyperlink ); + if ( m_startedHyperlink ) + { + m_pSerializer->endElementNS( XML_w, XML_hyperlink ); + m_startedHyperlink = false; + } m_closeHyperlinkInPreviousRun = false; } diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index cfaf64becc42..88055d2774b2 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -1665,6 +1665,10 @@ bool lcl_isInHeader(const SwFrmFmt& rFmt) if (!pFlyFrmFmt) return false; SwFlyFrm* pFlyFrm = const_cast<SwFlyFrm*>(pFlyFrmFmt->GetFrm()); + if (!pFlyFrm) // fdo#54648: "hidden" drawing object has no layout frame + { + return false; + } SwPageFrm* pPageFrm = pFlyFrm->FindPageFrmOfAnchor(); SwFrm* pHeader = pPageFrm->Lower(); if (pHeader->GetType() == FRM_HEADER) diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 1b5bd7588a0b..679f1161df60 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -2751,7 +2751,6 @@ void WW8TabDesc::FinishSwTable() nRowSpan : ((-1) * (nRowSpan - n)); pCurrentBox->setRowSpan( nRowSpanSet ); - ++n; } } } diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 786bc00278a5..a74c4d0692c8 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -1279,83 +1279,13 @@ sal_uInt8 lcl_ReadBorders(bool bVer67, WW8_BRC* brc, WW8PLCFx_Cp_FKP* pPap, void GetLineIndex(SvxBoxItem &rBox, short nLineThickness, short nSpace, sal_uInt8 nCol, short nIdx, sal_uInt16 nOOIndex, sal_uInt16 nWWIndex, short *pSize=0) { - ::editeng::SvxBorderStyle eStyle = table::BorderLineStyle::SOLID; - switch (nIdx) - { - // First the single lines - case 1: - case 5: - // and the unsupported special cases which we map to a single line - case 8: - case 9: - case 20: - case 22: - eStyle = table::BorderLineStyle::SOLID; - break; - case 2: - { - eStyle = table::BorderLineStyle::SOLID; - nLineThickness *= 2; - } - break; - case 6: - eStyle = table::BorderLineStyle::DOTTED; - break; - case 7: - eStyle = table::BorderLineStyle::DASHED; - break; - // then the shading beams which we represent by a double line - case 23: - eStyle = table::BorderLineStyle::DOUBLE; - break; - // then the double lines, for which we have good matches - case 3: - case 10: //Don't have tripple so use double - case 21: //Don't have double wave: use double instead - eStyle = table::BorderLineStyle::DOUBLE; - break; - case 11: - eStyle = table::BorderLineStyle::THINTHICK_SMALLGAP; - break; - case 12: - case 13: //Don't have thin thick thin, so use thick thin - eStyle = table::BorderLineStyle::THICKTHIN_SMALLGAP; - break; - case 14: - eStyle = table::BorderLineStyle::THINTHICK_MEDIUMGAP; - break; - case 15: - case 16: //Don't have thin thick thin, so use thick thin - eStyle = table::BorderLineStyle::THICKTHIN_MEDIUMGAP; - break; - case 17: - eStyle = table::BorderLineStyle::THINTHICK_LARGEGAP; - break; - case 18: - case 19: //Don't have thin thick thin, so use thick thin - eStyle = table::BorderLineStyle::THICKTHIN_LARGEGAP; - break; - case 24: - eStyle = table::BorderLineStyle::EMBOSSED; - break; - case 25: - eStyle = table::BorderLineStyle::ENGRAVED; - break; - case 26: - eStyle = table::BorderLineStyle::OUTSET; - break; - case 27: - eStyle = table::BorderLineStyle::INSET; - break; - default: - eStyle = table::BorderLineStyle::NONE; - break; - } + ::editeng::SvxBorderStyle const eStyle( + ::editeng::ConvertBorderStyleFromWord(nIdx)); ::editeng::SvxBorderLine aLine; aLine.SetBorderLineStyle( eStyle ); double const fConverted( (table::BorderLineStyle::NONE == eStyle) ? 0.0 : - ::editeng::ConvertBorderWidthFromWord(eStyle, nLineThickness)); + ::editeng::ConvertBorderWidthFromWord(eStyle, nLineThickness, nIdx)); aLine.SetWidth(fConverted); //No AUTO for borders as yet, so if AUTO, use BLACK diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx index ba8d4a9e5223..19917707fdb5 100644 --- a/sw/source/filter/xml/xmltble.cxx +++ b/sw/source/filter/xml/xmltble.cxx @@ -980,14 +980,9 @@ void SwXMLExport::ExportTableLine( const SwTableLine& rLine, if ( nCol < nOldCol ) { OSL_FAIL( "table and/or table information seems to be corrupted." ); - if ( nBox == nBoxes - 1 ) - { - nCol = rLines.GetColumns().Count() - 1; - } - else - { - nCol = nOldCol; - } + // NOTE: nOldCol is not necessarily a valid index into + // GetColumns(), but that doesn't matter here + nCol = nOldCol; } sal_uInt16 nColSpan = nCol - nOldCol + 1U; diff --git a/sw/source/ui/app/applab.cxx b/sw/source/ui/app/applab.cxx index 4159f1835bda..fe2dd1122cf8 100644 --- a/sw/source/ui/app/applab.cxx +++ b/sw/source/ui/app/applab.cxx @@ -91,21 +91,19 @@ const char MASTER_LABEL[] = "MasterLabel"; const SwFrmFmt *lcl_InsertBCText( SwWrtShell& rSh, const SwLabItem& rItem, SwFrmFmt &rFmt, - sal_uInt16 nCol, sal_uInt16 nRow, sal_Bool bPage) + sal_uInt16 nCol, sal_uInt16 nRow ) { SfxItemSet aSet(rSh.GetAttrPool(), RES_ANCHOR, RES_ANCHOR, RES_VERT_ORIENT, RES_VERT_ORIENT, RES_HORI_ORIENT, RES_HORI_ORIENT, 0 ); sal_uInt16 nPhyPageNum, nVirtPageNum; rSh.GetPageNum( nPhyPageNum, nVirtPageNum ); - aSet.Put(SwFmtAnchor(bPage ? FLY_AS_CHAR : FLY_AT_PAGE, nPhyPageNum)); - if (!bPage) - { - aSet.Put(SwFmtHoriOrient(rItem.lLeft + nCol * rItem.lHDist, - text::HoriOrientation::NONE, text::RelOrientation::PAGE_FRAME )); - aSet.Put(SwFmtVertOrient(rItem.lUpper + nRow * rItem.lVDist, - text::VertOrientation::NONE, text::RelOrientation::PAGE_FRAME )); - } + //anchor frame to page + aSet.Put( SwFmtAnchor( FLY_AT_PAGE, nPhyPageNum ) ); + aSet.Put( SwFmtHoriOrient( rItem.lLeft + nCol * rItem.lHDist, + text::HoriOrientation::NONE, text::RelOrientation::PAGE_FRAME ) ); + aSet.Put( SwFmtVertOrient( rItem.lUpper + nRow * rItem.lVDist, + text::VertOrientation::NONE, text::RelOrientation::PAGE_FRAME ) ); const SwFrmFmt *pFmt = rSh.NewFlyFrm(aSet, sal_True, &rFmt ); // Insert Fly OSL_ENSURE( pFmt, "Fly not inserted" ); @@ -130,21 +128,19 @@ const SwFrmFmt *lcl_InsertBCText( SwWrtShell& rSh, const SwLabItem& rItem, const SwFrmFmt *lcl_InsertLabText( SwWrtShell& rSh, const SwLabItem& rItem, SwFrmFmt &rFmt, SwFldMgr& rFldMgr, - sal_uInt16 nCol, sal_uInt16 nRow, sal_Bool bLast, sal_Bool bPage) + sal_uInt16 nCol, sal_uInt16 nRow, sal_Bool bLast ) { SfxItemSet aSet(rSh.GetAttrPool(), RES_ANCHOR, RES_ANCHOR, RES_VERT_ORIENT, RES_VERT_ORIENT, RES_HORI_ORIENT, RES_HORI_ORIENT, 0 ); sal_uInt16 nPhyPageNum, nVirtPageNum; rSh.GetPageNum( nPhyPageNum, nVirtPageNum ); - aSet.Put(SwFmtAnchor(bPage ? FLY_AS_CHAR : FLY_AT_PAGE, nPhyPageNum)); - if (!bPage) - { - aSet.Put(SwFmtHoriOrient(rItem.lLeft + nCol * rItem.lHDist, - text::HoriOrientation::NONE, text::RelOrientation::PAGE_FRAME )); - aSet.Put(SwFmtVertOrient(rItem.lUpper + nRow * rItem.lVDist, - text::VertOrientation::NONE, text::RelOrientation::PAGE_FRAME )); - } + //anchor frame to page + aSet.Put( SwFmtAnchor( FLY_AT_PAGE, nPhyPageNum ) ); + aSet.Put( SwFmtHoriOrient( rItem.lLeft + nCol * rItem.lHDist, + text::HoriOrientation::NONE, text::RelOrientation::PAGE_FRAME ) ); + aSet.Put( SwFmtVertOrient( rItem.lUpper + nRow * rItem.lVDist, + text::VertOrientation::NONE, text::RelOrientation::PAGE_FRAME ) ); const SwFrmFmt *pFmt = rSh.NewFlyFrm(aSet, sal_True, &rFmt ); // Insert Fly OSL_ENSURE( pFmt, "Fly not inserted" ); @@ -300,26 +296,11 @@ void SwModule::InsertLab(SfxRequest& rReq, sal_Bool bLabel) SwFmtFrmSize aFrmSize( ATT_FIX_SIZE, iWidth, iHeight ); pFmt->SetFmtAttr( aFrmSize ); - SwFrmFmt* pFmtEORow = new SwFrmFmt (*pFmt); - SwFrmFmt* pFmtEOCol = new SwFrmFmt (*pFmt); - SwFrmFmt* pFmtEOColEORow = new SwFrmFmt (*pFmt); - - SvxULSpaceItem aFrmULSpace( 0, (sal_uInt16)(rItem.lVDist - rItem.lHeight), - RES_UL_SPACE ); + //frame represents label itself, no border space SvxULSpaceItem aFrmNoULSpace( 0, 0, RES_UL_SPACE ); - - SvxLRSpaceItem aFrmLRSpace( 0, (sal_uInt16)(rItem.lHDist - rItem.lWidth), - 0, 0, RES_LR_SPACE ); SvxLRSpaceItem aFrmNoLRSpace( 0, 0, 0, 0, RES_LR_SPACE ); - - pFmt->SetFmtAttr(aFrmULSpace); - pFmt->SetFmtAttr(aFrmLRSpace); - pFmtEORow->SetFmtAttr(aFrmULSpace); - pFmtEORow->SetFmtAttr(aFrmNoLRSpace); - pFmtEOCol->SetFmtAttr(aFrmNoULSpace); - pFmtEOCol->SetFmtAttr(aFrmLRSpace); - pFmtEOColEORow->SetFmtAttr(aFrmNoULSpace); - pFmtEOColEORow->SetFmtAttr(aFrmNoLRSpace); + pFmt->SetFmtAttr( aFrmNoULSpace ); + pFmt->SetFmtAttr( aFrmNoLRSpace ); const SwFrmFmt *pFirstFlyFmt = 0; if ( rItem.bPage ) @@ -327,26 +308,16 @@ void SwModule::InsertLab(SfxRequest& rReq, sal_Bool bLabel) SwFmtVertOrient aFrmVertOrient( pFmt->GetVertOrient() ); aFrmVertOrient.SetVertOrient( text::VertOrientation::TOP ); pFmt->SetFmtAttr(aFrmVertOrient); - pFmtEORow->SetFmtAttr(aFrmVertOrient); - pFmtEOCol->SetFmtAttr(aFrmVertOrient); - pFmtEOColEORow->SetFmtAttr(aFrmVertOrient); for ( sal_uInt16 i = 0; i < rItem.nRows; ++i ) { for ( sal_uInt16 j = 0; j < rItem.nCols; ++j ) { pSh->Push(); - SwFrmFmt* pFrmFmt; - if ( j == rItem.nCols - 1 ) - pFrmFmt = ( i == rItem.nRows - 1 ? pFmtEOColEORow : pFmtEORow ); - else - pFrmFmt = ( i == rItem.nRows - 1 ? pFmtEOCol : pFmt ); - - const SwFrmFmt *pTmp = - bLabel ? - lcl_InsertLabText( *pSh, rItem, *pFrmFmt, *pFldMgr, j, i, - i == rItem.nRows - 1 && j == rItem.nCols - 1, sal_True ) : - lcl_InsertBCText(*pSh, rItem, *pFrmFmt, j, i, sal_True); + const SwFrmFmt *pTmp = ( bLabel ? + lcl_InsertLabText( *pSh, rItem, *pFmt, *pFldMgr, j, i, + i == rItem.nRows - 1 && j == rItem.nCols - 1 ) : + lcl_InsertBCText( *pSh, rItem, *pFmt, j, i ) ); if (!(i|j)) { pFirstFlyFmt = pTmp; @@ -387,8 +358,6 @@ void SwModule::InsertLab(SfxRequest& rReq, sal_Bool bLabel) } pSh->Pop( sal_False ); } - if ( i + 1 != rItem.nRows ) - pSh->SplitNode(); // Small optimisation } } else @@ -396,10 +365,10 @@ void SwModule::InsertLab(SfxRequest& rReq, sal_Bool bLabel) pFirstFlyFmt = bLabel ? lcl_InsertLabText( *pSh, rItem, *pFmt, *pFldMgr, static_cast< sal_uInt16 >(rItem.nCol - 1), - static_cast< sal_uInt16 >(rItem.nRow - 1), sal_True, sal_False ) : + static_cast< sal_uInt16 >(rItem.nRow - 1), sal_True ) : lcl_InsertBCText(*pSh, rItem, *pFmt, static_cast< sal_uInt16 >(rItem.nCol - 1), - static_cast< sal_uInt16 >(rItem.nRow - 1), sal_False); + static_cast< sal_uInt16 >(rItem.nRow - 1)); } //fill the user fields diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx index eada5cc81b4d..5fde0e5d0d78 100644 --- a/sw/source/ui/dbui/dbmgr.cxx +++ b/sw/source/ui/dbui/dbmgr.cxx @@ -2395,13 +2395,13 @@ void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh, rtl::OUString sDataSource, sDataTableOrQuery; Sequence<Any> aSelection; - sal_Int16 nCmdType = CommandType::TABLE; + sal_Int32 nCmdType = CommandType::TABLE; uno::Reference< XConnection> xConnection; ODataAccessDescriptor aDescriptor(rProperties); sDataSource = aDescriptor.getDataSource(); - aDescriptor[daCommand] >>= sDataTableOrQuery; - aDescriptor[daCommandType] >>= nCmdType; + OSL_VERIFY(aDescriptor[daCommand] >>= sDataTableOrQuery); + OSL_VERIFY(aDescriptor[daCommandType] >>= nCmdType); if ( aDescriptor.has(daSelection) ) aDescriptor[daSelection] >>= aSelection; diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index 43c167211eeb..69e524dd93b6 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -404,6 +404,13 @@ SwXTextDocument::~SwXTextDocument() xNumFmtAgg = 0; } delete m_pPrintUIOptions; + if (m_pRenderData && m_pRenderData->IsViewOptionAdjust()) + { // rhbz#827695: this can happen if the last page is not printed + // the ViewShell has been deleted already by SwView::~SwView + // FIXME: replace this awful implementation of XRenderable with + // something less insane that has its own view + m_pRenderData->ViewOptionAdjustCrashPreventionKludge(); + } delete m_pRenderData; } @@ -3856,14 +3863,17 @@ void SwXDocumentPropertyHelper::onChange() SwViewOptionAdjust_Impl::SwViewOptionAdjust_Impl( ViewShell& rSh, const SwViewOption &rViewOptions) - : m_rShell( rSh ) + : m_pShell(&rSh) , m_aOldViewOptions( rViewOptions ) { } SwViewOptionAdjust_Impl::~SwViewOptionAdjust_Impl() { - m_rShell.ApplyViewOptions( m_aOldViewOptions ); + if (m_pShell) + { + m_pShell->ApplyViewOptions( m_aOldViewOptions ); + } } void @@ -3871,14 +3881,14 @@ SwViewOptionAdjust_Impl::AdjustViewOptions(SwPrintData const*const pPrtOptions) { // to avoid unnecessary reformatting the view options related to the content // below should only change if necessary, that is if respective content is present - const bool bContainsHiddenChars = m_rShell.GetDoc()->ContainsHiddenChars(); - const SwFieldType* pFldType = m_rShell.GetDoc()->GetSysFldType( RES_HIDDENTXTFLD ); + const bool bContainsHiddenChars = m_pShell->GetDoc()->ContainsHiddenChars(); + const SwFieldType* pFldType = m_pShell->GetDoc()->GetSysFldType( RES_HIDDENTXTFLD ); const bool bContainsHiddenFields = pFldType && pFldType->GetDepends(); - pFldType = m_rShell.GetDoc()->GetSysFldType( RES_HIDDENPARAFLD ); + pFldType = m_pShell->GetDoc()->GetSysFldType( RES_HIDDENPARAFLD ); const bool bContainsHiddenParagraphs = pFldType && pFldType->GetDepends(); - pFldType = m_rShell.GetDoc()->GetSysFldType( RES_JUMPEDITFLD ); + pFldType = m_pShell->GetDoc()->GetSysFldType( RES_JUMPEDITFLD ); const bool bContainsPlaceHolders = pFldType && pFldType->GetDepends(); - const bool bContainsFields = m_rShell.IsAnyFieldInDoc(); + const bool bContainsFields = m_pShell->IsAnyFieldInDoc(); SwViewOption aRenderViewOptions( m_aOldViewOptions ); @@ -3918,7 +3928,7 @@ SwViewOptionAdjust_Impl::AdjustViewOptions(SwPrintData const*const pPrtOptions) if (m_aOldViewOptions != aRenderViewOptions) // check if reformatting is necessary { aRenderViewOptions.SetPrinting( pPrtOptions != NULL ); - m_rShell.ApplyViewOptions( aRenderViewOptions ); + m_pShell->ApplyViewOptions( aRenderViewOptions ); } } |