diff options
author | Jan Holesovsky <kendy@suse.cz> | 2011-05-31 10:45:59 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2011-05-31 10:45:59 +0200 |
commit | 31d2ec14ca3790748cf0c724f14f494cce7dff4f (patch) | |
tree | 074e3fcfbb3609f15c6f3dbb82f98d2bf35839df | |
parent | 6803462fb620eb350923148a2c10c3223266e97f (diff) | |
parent | c8deddfb2e3aa3d00c2b3321e41de79b526b7c2f (diff) |
Merge commit 'libreoffice-3.4.0.2'
Conflicts:
sw/inc/viewsh.hxx
sw/source/core/layout/paintfrm.cxx
sw/source/ui/index/cnttab.cxx
sw/source/ui/ribbar/inputwin.cxx
44 files changed, 427 insertions, 350 deletions
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx index ea015a242661..1aa56358693d 100644 --- a/starmath/source/parse.cxx +++ b/starmath/source/parse.cxx @@ -2513,11 +2513,15 @@ const SmErrorDesc *SmParser::PrevError() } -const SmErrorDesc *SmParser::GetError(size_t i) +const SmErrorDesc *SmParser::GetError(size_t i) { - return ( i < m_aErrDescList.size() ) - ? m_aErrDescList[ i ] - : m_aErrDescList[ m_nCurError ]; + if ( i < m_aErrDescList.size() ) + return m_aErrDescList[ i ]; + + if ( (size_t)m_nCurError < m_aErrDescList.size() ) + return m_aErrDescList[ m_nCurError ]; + + return NULL; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx index a59a6cd6866e..5feb33085334 100644 --- a/sw/inc/fesh.hxx +++ b/sw/inc/fesh.hxx @@ -410,7 +410,8 @@ public: // Else the size is provided via GetCurFlyRect(). virtual void CalcAndSetScale( svt::EmbeddedObjectRef& xObj, const SwRect *pFlyPrtRect = 0, - const SwRect *pFlyFrmRect = 0 ) = 0; + const SwRect *pFlyFrmRect = 0, + const bool bNoTxtFrmPrtAreaChanged = false ) = 0; // Connect objects with ActivateWhenVisible at Paint. // Called by notxtfrm::Paint, implemented in wrtsh. diff --git a/sw/inc/rcid.hrc b/sw/inc/rcid.hrc index 82be306b0cb7..7bf40c39cb17 100644 --- a/sw/inc/rcid.hrc +++ b/sw/inc/rcid.hrc @@ -103,7 +103,7 @@ // Page frame #define RC_PAGEFRM_BEGIN RC_PAGEFRM -#define RC_PAGEFRM_EN (RC_PAGEFRM + 99) +#define RC_PAGEFRM_END (RC_PAGEFRM + 99) // SW/Web #define RC_WEB_BEGIN RC_WEB diff --git a/sw/inc/section.hxx b/sw/inc/section.hxx index 80cabb722e01..9a6452a424fd 100644 --- a/sw/inc/section.hxx +++ b/sw/inc/section.hxx @@ -36,6 +36,7 @@ #include <tools/rtti.hxx> #include <tools/ref.hxx> #include <svl/svarray.hxx> +#include <svl/smplhint.hxx> #include <sfx2/lnkbase.hxx> #include <sfx2/Metadatable.hxx> @@ -267,6 +268,28 @@ public: }; +/** Hint used to notify the deletion of SwSectionFrm objects with or without + keeping the content of the frame #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 }; diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx index ed52818918cd..733fb9115915 100644 --- a/sw/source/core/crsr/bookmrk.cxx +++ b/sw/source/core/crsr/bookmrk.cxx @@ -84,7 +84,8 @@ namespace rStart.nNode.GetNode().GetTxtNode(); SwTxtNode const*const pEndTxtNode = rEnd.nNode.GetNode().GetTxtNode(); const sal_Unicode ch_start=pStartTxtNode->GetTxt().GetChar(rStart.nContent.GetIndex()); - xub_StrLen nEndPos = rEnd == rStart ? rEnd.nContent.GetIndex() : rEnd.nContent.GetIndex() - 1; + xub_StrLen nEndPos = ( rEnd == rStart || rEnd.nContent.GetIndex() == 0 ) ? + rEnd.nContent.GetIndex() : rEnd.nContent.GetIndex() - 1; const sal_Unicode ch_end=pEndTxtNode->GetTxt().GetChar( nEndPos ); SwPaM aStartPaM(rStart); SwPaM aEndPaM(rEnd); diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx index ffe388320610..845cf6f1ce24 100644 --- a/sw/source/core/doc/doccomp.cxx +++ b/sw/source/core/doc/doccomp.cxx @@ -606,8 +606,8 @@ Compare::MovedData::MovedData( CompareData& rData, sal_Char* pDiscard ) Compare::MovedData::~MovedData() { - delete pIndex; - delete pLineNum; + delete [] pIndex; + delete [] pLineNum; } // Suche die verschobenen Lines @@ -626,7 +626,7 @@ Compare::CompareSequence::CompareSequence( Compare::CompareSequence::~CompareSequence() { - delete pMemory; + delete [] pMemory; } void Compare::CompareSequence::Compare( sal_uLong nStt1, sal_uLong nEnd1, diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index ea65f1bc3b3f..0aa12b6862ac 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -816,6 +816,12 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons if( pGrfNd ) { + // Fix for bug #33781 + if (pShell->Imp()->GetDrawView()->IsAntiAliasing()) + { + pOut->SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW ); + } + sal_Bool bForceSwap = sal_False, bContinue = sal_True; GraphicObject& rGrfObj = pGrfNd->GetGrfObj(); diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx index 64b6b82c326d..3e7086bcdc13 100644 --- a/sw/source/core/doc/poolfmt.cxx +++ b/sw/source/core/doc/poolfmt.cxx @@ -1307,7 +1307,7 @@ SwFmt* SwDoc::GetFmtFromPool( sal_uInt16 nId ) aSet.Put( SwFmtAnchor( FLY_AT_PARA )); aSet.Put( SwFmtHoriOrient( 0, text::HoriOrientation::CENTER, text::RelOrientation::FRAME )); aSet.Put( SwFmtVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME )); - aSet.Put( SwFmtSurround( SURROUND_NONE )); + aSet.Put( SwFmtSurround( SURROUND_IDEAL )); } break; case RES_POOLFRM_FORMEL: diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx index e2a4158e4ff8..50555660c6e0 100644 --- a/sw/source/core/docnode/ndsect.cxx +++ b/sw/source/core/docnode/ndsect.cxx @@ -1065,7 +1065,8 @@ 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 ) ); + // 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 ) { diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx index 745b6bfecb7f..9a18ae44db88 100644 --- a/sw/source/core/docnode/section.cxx +++ b/sw/source/core/docnode/section.cxx @@ -685,7 +685,8 @@ SwSectionFmt::~SwSectionFmt() } } // mba: test iteration; objects are removed while iterating - CallSwClientNotify( SfxSimpleHint(SFX_HINT_DYING) ); + // 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() ); @@ -715,7 +716,8 @@ void SwSectionFmt::DelFrms() { // First delete the <SwSectionFrm> of the <SwSectionFmt> instance // mba: test iteration as objects are removed in iteration - CallSwClientNotify( SfxSimpleHint(SFX_HINT_DYING) ); + // 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 ); diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index beddcfe7b736..f464b41a615a 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -2791,9 +2791,13 @@ long SwFEShell::GetSectionWidth( SwFmt& rFmt ) const while( pSect ); } SwIterator<SwSectionFrm,SwFmt> aIter( rFmt ); - for ( SwSectionFrm* pSct = aIter.First(); pFrm; pFrm = aIter.Next() ) - if( !pSct->IsFollow() ) - return pSct->Frm().Width(); + for ( SwSectionFrm* pSct = aIter.First(); pSct; pSct = aIter.Next() ) + { + if( !pSct->IsFollow() ) + { + return pSct->Frm().Width(); + } + } return 0; } diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx index 0cc9898089b6..ba1b0f43d539 100644 --- a/sw/source/core/inc/frmtool.hxx +++ b/sw/source/core/inc/frmtool.hxx @@ -72,7 +72,7 @@ void MA_FASTCALL DrawGraphic( const SvxBrushItem *, OutputDevice *, // - method to align rectangle // Created declaration here to avoid <extern> declarations -void MA_FASTCALL SwAlignRect( SwRect &rRect, ViewShell *pSh ); +void MA_FASTCALL SwAlignRect( SwRect &rRect, const ViewShell *pSh ); // - method to align graphic rectangle // Created declaration here to avoid <extern> declarations diff --git a/sw/source/core/inc/pagefrm.hrc b/sw/source/core/inc/pagefrm.hrc index 302ba9a76b16..b8f89e091c15 100644 --- a/sw/source/core/inc/pagefrm.hrc +++ b/sw/source/core/inc/pagefrm.hrc @@ -31,13 +31,11 @@ #include "rcid.hrc" // Bitmaps for page shadow -#define BMP_PAGE_RIGHT_SHADOW_MASK RC_PAGEFRM_BEGIN + 0 -#define BMP_PAGE_BOTTOM_RIGHT_SHADOW_MASK RC_PAGEFRM_BEGIN + 1 -#define BMP_PAGE_BOTTOM_SHADOW_MASK RC_PAGEFRM_BEGIN + 2 +#define BMP_PAGE_SHADOW_MASK RC_PAGEFRM_BEGIN + 0 // If you add resources, don't forget to update this -#define PAGEFRM_ACT_END BMP_PAGE_BOTTOMLEFT_SHADOW +#define PAGEFRM_ACT_END BMP_PAGE_SHADOW_MASK // Sanity check #if PAGEFRM_ACT_END > RC_PAGEFRM_END diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx index 92b11aed27ea..1fb456dea39d 100644 --- a/sw/source/core/inc/pagefrm.hxx +++ b/sw/source/core/inc/pagefrm.hxx @@ -95,29 +95,7 @@ class SwPageFrm: public SwFtnBossFrm // Anpassen der max. Fussnotenhoehen in den einzelnen Spalten void SetColMaxFtnHeight(); - /** determine rectangle for right page shadow - - #i9719# - - @param _rPageRect - input parameter - constant instance reference of the page rectangle. - Generally, it's the frame area of the page, but for empty pages in print - preview, this parameter is useful. - - @param _pViewShell - input parameter - instance of the view shell, for which the rectangle - has to be generated. - - @param _orRightShadowRect - output parameter - instance reference of the right shadow rectangle for - the given page rectangle - */ - static void GetRightShadowRect( const SwRect& _rPageRect, - ViewShell* _pViewShell, - SwRect& _orRightShadowRect, - bool bRightSidebar ); - - /** determine rectangle for bottom page shadow + /** determine rectangle for horizontal page shadow #i9719# @@ -135,10 +113,11 @@ class SwPageFrm: public SwFtnBossFrm the given page rectangle */ - static void GetBottomShadowRect( const SwRect& _rPageRect, - ViewShell* _pViewShell, + static void GetHorizontalShadowRect( const SwRect& _rPageRect, + const ViewShell* _pViewShell, SwRect& _orBottomShadowRect, - bool bFullBottomShadow, + bool bPaintLeftShadow, + bool bPaintRightShadow, bool bRightSidebar ); /** adds the sidebar used for notes to right and left border @@ -193,6 +172,8 @@ public: inline const SwCntntFrm *FindFirstBodyCntnt() const; inline const SwCntntFrm *FindLastBodyCntnt() const; + SwRect GetBoundRect() const; + //Spezialisiertes GetCntntPos() fuer Felder in Rahmen. void GetCntntPosition( const Point &rPt, SwPosition &rPos ) const; @@ -267,6 +248,8 @@ public: inline void ValidateWordCount() const; inline sal_Bool IsInvalid() const; inline sal_Bool IsInvalidFly() const; + sal_Bool IsRightShadowNeeded() const; + sal_Bool IsLeftShadowNeeded() const; sal_Bool IsInvalidFlyLayout() const { return bInvalidFlyLayout; } sal_Bool IsInvalidFlyCntnt() const { return bInvalidFlyCntnt; } sal_Bool IsInvalidFlyInCnt() const { return bInvalidFlyInCnt; } @@ -328,9 +311,9 @@ public: shadow with & position). */ static void PaintBorderAndShadow( const SwRect& _rPageRect, - ViewShell* _pViewShell, + const ViewShell* _pViewShell, + bool bPaintLeftShadow, bool bPaintRightShadow, - bool bFullBottomShadow, bool bRightSidebar ); /** get bound rectangle of border and shadow for repaints @@ -351,9 +334,12 @@ public: rectangle for the given page rectangle */ static void GetBorderAndShadowBoundRect( const SwRect& _rPageRect, - ViewShell* _pViewShell, + const ViewShell* _pViewShell, SwRect& _orBorderAndShadowBoundRect, - const bool bRightSidebar ); + const bool bLeftShadow, + const bool bRightShadow, + const bool bRightSidebar + ); static void PaintNotesSidebar(const SwRect& _rPageRect, ViewShell* _pViewShell, sal_uInt16 nPageNum, bool bRight); static void PaintNotesSidebarArrows(const Point &aMiddleFirst, const Point &aMiddleSecond, ViewShell* _pViewShell, const Color aColorUp, const Color aColorDown); diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index 1bb33aa7b800..8207d182868e 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -872,6 +872,10 @@ SwCntntNotify::~SwCntntNotify() (pNd->GetOLEObj().IsOleRef() || pNd->IsOLESizeInvalid()) ) { + const bool bNoTxtFrmPrtAreaChanged = + ( aPrt.SSize().Width() != 0 && + aPrt.SSize().Height() != 0 ) && + aPrt.SSize() != pCnt->Prt().SSize(); OSL_ENSURE( pCnt->IsInFly(), "OLE not in FlyFrm" ); SwFlyFrm *pFly = pCnt->FindFlyFrm(); svt::EmbeddedObjectRef& xObj = pNd->GetOLEObj().GetObject(); @@ -898,7 +902,9 @@ SwCntntNotify::~SwCntntNotify() // uiview/view.cxx. if ( !pNd->IsOLESizeInvalid() && !pSh->GetDoc()->IsUpdateExpFld() ) - pFESh->CalcAndSetScale( xObj, &pFly->Prt(), &pFly->Frm()); + pFESh->CalcAndSetScale( xObj, + &pFly->Prt(), &pFly->Frm(), + bNoTxtFrmPrtAreaChanged ); } pTmp = (ViewShell*)pTmp->GetNext(); } while ( pTmp != pSh ); diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index 1b592588e242..e1289c2dc2ea 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -1385,9 +1385,15 @@ sal_Bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, sal_Bool bAddRect ) if ( pLay->GetPrev() && !pLay->GetPrev()->IsValid() ) pLay->GetPrev()->SetCompletePaint(); - SwRect aOldRect( pLay->Frm() ); + SwRect aOldFrame( pLay->Frm() ); + SwRect aOldRect( aOldFrame ); + if( pLay->IsPageFrm() ) + { + aOldRect = static_cast<SwPageFrm*>(pLay)->GetBoundRect(); + } + pLay->Calc(); - if ( aOldRect != pLay->Frm() ) + if ( aOldFrame != pLay->Frm() ) bChanged = sal_True; sal_Bool bNoPaint = sal_False; @@ -1410,30 +1416,7 @@ sal_Bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, sal_Bool bAddRect ) if ( pLay->IsPageFrm() ) { SwPageFrm* pPageFrm = static_cast<SwPageFrm*>(pLay); - const int nShadowWidth = - pImp->GetShell()->GetOut()->PixelToLogic( Size( pPageFrm->ShadowPxWidth(), 0 ) ).Width(); - - //mod #i6193# added sidebar width - const SwPostItMgr* pPostItMgr = pImp->GetShell()->GetPostItMgr(); - const int nSidebarWidth = pPostItMgr && pPostItMgr->HasNotes() && pPostItMgr->ShowNotes() ? pPostItMgr->GetSidebarWidth() + pPostItMgr->GetSidebarBorderWidth() : 0; - switch ( pPageFrm->SidebarPosition() ) - { - case sw::sidebarwindows::SIDEBAR_LEFT: - { - aPaint.Left( aPaint.Left() - nSidebarWidth); - aPaint.Right( aPaint.Right() + nShadowWidth); - } - break; - case sw::sidebarwindows::SIDEBAR_RIGHT: - { - aPaint.Right( aPaint.Right() + nShadowWidth + nSidebarWidth); - } - break; - case sw::sidebarwindows::SIDEBAR_NONE: - // nothing to do - break; - } - aPaint.Bottom( aPaint.Bottom() + nShadowWidth ); + aPaint = pPageFrm->GetBoundRect(); } sal_Bool bPageInBrowseMode = pLay->IsPageFrm(); @@ -1485,38 +1468,50 @@ sal_Bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, sal_Bool bAddRect ) const bool bLeftToRightViewLayout = pRoot->IsLeftToRightViewLayout(); const bool bPrev = bLeftToRightViewLayout ? pLay->GetPrev() : pLay->GetNext(); const bool bNext = bLeftToRightViewLayout ? pLay->GetNext() : pLay->GetPrev(); + SwPageFrm* pPageFrm = static_cast<SwPageFrm*>(pLay); + const ViewShell *pSh = pLay->getRootFrm()->GetCurrShell(); + SwRect aPageRect( pLay->Frm() ); + + if(pSh) + { + SwPageFrm::GetBorderAndShadowBoundRect(aPageRect, pSh, + aPageRect, pPageFrm->IsLeftShadowNeeded(), pPageFrm->IsRightShadowNeeded(), + pPageFrm->SidebarPosition() == sw::sidebarwindows::SIDEBAR_RIGHT); + } if ( bPrev ) { // top - SwRect aSpaceToPrevPage( pLay->Frm() ); - const SwTwips nTop = aSpaceToPrevPage.Top() - nHalfDocBorder; - if ( nTop >= 0 ) - aSpaceToPrevPage.Top( nTop ); + SwRect aSpaceToPrevPage( aPageRect ); + aSpaceToPrevPage.Top( aSpaceToPrevPage.Top() - nHalfDocBorder ); aSpaceToPrevPage.Bottom( pLay->Frm().Top() ); - pImp->GetShell()->AddPaintRect( aSpaceToPrevPage ); + if(aSpaceToPrevPage.Height() > 0 && aSpaceToPrevPage.Width() > 0) + pImp->GetShell()->AddPaintRect( aSpaceToPrevPage ); + + pSh->GetOut()->DrawRect( aSpaceToPrevPage.SVRect() ); // left - aSpaceToPrevPage = pLay->Frm(); - const SwTwips nLeft = aSpaceToPrevPage.Left() - nHalfDocBorder; - if ( nLeft >= 0 ) - aSpaceToPrevPage.Left( nLeft ); + aSpaceToPrevPage = aPageRect; + aSpaceToPrevPage.Left( aSpaceToPrevPage.Left() - nHalfDocBorder ); aSpaceToPrevPage.Right( pLay->Frm().Left() ); - pImp->GetShell()->AddPaintRect( aSpaceToPrevPage ); + if(aSpaceToPrevPage.Height() > 0 && aSpaceToPrevPage.Width() > 0) + pImp->GetShell()->AddPaintRect( aSpaceToPrevPage ); } if ( bNext ) { // bottom - SwRect aSpaceToNextPage( pLay->Frm() ); + SwRect aSpaceToNextPage( aPageRect ); aSpaceToNextPage.Bottom( aSpaceToNextPage.Bottom() + nHalfDocBorder ); aSpaceToNextPage.Top( pLay->Frm().Bottom() ); - pImp->GetShell()->AddPaintRect( aSpaceToNextPage ); + if(aSpaceToNextPage.Height() > 0 && aSpaceToNextPage.Width() > 0) + pImp->GetShell()->AddPaintRect( aSpaceToNextPage ); // right - aSpaceToNextPage = pLay->Frm(); + aSpaceToNextPage = aPageRect; aSpaceToNextPage.Right( aSpaceToNextPage.Right() + nHalfDocBorder ); aSpaceToNextPage.Left( pLay->Frm().Right() ); - pImp->GetShell()->AddPaintRect( aSpaceToNextPage ); + if(aSpaceToNextPage.Height() > 0 && aSpaceToNextPage.Width() > 0) + pImp->GetShell()->AddPaintRect( aSpaceToNextPage ); } } } @@ -1571,12 +1566,14 @@ sal_Bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, sal_Bool bAddRect ) // OD 11.11.2002 #104414# - add complete frame area as paint area, if frame // area has been already added and after formating its lowers the frame area // is enlarged. + SwRect aBoundRect(pLay->IsPageFrm() ? static_cast<SwPageFrm*>(pLay)->GetBoundRect() : pLay->Frm() ); + if ( bAlreadyPainted && - ( pLay->Frm().Width() > aFrmAtCompletePaint.Width() || - pLay->Frm().Height() > aFrmAtCompletePaint.Height() ) + ( aBoundRect.Width() > aFrmAtCompletePaint.Width() || + aBoundRect.Height() > aFrmAtCompletePaint.Height() ) ) { - pImp->GetShell()->AddPaintRect( pLay->Frm() ); + pImp->GetShell()->AddPaintRect( aBoundRect ); } return bChanged || bTabChanged; } diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx index 105e7aff1bdc..98444b46b739 100644 --- a/sw/source/core/layout/newfrm.cxx +++ b/sw/source/core/layout/newfrm.cxx @@ -605,7 +605,8 @@ SwRootFrm::~SwRootFrm() pTurbo = 0; if(pBlink) pBlink->FrmDelete( this ); - static_cast<SwFrmFmt*>(GetRegisteredInNonConst())->GetDoc()->DelFrmFmt( static_cast<SwFrmFmt*>(GetRegisteredInNonConst()) ); + if ( static_cast<SwFrmFmt*>(GetRegisteredInNonConst()) ) + static_cast<SwFrmFmt*>(GetRegisteredInNonConst())->GetDoc()->DelFrmFmt( static_cast<SwFrmFmt*>(GetRegisteredInNonConst()) ); delete pDestroy; pDestroy = 0; diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index eb3dd733e678..38ed77b112b0 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -296,7 +296,7 @@ SwPageFrm::~SwPageFrm() //Damit der Zugriff auf zerstoerte Seiten verhindert werden kann. if ( !IsEmptyPage() ) //#59184# sollte fuer Leerseiten unnoetig sein. { - SwDoc *pDoc = GetFmt()->GetDoc(); + SwDoc *pDoc = GetFmt() ? GetFmt()->GetDoc() : NULL; if( pDoc && !pDoc->IsInDtor() ) { ViewShell *pSh = getRootFrm()->GetCurrShell(); @@ -310,7 +310,7 @@ SwPageFrm::~SwPageFrm() // including border and shadow area. const bool bRightSidebar = (SidebarPosition() == sw::sidebarwindows::SIDEBAR_RIGHT); SwRect aRetoucheRect; - SwPageFrm::GetBorderAndShadowBoundRect( Frm(), pSh, aRetoucheRect, bRightSidebar ); + SwPageFrm::GetBorderAndShadowBoundRect( Frm(), pSh, aRetoucheRect, IsLeftShadowNeeded(), IsRightShadowNeeded(), bRightSidebar ); pSh->AddPaintRect( aRetoucheRect ); } } @@ -673,7 +673,8 @@ void SwPageFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew, // page frame for determine 'old' rectangle - it's used for invalidating. const bool bRightSidebar = (SidebarPosition() == sw::sidebarwindows::SIDEBAR_RIGHT); SwRect aOldRectWithBorderAndShadow; - SwPageFrm::GetBorderAndShadowBoundRect( aOldPageFrmRect, pSh, aOldRectWithBorderAndShadow, bRightSidebar ); + SwPageFrm::GetBorderAndShadowBoundRect( aOldPageFrmRect, pSh, aOldRectWithBorderAndShadow, + IsLeftShadowNeeded(), IsRightShadowNeeded(), bRightSidebar ); pSh->InvalidateWindows( aOldRectWithBorderAndShadow ); } rInvFlags |= 0x03; @@ -862,7 +863,8 @@ void AdjustSizeChgNotify( SwRootFrm *pRoot ) if( pRoot == pSh->GetLayout() ) { pSh->SizeChgNotify(); - pSh->Imp()->NotifySizeChg( pRoot->Frm().SSize() ); + if ( pSh->Imp() ) + pSh->Imp()->NotifySizeChg( pRoot->Frm().SSize() ); } pSh = (ViewShell*)pSh->GetNext(); } while ( pSh != pRoot->GetCurrShell() ); diff --git a/sw/source/core/layout/pagefrm.src b/sw/source/core/layout/pagefrm.src index 83b80e4714f9..1c5cafc38c4d 100644 --- a/sw/source/core/layout/pagefrm.src +++ b/sw/source/core/layout/pagefrm.src @@ -1,17 +1,7 @@ #include "pagefrm.hrc" -Bitmap BMP_PAGE_RIGHT_SHADOW_MASK +Bitmap BMP_PAGE_SHADOW_MASK { - File = "page-right-shadow-mask.png"; -}; - -Bitmap BMP_PAGE_BOTTOM_RIGHT_SHADOW_MASK -{ - File = "page-bottomright-shadow-mask.png"; -}; - -Bitmap BMP_PAGE_BOTTOM_SHADOW_MASK -{ - File = "page-bottom-shadow-mask.png"; + File = "page-shadow-mask.png"; }; diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index c7f7e393ec6a..92fe53d6a723 100755 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -109,6 +109,7 @@ #include <drawinglayer/processor2d/baseprocessor2d.hxx> #include <drawinglayer/primitive2d/polygonprimitive2d.hxx> #include <drawinglayer/primitive2d/borderlineprimitive2d.hxx> +#include <drawinglayer/primitive2d/discreteshadowprimitive2d.hxx> #include <svx/sdr/contact/objectcontacttools.hxx> #include <svx/unoapi.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> @@ -1038,7 +1039,7 @@ void SwSubsRects::PaintSubsidiary( OutputDevice *pOut, // OD 29.04.2003 #107169# - correction: adjust rectangle on pixel level in order // to assure, that the border 'leaves its original pixel', if it has to. // No prior adjustments for odd relation between pixel and twip. -void MA_FASTCALL SwAlignRect( SwRect &rRect, ViewShell *pSh ) +void MA_FASTCALL SwAlignRect( SwRect &rRect, const ViewShell *pSh ) { if( !rRect.HasArea() ) return; @@ -2873,8 +2874,6 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const if ( bBookMode && pPage->GetPrev() && static_cast<const SwPageFrm*>(pPage->GetPrev())->IsEmptyPage() ) pPage = static_cast<const SwPageFrm*>(pPage->GetPrev()); - const bool bLTR = IsLeftToRightViewLayout(); - // #i68597# const bool bGridPainting(pSh->GetWin() && pSh->Imp()->HasDrawView() && pSh->Imp()->GetDrawView()->IsGridVisible()); @@ -2883,22 +2882,15 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const while ( pPage ) { - // Paint right shadow in single page mode, or if we're on last page of - // the doc, or if ???Lower()??? or if we're on a page with no right - // sibling (OnRightPage should be renamed as OnEvenPage since it does - // not take reading direction into account) - const bool bPaintRightShadow = !bBookMode || (!pPage->GetNext()) || (pPage == Lower()) || (!bLTR && !pPage->OnRightPage()) || (bLTR && pPage->OnRightPage()); - // Have a full bottom shadow on side by side pages. - // TODO Do not draw full shadow if our sibling hasn't the - // same orientation - const bool bFullBottomShadow = bBookMode && pPage->GetPrev() && - ((!bLTR && !pPage->OnRightPage()) || (bLTR && pPage->OnRightPage())); + const bool bPaintRightShadow = pPage->IsRightShadowNeeded(); + const bool bPaintLeftShadow = pPage->IsLeftShadowNeeded(); const bool bRightSidebar = pPage->SidebarPosition() == sw::sidebarwindows::SIDEBAR_RIGHT; if ( !pPage->IsEmptyPage() ) { SwRect aPaintRect; - SwPageFrm::GetBorderAndShadowBoundRect( pPage->Frm(), pSh, aPaintRect, bRightSidebar ); + SwPageFrm::GetBorderAndShadowBoundRect( pPage->Frm(), pSh, aPaintRect, + bPaintLeftShadow, bPaintRightShadow, bRightSidebar ); if ( aRect.IsOver( aPaintRect ) ) { @@ -2993,7 +2985,7 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const if( pSh->GetWin() && pSh->GetDoc()->GetDocShell() && !pSh->GetDoc()->GetDocShell()->IsInPlaceActive() ) { - SwPageFrm::PaintBorderAndShadow( pPage->Frm(), pSh, bPaintRightShadow, bFullBottomShadow, bRightSidebar ); + SwPageFrm::PaintBorderAndShadow( pPage->Frm(), pSh, bPaintLeftShadow, bPaintRightShadow, bRightSidebar ); SwPageFrm::PaintNotesSidebar( pPage->Frm(), pSh, pPage->GetPhyPageNum(), bRightSidebar); } @@ -3049,7 +3041,8 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const const SwPageFrm& rFormatPage = pPage->GetFormatPage(); aEmptyPageRect.SSize() = rFormatPage.Frm().SSize(); - SwPageFrm::GetBorderAndShadowBoundRect( aEmptyPageRect, pSh, aPaintRect, bRightSidebar ); + SwPageFrm::GetBorderAndShadowBoundRect( aEmptyPageRect, pSh, aPaintRect, + bPaintLeftShadow, bPaintRightShadow, bRightSidebar ); aPaintRect._Intersection( aRect ); if ( aRect.IsOver( aEmptyPageRect ) ) @@ -3088,7 +3081,7 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const // paint shadow and border for empty page // OD 19.02.2003 #107369# - use new method to paint page border and // shadow - SwPageFrm::PaintBorderAndShadow( aEmptyPageRect, pSh, bPaintRightShadow, bFullBottomShadow, bRightSidebar ); + SwPageFrm::PaintBorderAndShadow( aEmptyPageRect, pSh, bPaintLeftShadow, bPaintRightShadow, bRightSidebar ); SwPageFrm::PaintNotesSidebar( aEmptyPageRect, pSh, pPage->GetPhyPageNum(), bRightSidebar); { @@ -5241,35 +5234,31 @@ void SwPageFrm::PaintMarginArea( const SwRect& _rOutputRect, } } -const sal_Int8 SwPageFrm::mnShadowPxWidth = 10; - -/** determine rectangle for right page shadow - - OD 12.02.2003 for #i9719# and #105645# +const sal_Int8 SwPageFrm::mnShadowPxWidth = 9; - @author OD -*/ -/*static*/ void SwPageFrm::GetRightShadowRect( const SwRect& _rPageRect, - ViewShell* _pViewShell, - SwRect& _orRightShadowRect, - bool bRightSidebar ) +sal_Bool SwPageFrm::IsRightShadowNeeded() const { - SwRect aAlignedPageRect( _rPageRect ); - ::SwAlignRect( aAlignedPageRect, _pViewShell ); - SwRect aPagePxRect = - _pViewShell->GetOut()->LogicToPixel( aAlignedPageRect.SVRect() ); - const SwPostItMgr *pMgr = _pViewShell ? _pViewShell->GetPostItMgr() : 0; + const ViewShell *pSh = getRootFrm()->GetCurrShell(); + const bool bIsLTR = getRootFrm()->IsLeftToRightViewLayout(); - _orRightShadowRect.Chg( - Point( aPagePxRect.Right() + 1, aPagePxRect.Top() + mnShadowPxWidth + 1 ), - Size( mnShadowPxWidth, aPagePxRect.Height() - mnShadowPxWidth - 1 ) ); + // We paint the right shadow if we're not in book mode + // or if we've no sibling or are the last page of the "row" + return !pSh || (!pSh->GetViewOptions()->IsViewLayoutBookMode()) || !GetNext() + || (this == Lower()) || (bIsLTR && OnRightPage()) + || (!bIsLTR && !OnRightPage()); - if (bRightSidebar && pMgr && pMgr->ShowNotes() && pMgr->HasNotes()) - { - _orRightShadowRect.Pos(_orRightShadowRect.Left() + pMgr->GetSidebarWidth(true) - + pMgr->GetSidebarBorderWidth(true), _orRightShadowRect.Top()); - } +} +sal_Bool SwPageFrm::IsLeftShadowNeeded() const +{ + const ViewShell *pSh = getRootFrm()->GetCurrShell(); + const bool bIsLTR = getRootFrm()->IsLeftToRightViewLayout(); + + // We paint the left shadow if we're not in book mode + // or if we've no sibling or are the last page of the "row" + return !pSh || (!pSh->GetViewOptions()->IsViewLayoutBookMode()) || !GetPrev() + || (bIsLTR && !OnRightPage()) + || (!bIsLTR && OnRightPage()); } /** determine rectangle for bottom page shadow @@ -5278,10 +5267,11 @@ const sal_Int8 SwPageFrm::mnShadowPxWidth = 10; @author OD */ -/*static*/ void SwPageFrm::GetBottomShadowRect( const SwRect& _rPageRect, - ViewShell* _pViewShell, - SwRect& _orBottomShadowRect, - bool bFullBottomShadow, +/*static*/ void SwPageFrm::GetHorizontalShadowRect( const SwRect& _rPageRect, + const ViewShell* _pViewShell, + SwRect& _orHorizontalShadowRect, + bool bPaintLeftShadow, + bool bPaintRightShadow, bool bRightSidebar ) { const SwPostItMgr *pMgr = _pViewShell ? _pViewShell->GetPostItMgr() : 0; @@ -5290,21 +5280,21 @@ const sal_Int8 SwPageFrm::mnShadowPxWidth = 10; SwRect aPagePxRect = _pViewShell->GetOut()->LogicToPixel( aAlignedPageRect.SVRect() ); - // Shadow is shifted when not full - long lShadowAdjustment = (bFullBottomShadow ? 0 : 1 + mnShadowPxWidth); + long lShadowAdjustment = mnShadowPxWidth - 1; // TODO extract this - _orBottomShadowRect.Chg( - Point( aPagePxRect.Left() + lShadowAdjustment, aPagePxRect.Bottom() + 1 ), - Size( aPagePxRect.Width() - lShadowAdjustment, mnShadowPxWidth ) ); + _orHorizontalShadowRect.Chg( + Point( aPagePxRect.Left() + (bPaintLeftShadow ? lShadowAdjustment : 0), 0 ), + Size( aPagePxRect.Width() - ( (bPaintLeftShadow ? lShadowAdjustment : 0) + (bPaintRightShadow ? lShadowAdjustment : 0) ), + mnShadowPxWidth ) ); if(pMgr && pMgr->ShowNotes() && pMgr->HasNotes()) { // Notes are displayed, we've to extend borders SwTwips aSidebarTotalWidth = pMgr->GetSidebarWidth(true) + pMgr->GetSidebarBorderWidth(true); if(bRightSidebar) - _orBottomShadowRect.Right( _orBottomShadowRect.Right() + aSidebarTotalWidth ); + _orHorizontalShadowRect.Right( _orHorizontalShadowRect.Right() + aSidebarTotalWidth ); else - _orBottomShadowRect.Left( _orBottomShadowRect.Left() - aSidebarTotalWidth ); + _orHorizontalShadowRect.Left( _orHorizontalShadowRect.Left() - aSidebarTotalWidth ); } } @@ -5316,9 +5306,9 @@ const sal_Int8 SwPageFrm::mnShadowPxWidth = 10; @author OD */ /*static*/ void SwPageFrm::PaintBorderAndShadow( const SwRect& _rPageRect, - ViewShell* _pViewShell, + const ViewShell* _pViewShell, + bool bPaintLeftShadow, bool bPaintRightShadow, - bool bFullBottomShadow, bool bRightSidebar ) { // No shadow in prefs @@ -5327,60 +5317,102 @@ const sal_Int8 SwPageFrm::mnShadowPxWidth = 10; // #i16816# tagged pdf support SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, 0, *_pViewShell->GetOut() ); + static drawinglayer::primitive2d::DiscreteShadow shadowMask( SW_RES( BMP_PAGE_SHADOW_MASK ) ); static BitmapEx aPageTopRightShadow; static BitmapEx aPageBottomRightShadow; static BitmapEx aPageBottomLeftShadow; static BitmapEx aPageBottomShadowBase; static BitmapEx aPageRightShadowBase; - static Color aShadowColor; + static BitmapEx aPageTopShadowBase; + static BitmapEx aPageTopLeftShadow; + static BitmapEx aPageLeftShadowBase; + static Color aShadowColor( COL_AUTO ); + + SwRect aAlignedPageRect( _rPageRect ); + ::SwAlignRect( aAlignedPageRect, _pViewShell ); + SwRect aPagePxRect = + _pViewShell->GetOut()->LogicToPixel( aAlignedPageRect.SVRect() ); if(aShadowColor != SwViewOption::GetShadowColor() ) { aShadowColor = SwViewOption::GetShadowColor(); - AlphaMask aMask( SW_RES( BMP_PAGE_BOTTOM_RIGHT_SHADOW_MASK ) ); - Bitmap aFilledSquare( Size( mnShadowPxWidth, mnShadowPxWidth ), 24 ); - aFilledSquare.Erase( aShadowColor ); + AlphaMask aMask( shadowMask.getBottomRight().GetBitmap() ); + Bitmap aFilledSquare( aMask.GetSizePixel(), 24 ); + aFilledSquare.Erase( aShadowColor ); aPageBottomRightShadow = BitmapEx( aFilledSquare, aMask ); - aMask.Rotate( 900, 255 ); - aPageTopRightShadow = BitmapEx( aFilledSquare, aMask ); - aMask.Rotate( 1800, 255); + + aMask = AlphaMask( shadowMask.getBottomLeft().GetBitmap() ); + aFilledSquare = Bitmap( aMask.GetSizePixel(), 24 ); + aFilledSquare.Erase( aShadowColor ); aPageBottomLeftShadow = BitmapEx( aFilledSquare, aMask ); - aFilledSquare = Bitmap( Size( 1, mnShadowPxWidth ), 24 ); + aMask = AlphaMask( shadowMask.getBottom().GetBitmap() ); + aFilledSquare = Bitmap( aMask.GetSizePixel(), 24 ); aFilledSquare.Erase( aShadowColor ); - aMask = Bitmap( SW_RES( BMP_PAGE_BOTTOM_SHADOW_MASK ) ); aPageBottomShadowBase = BitmapEx( aFilledSquare, aMask ); - aFilledSquare = Bitmap( Size( mnShadowPxWidth, 1 ), 24 ); + aMask = AlphaMask( shadowMask.getTop().GetBitmap() ); + aFilledSquare = Bitmap( aMask.GetSizePixel(), 24 ); + aFilledSquare.Erase( aShadowColor ); + aPageTopShadowBase = BitmapEx( aFilledSquare, aMask ); + + aMask = AlphaMask( shadowMask.getTopRight().GetBitmap() ); + aFilledSquare = Bitmap( aMask.GetSizePixel(), 24 ); + aFilledSquare.Erase( aShadowColor ); + aPageTopRightShadow = BitmapEx( aFilledSquare, aMask ); + + aMask = AlphaMask( shadowMask.getRight().GetBitmap() ); + aFilledSquare = Bitmap( aMask.GetSizePixel(), 24 ); aFilledSquare.Erase( aShadowColor ); - aMask = Bitmap( SW_RES( BMP_PAGE_RIGHT_SHADOW_MASK ) ); aPageRightShadowBase = BitmapEx( aFilledSquare, aMask ); + + aMask = AlphaMask( shadowMask.getTopLeft().GetBitmap() ); + aFilledSquare = Bitmap( aMask.GetSizePixel(), 24 ); + aFilledSquare.Erase( aShadowColor ); + aPageTopLeftShadow = BitmapEx( aFilledSquare, aMask ); + + aMask = AlphaMask( shadowMask.getLeft().GetBitmap() ); + aFilledSquare = Bitmap( aMask.GetSizePixel(), 24 ); + aFilledSquare.Erase( aShadowColor ); + aPageLeftShadowBase = BitmapEx( aFilledSquare, aMask ); } SwRect aPaintRect; OutputDevice *pOut = _pViewShell->GetOut(); - // paint right shadow + SwPageFrm::GetHorizontalShadowRect( _rPageRect, _pViewShell, aPaintRect, bPaintLeftShadow, bPaintRightShadow, bRightSidebar ); + + // Right shadow & corners if ( bPaintRightShadow ) { - SwPageFrm::GetRightShadowRect( _rPageRect, _pViewShell, aPaintRect, bRightSidebar ); + pOut->DrawBitmapEx( pOut->PixelToLogic( Point( aPaintRect.Right() + 1, aPagePxRect.Bottom() + 1 - (aPageBottomRightShadow.GetSizePixel().Height() - mnShadowPxWidth) ) ), + aPageBottomRightShadow ); + pOut->DrawBitmapEx( pOut->PixelToLogic( Point( aPaintRect.Right() + 1, aPagePxRect.Top() - mnShadowPxWidth ) ), + aPageTopRightShadow ); BitmapEx aPageRightShadow = aPageRightShadowBase; - aPageRightShadow.Scale( 1, aPaintRect.Height() ); - pOut->DrawBitmapEx( pOut->PixelToLogic( aPaintRect.Pos() ), aPageRightShadow ); - pOut->DrawBitmapEx( pOut->PixelToLogic( Point( aPaintRect.Left(), aPaintRect.Top() - mnShadowPxWidth ) ), aPageTopRightShadow ); - pOut->DrawBitmapEx( pOut->PixelToLogic( aPaintRect.BottomLeft() ), aPageBottomRightShadow ); + aPageRightShadow.Scale( 1, aPagePxRect.Height() - 2 * (mnShadowPxWidth - 1) ); + pOut->DrawBitmapEx( pOut->PixelToLogic( Point( aPaintRect.Right() + mnShadowPxWidth, aPagePxRect.Top() + mnShadowPxWidth - 1) ), aPageRightShadow ); } - // paint bottom shadow - SwPageFrm::GetBottomShadowRect( _rPageRect, _pViewShell, aPaintRect, bFullBottomShadow, bRightSidebar ); - if(!bFullBottomShadow) + // Left shadows and corners + if(bPaintLeftShadow) { - pOut->DrawBitmapEx( pOut->PixelToLogic( Point( aPaintRect.Left() - mnShadowPxWidth, aPaintRect.Top() ) ), aPageBottomLeftShadow ); + const long lLeft = aPaintRect.Left() - aPageBottomLeftShadow.GetSizePixel().Width(); + pOut->DrawBitmapEx( pOut->PixelToLogic( Point( lLeft, + aPagePxRect.Bottom() + 1 + mnShadowPxWidth - aPageBottomLeftShadow.GetSizePixel().Height() ) ), aPageBottomLeftShadow ); + pOut->DrawBitmapEx( pOut->PixelToLogic( Point( lLeft, aPagePxRect.Top() - mnShadowPxWidth ) ), aPageTopLeftShadow ); + BitmapEx aPageLeftShadow = aPageLeftShadowBase; + aPageLeftShadow.Scale( 1, aPagePxRect.Height() - 2 * (mnShadowPxWidth - 1) ); + pOut->DrawBitmapEx( pOut->PixelToLogic( Point( lLeft, aPagePxRect.Top() + mnShadowPxWidth - 1) ), aPageLeftShadow ); } + BitmapEx aPageBottomShadow = aPageBottomShadowBase; aPageBottomShadow.Scale( aPaintRect.Width(), 1 ); - pOut->DrawBitmapEx( pOut->PixelToLogic( aPaintRect.Pos() ), aPageBottomShadow); + pOut->DrawBitmapEx( pOut->PixelToLogic( Point( aPaintRect.Left(), aPagePxRect.Bottom() + 1 ) ), aPageBottomShadow); + BitmapEx aPageTopShadow = aPageTopShadowBase; + aPageTopShadow.Scale( aPaintRect.Width(), 1 ); + pOut->DrawBitmapEx( pOut->PixelToLogic( Point( aPaintRect.Left(), aPagePxRect.Top() - mnShadowPxWidth ) ), aPageTopShadow ); } //mod #i6193# paint sidebar for notes @@ -5507,28 +5539,47 @@ const sal_Int8 SwPageFrm::mnShadowPxWidth = 10; author OD */ /*static*/ void SwPageFrm::GetBorderAndShadowBoundRect( const SwRect& _rPageRect, - ViewShell* _pViewShell, + const ViewShell* _pViewShell, SwRect& _orBorderAndShadowBoundRect, - bool bRightSidebar ) + bool bLeftShadow, + bool bRightShadow, + bool bRightSidebar + ) { SwRect aAlignedPageRect( _rPageRect ); ::SwAlignRect( aAlignedPageRect, _pViewShell ); SwRect aPagePxRect = _pViewShell->GetOut()->LogicToPixel( aAlignedPageRect.SVRect() ); + aPagePxRect.Bottom( aPagePxRect.Bottom() + mnShadowPxWidth + 1 ); + aPagePxRect.Top( aPagePxRect.Top() - mnShadowPxWidth - 1 ); SwRect aTmpRect; - SwPageFrm::GetRightShadowRect( _rPageRect, _pViewShell, aTmpRect, bRightSidebar ); - aPagePxRect.Right( aTmpRect.Right() ); + // Always ask for full shadow since we want a bounding rect + // including at least the page frame + SwPageFrm::GetHorizontalShadowRect( _rPageRect, _pViewShell, aTmpRect, false, false, bRightSidebar ); - // Always ask for full shadow - SwPageFrm::GetBottomShadowRect( _rPageRect, _pViewShell, aTmpRect, true, bRightSidebar ); - aPagePxRect.Bottom( aTmpRect.Bottom() ); - aPagePxRect.Left( aTmpRect.Left() ); + if(bLeftShadow) aPagePxRect.Left( aTmpRect.Left() - mnShadowPxWidth - 1); + if(bRightShadow) aPagePxRect.Right( aTmpRect.Right() + mnShadowPxWidth + 1); _orBorderAndShadowBoundRect = _pViewShell->GetOut()->PixelToLogic( aPagePxRect.SVRect() ); } +SwRect SwPageFrm::GetBoundRect() const +{ + const ViewShell *pSh = getRootFrm()->GetCurrShell(); + SwRect aPageRect( Frm() ); + SwRect aResult; + + if(!pSh) { + return SwRect( Point(0, 0), Size(0, 0) ); + } + + SwPageFrm::GetBorderAndShadowBoundRect( aPageRect, pSh, aResult, + IsLeftShadowNeeded(), IsRightShadowNeeded(), SidebarPosition() == sw::sidebarwindows::SIDEBAR_RIGHT ); + return aResult; +} + /*static*/ void SwPageFrm::AddSidebarBorders(SwRect &aRect, ViewShell* _pViewShell, bool bRightSidebar, bool bPx) { const SwPostItMgr *pMgr = _pViewShell ? _pViewShell->GetPostItMgr() : 0; @@ -5784,13 +5835,12 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage, { SwBorderAttrAccess aAccess( SwFrm::GetCache(), (SwFrm*)pFrm ); const SwBorderAttrs &rTmpAttrs = *aAccess.Get(); - /// OD 06.08.2002 #99657# - paint border before painting background - if ( bLowerBorder ) - pFrm->PaintBorder( aBorderRect, pPage, rTmpAttrs ); if ( ( pFrm->IsLayoutFrm() && bLowerBorder ) || aFrmRect.IsOver( aRect ) ) pFrm->PaintBackground( aRect, pPage, rTmpAttrs, bLowMode, bLowerBorder ); + if ( bLowerBorder ) + pFrm->PaintBorder( aBorderRect, pPage, rTmpAttrs ); } pFrm = pFrm->GetNext(); } while ( pFrm && pFrm->GetUpper() == this && diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx index 324893981db8..7347f0644d24 100644 --- a/sw/source/core/layout/sectfrm.cxx +++ b/sw/source/core/layout/sectfrm.cxx @@ -2429,10 +2429,13 @@ void SwSectionFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew ) 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() ) + // #i117863#: The hint needs to indicate whether to keep the SwSectionFrm + // content or not. + 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() ); } } diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index dd847477892d..d2ba1cb48d42 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -2557,6 +2557,7 @@ sal_uLong SwTableBox::IsValidNumTxtNd( sal_Bool bCheckAttr ) const // Flys/Felder/.. if( pHts ) { + xub_StrLen nNextSetField = 0; for( sal_uInt16 n = 0; n < pHts->Count(); ++n ) { const SwTxtAttr* pAttr = (*pHts)[ n ]; @@ -2564,11 +2565,21 @@ sal_uLong SwTableBox::IsValidNumTxtNd( sal_Bool bCheckAttr ) const *pAttr->GetStart() || *pAttr->GetAnyEnd() < rTxt.Len() ) { - if ( pAttr->Which() == RES_TXTATR_FIELD ) + if ((*pAttr->GetStart() == nNextSetField) && + (pAttr->Which() == RES_TXTATR_FIELD)) { + // #i104949# hideous hack for report builder: + // it inserts hidden variable-set fields at + // the beginning of para in cell, but they + // should not turn cell into text cell const SwField* pField = pAttr->GetFld().GetFld(); - if ( pField && pField->GetTypeId() == TYP_SETFLD ) + if (pField && + (pField->GetTypeId() == TYP_SETFLD) && + (0 != (static_cast<SwSetExpField const*> + (pField)->GetSubType() & + nsSwExtendedSubType::SUB_INVISIBLE))) { + nNextSetField = *pAttr->GetStart() + 1; continue; } } diff --git a/sw/source/core/undo/untblk.cxx b/sw/source/core/undo/untblk.cxx index ca6f3359ab53..1a43a47e4cc6 100644 --- a/sw/source/core/undo/untblk.cxx +++ b/sw/source/core/undo/untblk.cxx @@ -34,6 +34,7 @@ #include <frmfmt.hxx> #include <doc.hxx> #include <IDocumentUndoRedo.hxx> +#include <IShellCursorSupplier.hxx> #include <docary.hxx> #include <swundo.hxx> // fuer die UndoIds #include <pam.hxx> @@ -270,7 +271,7 @@ void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext) void SwUndoInserts::RedoImpl(::sw::UndoRedoContext & rContext) { // setze noch den Cursor auf den Redo-Bereich - SwPaM *const pPam = & AddUndoRedoPaM(rContext); + SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor()); SwDoc* pDoc = pPam->GetDoc(); pPam->DeleteMark(); pPam->GetPoint()->nNode = nSttNode - nNdDiff; diff --git a/sw/source/core/view/pagepreviewlayout.cxx b/sw/source/core/view/pagepreviewlayout.cxx index eae56dde8d50..fc24047a0b91 100644 --- a/sw/source/core/view/pagepreviewlayout.cxx +++ b/sw/source/core/view/pagepreviewlayout.cxx @@ -1073,7 +1073,8 @@ bool SwPagePreviewLayout::Paint( const Rectangle _aOutRect ) const // #i80691# paint page border and shadow { SwRect aPageBorderRect; - SwPageFrm::GetBorderAndShadowBoundRect( SwRect( aPageRect ), &mrParentViewShell, aPageBorderRect, true ); + SwPageFrm::GetBorderAndShadowBoundRect( SwRect( aPageRect ), &mrParentViewShell, aPageBorderRect, + (*aPageIter)->pPage->IsLeftShadowNeeded(), (*aPageIter)->pPage->IsRightShadowNeeded(), true ); const Region aDLRegion(aPageBorderRect.SVRect()); mrParentViewShell.DLPrePaint2(aDLRegion); SwPageFrm::PaintBorderAndShadow( aPageRect, &mrParentViewShell, true, false, true ); diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx index 96cef3170ece..c3ca3f655ae1 100644 --- a/sw/source/core/view/viewimp.cxx +++ b/sw/source/core/view/viewimp.cxx @@ -190,17 +190,17 @@ void SwViewImp::SetFirstVisPage() const bool bBookMode = pSwViewOption->IsViewLayoutBookMode(); SwPageFrm *pPage = (SwPageFrm*)pSh->GetLayout()->Lower(); - SwRect aPageRect = pPage->Frm(); + SwRect aPageRect = pPage->GetBoundRect(); while ( pPage && !aPageRect.IsOver( pSh->VisArea() ) ) { pPage = (SwPageFrm*)pPage->GetNext(); if ( pPage ) { - aPageRect = pPage->Frm(); + aPageRect = pPage->GetBoundRect(); if ( bBookMode && pPage->IsEmptyPage() ) { const SwPageFrm& rFormatPage = pPage->GetFormatPage(); - aPageRect.SSize() = rFormatPage.Frm().SSize(); + aPageRect.SSize() = rFormatPage.GetBoundRect().SSize(); } } } diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index 172434b007e7..b9415531fd95 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -918,7 +918,9 @@ void ViewShell::SetFirstVisPageInvalid() { ViewShell *pSh = this; do - { pSh->Imp()->SetFirstVisPageInvalid(); + { + if ( pSh->Imp() ) + pSh->Imp()->SetFirstVisPageInvalid(); pSh = (ViewShell*)pSh->GetNext(); } while ( pSh != this ); @@ -1005,45 +1007,29 @@ void ViewShell::VisPortChgd( const SwRect &rRect) SwTwips nMinLeft = LONG_MAX; SwTwips nMaxRight= 0; - const SwTwips nSidebarWidth = pPostItMgr && pPostItMgr->ShowNotes() && pPostItMgr->HasNotes() ? - pPostItMgr->GetSidebarWidth() + pPostItMgr->GetSidebarBorderWidth() : - 0; const bool bBookMode = GetViewOptions()->IsViewLayoutBookMode(); while ( pPage && pPage->Frm().Top() <= nBottom ) { - SwRect aPageRect( pPage->Frm() ); + SwRect aPageRect( pPage->GetBoundRect() ); if ( bBookMode ) { const SwPageFrm& rFormatPage = static_cast<const SwPageFrm*>(pPage)->GetFormatPage(); - aPageRect.SSize() = rFormatPage.Frm().SSize(); + aPageRect.SSize() = rFormatPage.GetBoundRect().SSize(); } if ( aPageRect.IsOver( aBoth ) ) { - const SwTwips nShadowWidth = - GetOut()->PixelToLogic( Size( pPage->ShadowPxWidth(), 0 ) ).Width(); - SwTwips nPageLeft = 0; SwTwips nPageRight = 0; - switch ( pPage->SidebarPosition() ) + const sw::sidebarwindows::SidebarPosition aSidebarPos = pPage->SidebarPosition(); + + if( aSidebarPos != sw::sidebarwindows::SIDEBAR_NONE ) { - case sw::sidebarwindows::SIDEBAR_LEFT: - { - nPageLeft = aPageRect.Left() - nSidebarWidth; - nPageRight = aPageRect.Right() + nShadowWidth; - } - break; - case sw::sidebarwindows::SIDEBAR_RIGHT: - { - nPageLeft = aPageRect.Left(); - nPageRight = aPageRect.Right() + nShadowWidth + nSidebarWidth; - } - break; - case sw::sidebarwindows::SIDEBAR_NONE: - // nothing to do - break; + nPageLeft = aPageRect.Left(); + nPageRight = aPageRect.Right(); } + if( nPageLeft < nMinLeft ) nMinLeft = nPageLeft; if( nPageRight > nMaxRight ) diff --git a/sw/source/filter/basflt/fltini.cxx b/sw/source/filter/basflt/fltini.cxx index 17440ac5684d..ac3cb757e71d 100644 --- a/sw/source/filter/basflt/fltini.cxx +++ b/sw/source/filter/basflt/fltini.cxx @@ -819,11 +819,11 @@ extern "C" { static void SAL_CALL thisModule() {} } static oslGenericFunction GetMswordLibSymbol( const char *pSymbol ) { static ::osl::Module aModule; - static sal_Bool bLoaded = sal_False; + static sal_Bool bLoaded = sal_False; static ::rtl::OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "msword" ) ) ); - if (!bLoaded) - bLoaded = SvLibrary::LoadModule( aModule, aLibName, &thisModule ); - if (bLoaded) + if (!bLoaded) + bLoaded = SvLibrary::LoadModule( aModule, aLibName, &thisModule, SAL_LOADMODULE_GLOBAL | SAL_LOADMODULE_LAZY ); + if (bLoaded) return aModule.getFunctionSymbol( ::rtl::OUString::createFromAscii( pSymbol ) ); return NULL; } diff --git a/sw/source/filter/rtf/rtffld.cxx b/sw/source/filter/rtf/rtffld.cxx index 0300efc5277c..4740510faeea 100644 --- a/sw/source/filter/rtf/rtffld.cxx +++ b/sw/source/filter/rtf/rtffld.cxx @@ -1089,6 +1089,9 @@ void SwRTFParser::ReadField() nsSetAttrMode::SETATTR_DONTEXPAND ); pPam->DeleteMark(); + // #i117947#: insert result only once in case + // field result is followed by invalid tokens + sFieldStr.Erase(); } break; } diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index 84a0aefdcf69..e851beaf26a3 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -379,7 +379,7 @@ void DocxExport::OutputEndNode( const SwEndNode& rEndNode ) if ( rNd.IsEndNode() && rNd.StartOfSectionNode()->IsSectionNode() ) return; - if ( !rNd.IsSectionNode() && !bIsInTable ) // No sections in table + if ( !rNd.IsSectionNode() && IsInTable() ) // No sections in table { const SwSectionFmt* pParentFmt = rSect.GetFmt()->GetParent(); if( !pParentFmt ) diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 12a4a46c2251..96e8aa098fff 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -2677,24 +2677,24 @@ void RtfAttributeOutput::FormatULSpace( const SvxULSpaceItem& rULSpace ) HdFtDistanceGlue aDistances( *m_rExport.GetCurItemSet() ); + if( aDistances.dyaTop ) + { + m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_MARGTSXN); + m_aSectionBreaks.append((sal_Int32)aDistances.dyaTop); + } if ( aDistances.HasHeader() ) { - if( aDistances.dyaTop ) - { - m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_MARGTSXN); - m_aSectionBreaks.append((sal_Int32)aDistances.dyaTop); - } m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_HEADERY); m_aSectionBreaks.append((sal_Int32)aDistances.dyaHdrTop); } + if( aDistances.dyaBottom ) + { + m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_MARGBSXN); + m_aSectionBreaks.append((sal_Int32)aDistances.dyaBottom); + } if( aDistances.HasFooter() ) { - if( aDistances.dyaBottom ) - { - m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_MARGBSXN); - m_aSectionBreaks.append((sal_Int32)aDistances.dyaBottom); - } m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_FOOTERY); m_aSectionBreaks.append((sal_Int32)aDistances.dyaHdrBottom); } diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index caf9c9486073..4b6c13f56f7c 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -1744,7 +1744,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode ) AttrOutput().StartParagraph( pTextNodeInfo ); - bool bFlyInTable = mpParentFrame && bIsInTable; + bool bFlyInTable = mpParentFrame && IsInTable(); if ( !bFlyInTable ) nStyleBeforeFly = GetId( lcl_getFormatCollection( *this, &rNode ) ); @@ -2031,7 +2031,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode ) AttrOutput().ParagraphStyle( nStyle ); - if ( mpParentFrame && !bIsInTable ) // Fly-Attrs + if ( mpParentFrame && IsInTable() ) // Fly-Attrs OutputFormat( mpParentFrame->GetFrmFmt(), false, false, true ); if ( pTextNodeInfo.get() != NULL ) @@ -2425,7 +2425,7 @@ void MSWordExportBase::OutputSectionNode( const SwSectionNode& rSectionNode ) SwNodeIndex aIdx( rSectionNode, 1 ); const SwNode& rNd = aIdx.GetNode(); - if ( !rNd.IsSectionNode() && !bIsInTable ) //No sections in table + if ( !rNd.IsSectionNode() && !IsInTable() ) //No sections in table { // Bug 74245 - if the first Node inside the section has an own // PageDesc or PageBreak attribut, then dont write @@ -2575,7 +2575,7 @@ void WW8AttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFmt, const Point if( nStt >= nEnd ) // kein Bereich, also kein gueltiger Node return; - if ( !m_rWW8Export.bIsInTable && rFmt.IsInline() ) + if ( !m_rWW8Export.IsInTable() && rFmt.IsInline() ) { //Test to see if this textbox contains only a single graphic/ole SwTxtNode* pParTxtNode = rAnch.GetCntntAnchor()->nNode.GetNode().GetTxtNode(); @@ -2603,7 +2603,7 @@ void WW8AttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFmt, const Point m_rWW8Export.mpParentFrame = &rFmt; if ( - m_rWW8Export.bIsInTable && + m_rWW8Export.IsInTable() && (FLY_AT_PAGE != rAnch.GetAnchorId()) && !m_rWW8Export.pDoc->GetNodes()[ nStt ]->IsNoTxtNode() ) diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index c7aef6326bc6..4dca080e0867 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -1776,7 +1776,6 @@ void MSWordExportBase::SaveData( sal_uLong nStt, sal_uLong nEnd ) aData.eOldAnchorType = eNewAnchorType; aData.bOldOutTable = bOutTable; - aData.bOldIsInTable = bIsInTable; aData.bOldFlyFrmAttrs = bOutFlyFrmAttrs; aData.bOldStartTOX = bStartTOX; aData.bOldInWriteTOX = bInWriteTOX; @@ -1811,7 +1810,6 @@ void MSWordExportBase::RestoreData() pOrigPam = rData.pOldEnd; bOutTable = rData.bOldOutTable; - bIsInTable = rData.bOldIsInTable; bOutFlyFrmAttrs = rData.bOldFlyFrmAttrs; bStartTOX = rData.bOldStartTOX; bInWriteTOX = rData.bOldInWriteTOX; @@ -2434,7 +2432,7 @@ void WW8Export::SectionBreaksAndFrames( const SwTxtNode& rNode ) OutputSectionBreaks( rNode.GetpSwAttrSet(), rNode ); // all textframes anchored as character for the winword 7- format - if ( !bWrtWW8 && !bIsInTable ) + if ( !bWrtWW8 && !IsInTable() ) OutWW6FlyFrmsInCntnt( rNode ); } @@ -2490,7 +2488,7 @@ void MSWordExportBase::WriteText() ; else if ( aIdx.GetNode().IsSectionNode() ) ; - else if ( !bIsInTable ) //No sections in table + else if ( !IsInTable() ) //No sections in table { ReplaceCr( (char)0xc ); // Indikator fuer Page/Section-Break @@ -2569,6 +2567,28 @@ void WW8Export::WriteMainText() #endif } +bool MSWordExportBase::IsInTable() const +{ + bool bResult = false; + + if (pCurPam != NULL) + { + SwNode * pNode = pCurPam->GetNode(); + + if (pNode != NULL && mpTableInfo.get() != NULL) + { + ww8::WW8TableNodeInfo::Pointer_t pTableNodeInfo = mpTableInfo->getTableNodeInfo(pNode); + + if (pTableNodeInfo.get() != NULL && pTableNodeInfo->getDepth() > 0) + { + bResult = true; + } + } + } + + return bResult; +} + typedef ww8::WW8Sttb< ww8::WW8Struct > WW8SttbAssoc; void WW8Export::WriteFkpPlcUsw() @@ -2873,7 +2893,7 @@ void MSWordExportBase::ExportDocument( bool bWriteAll ) bStyDef = bBreakBefore = bOutKF = bOutFlyFrmAttrs = bOutPageDescs = bOutTable = bOutFirstPage = - bIsInTable = bOutGrf = bInWriteEscher = bStartTOX = + bOutGrf = bInWriteEscher = bStartTOX = bInWriteTOX = false; bFtnAtTxtEnd = bEndAtTxtEnd = true; diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index c4d7f72d85d5..9985f48f2b84 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -538,8 +538,6 @@ public: sal_uInt8 bOutFirstPage : 1; // write Attrset of FirstPageDesc sal_uInt8 bOutTable : 1; // Tabelle wird ausgegeben // ( wird zB bei Flys in Tabelle zurueckgesetzt ) - sal_uInt8 bIsInTable : 1; // wird sind innerhalb der Ausgabe einer Tabelle - // ( wird erst nach der Tabelle zurueckgesetzt ) sal_uInt8 bOutGrf : 1; // Grafik wird ausgegeben sal_uInt8 bInWriteEscher : 1; // in write textboxes sal_uInt8 bStartTOX : 1; // true: a TOX is startet @@ -571,6 +569,9 @@ public: /// Iterate through the nodes and call the appropriate OutputNode() on them. void WriteText(); + /// Return whether cuurently exported node is in table. + bool IsInTable() const; + /// Set the pCurPam appropriately and call WriteText(). /// /// Used to export paragraphs in footnotes/endnotes/etc. diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx index e9cc21d99949..04cd806d4a5c 100644 --- a/sw/source/filter/ww8/wrtww8gr.cxx +++ b/sw/source/filter/ww8/wrtww8gr.cxx @@ -496,7 +496,7 @@ void WW8Export::OutGrf(const sw::Frame &rFrame) // Otherwise, an additional paragraph is exported for a graphic, which is // forced to be treated as inline, because it's anchored inside another frame. if ( !rFrame.IsInline() && - ( ((eAn == FLY_AT_PARA) && ( bWrtWW8 || !bIsInTable )) || + ( ((eAn == FLY_AT_PARA) && ( bWrtWW8 || !IsInTable() )) || (eAn == FLY_AT_PAGE)) ) { WriteChar( (char)0x0d ); // umgebenden Rahmen mit CR abschliessen diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 8d7ec8f21141..2870fd0ddb8f 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -846,8 +846,10 @@ void MSWordExportBase::OutputFormat( const SwFmt& rFmt, bool bPapFmt, bool bChpF } } break; + case RES_FRMFMT: + break; default: - OSL_ENSURE( !this, "Was wird hier ausgegeben ??? " ); + OSL_ENSURE( !this, "Which format is exported here?" ); break; } @@ -1477,7 +1479,7 @@ void WW8AttributeOutput::CharRotate( const SvxCharRotateItem& rRotate ) if ( !rRotate.GetValue() ) return; - if ( m_rWW8Export.bWrtWW8 && !m_rWW8Export.bIsInTable ) + if ( m_rWW8Export.bWrtWW8 && !m_rWW8Export.IsInTable() ) { // #i36867 In word the text in a table is rotated via the TC or NS_sprm::LN_TTextFlow // This means you can only rotate all or none of the text adding NS_sprm::LN_CEastAsianLayout diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index 5bc9d8811d7f..e20db7f54b61 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -1437,6 +1437,16 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC OUString( RTL_CONSTASCII_USTRINGPARAM("SmallCapsPercentage66") ), makeAny( true ) ); } + // Old LO versions had 66 as the value for small caps percentage, later changed to 80. + // In order to keep backwards compatibility, SmallCapsPercentage66 option is written to .odt + // files, and the default for new documents is 'false'. Files without this option + // are considered to be old files, so set the compatibility option too. + if ( !bSmallCapsPercentage66 ) + { + xProps->setPropertyValue( + OUString( RTL_CONSTASCII_USTRINGPARAM("SmallCapsPercentage66") ), makeAny( true ) ); + } + Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY ); Reference < XText > xText = xTextDoc->getText(); Reference<XUnoTunnel> xTextTunnel( xText, UNO_QUERY); diff --git a/sw/source/ui/dialog/swabstdlg.cxx b/sw/source/ui/dialog/swabstdlg.cxx index 1f97f9ddf717..2a3dedd83028 100644 --- a/sw/source/ui/dialog/swabstdlg.cxx +++ b/sw/source/ui/dialog/swabstdlg.cxx @@ -44,7 +44,8 @@ SwAbstractDialogFactory* SwAbstractDialogFactory::Create() SwFuncPtrCreateDialogFactory fp = 0; static ::osl::Module aDialogLibrary; static const ::rtl::OUString sLibName(::vcl::unohelper::CreateLibraryName("swui", sal_True)); - if ( aDialogLibrary.is() || aDialogLibrary.loadRelative( &thisModule, String( sLibName ) ) ) + if ( aDialogLibrary.is() || aDialogLibrary.loadRelative( &thisModule, String( sLibName ), + SAL_LOADMODULE_GLOBAL | SAL_LOADMODULE_LAZY ) ) fp = ( SwAbstractDialogFactory* (__LOADONCALLAPI*)() ) aDialogLibrary.getFunctionSymbol( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CreateDialogFactory"))); if ( fp ) diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx index 517ea8a5f781..010b8e8407c5 100644 --- a/sw/source/ui/frmdlg/column.cxx +++ b/sw/source/ui/frmdlg/column.cxx @@ -449,8 +449,6 @@ SwColumnPage::SwColumnPage(Window *pParent, const SfxItemSet &rSet) aLinePosLbl(this, SW_RES(FT_POSITION)), aLinePosDLB(this, SW_RES(LB_POSITION)), - aVertFL(this, SW_RES(FL_VERT)), - aPropertiesFL( this, SW_RES( FL_PROPERTIES )), aTextDirectionFT( this, SW_RES( FT_TEXTDIRECTION )), aTextDirectionLB( this, SW_RES( LB_TEXTDIRECTION )), @@ -1332,25 +1330,8 @@ void SwColumnPage::SetInSection(sal_Bool bSet) if(!SW_MOD()->GetCTLOptions().IsCTLFontEnabled()) return; - aVertFL.Show(bSet); - aPropertiesFL.Show(bSet); aTextDirectionFT.Show(bSet); aTextDirectionLB.Show(bSet); - if(bSet) - { - //resize line type FixedLine - Point aLtPos = aFLLineType.GetPosPixel(); - Point aPropPos = aPropertiesFL.GetPosPixel(); - Size aSz = aFLLineType.GetSizePixel(); - aSz.Width() = aPropPos.X() - aLtPos.X() - LogicToPixel(Size(8, 8), MAP_APPFONT).Width(); - aFLLineType.SetSizePixel(aSz); - } - else - { - Size aSz = aFLLineType.GetSizePixel(); - aSz.Width() = LogicToPixel(Size(248, 248), MAP_APPFONT).Width(); - aFLLineType.SetSizePixel(aSz); - } } void ColumnValueSet::UserDraw( const UserDrawEvent& rUDEvt ) diff --git a/sw/source/ui/frmdlg/column.hrc b/sw/source/ui/frmdlg/column.hrc index 29c2cc4161eb..9ad30e6673c0 100644 --- a/sw/source/ui/frmdlg/column.hrc +++ b/sw/source/ui/frmdlg/column.hrc @@ -75,10 +75,8 @@ #define PB_CANCEL 56 #define PB_OK 57 #define CB_BALANCECOLS 58 -#define FL_PROPERTIES 59 #define FT_TEXTDIRECTION 60 #define LB_TEXTDIRECTION 61 -#define FL_VERT 62 #define FT_LINEWIDTH 63 #define ED_LINEWIDTH 64 diff --git a/sw/source/ui/frmdlg/column.src b/sw/source/ui/frmdlg/column.src index bfb04c8b939a..89962c3efcbd 100644 --- a/sw/source/ui/frmdlg/column.src +++ b/sw/source/ui/frmdlg/column.src @@ -85,7 +85,7 @@ TabPage TP_COLUMN }; FixedText FT_COLUMN { - Pos = MAP_APPFONT ( 12 , 70 ) ; + Pos = MAP_APPFONT ( 12 , 86 ) ; Size = MAP_APPFONT ( 50 , 8 ) ; Left = TRUE ; Text [ en-US ] = "Column"; @@ -99,28 +99,28 @@ TabPage TP_COLUMN { HelpID = "sw:ImageButton:TP_COLUMN:BTN_DOWN"; Disable = TRUE ; - Pos = MAP_APPFONT ( 62 , 69 ) ; + Pos = MAP_APPFONT ( 62 , 85 ) ; Size = MAP_APPFONT ( 10 , 10 ) ; TabStop = TRUE ; SYMBOL = IMAGEBUTTON_ARROW_LEFT ; }; FixedText FT_1 { - Pos = MAP_APPFONT ( 100 , 71 ) ; + Pos = MAP_APPFONT ( 100 , 87 ) ; Size = MAP_APPFONT ( 10 , 8 ) ; Text = "~1" ; Center = TRUE ; }; FixedText FT_2 { - Pos = MAP_APPFONT ( 150 , 71 ) ; + Pos = MAP_APPFONT ( 150 , 87 ) ; Size = MAP_APPFONT ( 10 , 8 ) ; Text = "~2" ; Center = TRUE ; }; FixedText FT_3 { - Pos = MAP_APPFONT ( 200 , 71 ) ; + Pos = MAP_APPFONT ( 200 , 87 ) ; Size = MAP_APPFONT ( 10 , 8 ) ; Text = "~3" ; Center = TRUE ; @@ -129,14 +129,14 @@ TabPage TP_COLUMN { HelpID = "sw:ImageButton:TP_COLUMN:BTN_UP"; Disable = TRUE ; - Pos = MAP_APPFONT ( 238 , 69 ) ; + Pos = MAP_APPFONT ( 238 , 85 ) ; Size = MAP_APPFONT ( 10 , 10 ) ; TabStop = TRUE ; SYMBOL = IMAGEBUTTON_ARROW_RIGHT ; }; FixedText FT_WIDTH { - Pos = MAP_APPFONT ( 12 , 85 ) ; + Pos = MAP_APPFONT ( 12 , 101 ) ; Size = MAP_APPFONT ( 50 , 8 ) ; Left = TRUE ; Text [ en-US ] = "Width" ; @@ -146,7 +146,7 @@ TabPage TP_COLUMN HelpID = "sw:MetricField:TP_COLUMN:ED_1"; Disable = TRUE ; Border = TRUE ; - Pos = MAP_APPFONT ( 87 , 83 ) ; + Pos = MAP_APPFONT ( 87 , 99 ) ; Size = MAP_APPFONT ( 36 , 12 ) ; TabStop = TRUE ; Left = TRUE ; @@ -165,7 +165,7 @@ TabPage TP_COLUMN HelpID = "sw:MetricField:TP_COLUMN:ED_2"; Disable = TRUE ; Border = TRUE ; - Pos = MAP_APPFONT ( 137 , 83 ) ; + Pos = MAP_APPFONT ( 137 , 99 ) ; Size = MAP_APPFONT ( 36 , 12 ) ; TabStop = TRUE ; Left = TRUE ; @@ -184,7 +184,7 @@ TabPage TP_COLUMN HelpID = "sw:MetricField:TP_COLUMN:ED_3"; Disable = TRUE ; Border = TRUE ; - Pos = MAP_APPFONT ( 187 , 83 ) ; + Pos = MAP_APPFONT ( 187 , 99 ) ; Size = MAP_APPFONT ( 36 , 12 ) ; TabStop = TRUE ; Left = TRUE ; @@ -200,7 +200,7 @@ TabPage TP_COLUMN }; FixedText FT_DIST { - Pos = MAP_APPFONT ( 12 , 101 ) ; + Pos = MAP_APPFONT ( 12 , 117 ) ; Size = MAP_APPFONT ( 50 , 8 ) ; Left = TRUE ; Text [ en-US ] = "Spacing" ; @@ -210,7 +210,7 @@ TabPage TP_COLUMN HelpID = "sw:MetricField:TP_COLUMN:ED_DIST1"; Disable = TRUE ; Border = TRUE ; - Pos = MAP_APPFONT ( 112 , 99 ) ; + Pos = MAP_APPFONT ( 112 , 115 ) ; Size = MAP_APPFONT ( 36 , 12 ) ; TabStop = TRUE ; Left = TRUE ; @@ -229,7 +229,7 @@ TabPage TP_COLUMN HelpID = "sw:MetricField:TP_COLUMN:ED_DIST2"; Disable = TRUE ; Border = TRUE ; - Pos = MAP_APPFONT ( 162 , 99 ) ; + Pos = MAP_APPFONT ( 162 , 115 ) ; Size = MAP_APPFONT ( 36 , 12 ) ; TabStop = TRUE ; Left = TRUE ; @@ -246,45 +246,45 @@ TabPage TP_COLUMN CheckBox CB_AUTO_WIDTH { HelpID = "sw:CheckBox:TP_COLUMN:CB_AUTO_WIDTH"; - Pos = MAP_APPFONT ( 87 , 115 ) ; + Pos = MAP_APPFONT ( 87 , 131 ) ; Size = MAP_APPFONT ( 100 , 10 ) ; Text [ en-US ] = "Auto~Width" ; TabStop = TRUE ; }; FixedLine FL_LAYOUT { - Pos = MAP_APPFONT ( 6 , 58 ) ; + Pos = MAP_APPFONT ( 6 , 74 ) ; Size = MAP_APPFONT ( 248 , 8 ) ; Text [ en-US ] = "Width and spacing"; }; FixedText FT_STYLE { - Pos = MAP_APPFONT ( 12 , 140 ) ; - Size = MAP_APPFONT ( 35 , 8 ) ; + Pos = MAP_APPFONT ( 12 , 156 ) ; + Size = MAP_APPFONT ( 30 , 8 ) ; Text [ en-US ] = "St~yle" ; Left = TRUE ; }; ListBox LB_STYLE { HelpID = "sw:ListBox:TP_COLUMN:LB_STYLE"; - Pos = MAP_APPFONT ( 50 , 138 ) ; - Size = MAP_APPFONT ( 60 , 66 ) ; + Pos = MAP_APPFONT ( 45 , 154 ) ; + Size = MAP_APPFONT ( 40 , 66 ) ; TabStop = TRUE ; DropDown = TRUE ; }; FixedText FT_LINEWIDTH { - Pos = MAP_APPFONT ( 12 , 156 ) ; - Size = MAP_APPFONT ( 35 , 8 ) ; + Pos = MAP_APPFONT ( 12 , 172 ) ; + Size = MAP_APPFONT ( 30 , 8 ) ; Text [ en-US ] = "~Width" ; Left = TRUE ; }; MetricField ED_LINEWIDTH { Border = TRUE ; - Pos = MAP_APPFONT ( 50 , 154 ) ; - Size = MAP_APPFONT ( 60 , 12 ) ; + Pos = MAP_APPFONT ( 45 , 170 ) ; + Size = MAP_APPFONT ( 40 , 12 ) ; TabStop = TRUE ; Spin = TRUE ; Repeat = TRUE ; @@ -298,15 +298,15 @@ TabPage TP_COLUMN }; FixedText FT_COLOR { - Pos = MAP_APPFONT ( 12 , 172 ) ; - Size = MAP_APPFONT ( 35 , 8 ) ; + Pos = MAP_APPFONT ( 165 , 156 ) ; + Size = MAP_APPFONT ( 25 , 8 ) ; Text [ en-US ] = "~Color" ; Left = TRUE ; }; ListBox LB_COLOR { Border = TRUE ; - Pos = MAP_APPFONT ( 50 , 170 ) ; + Pos = MAP_APPFONT ( 193 , 154 ) ; Size = MAP_APPFONT ( 60 , 68 ) ; DropDown = TRUE ; DDExtraWidth = TRUE ; @@ -314,8 +314,8 @@ TabPage TP_COLUMN }; FixedText FT_HEIGHT { - Pos = MAP_APPFONT ( 122 , 140 ) ; - Size = MAP_APPFONT ( 35 , 8 ) ; + Pos = MAP_APPFONT ( 91 , 156 ) ; + Size = MAP_APPFONT ( 30 , 8 ) ; Text [ en-US ] = "H~eight" ; Left = TRUE ; }; @@ -323,8 +323,8 @@ TabPage TP_COLUMN { HelpID = "sw:MetricField:TP_COLUMN:ED_HEIGHT"; Border = TRUE ; - Pos = MAP_APPFONT ( 160 , 138 ) ; - Size = MAP_APPFONT ( 60 , 12 ) ; + Pos = MAP_APPFONT ( 124 , 154 ) ; + Size = MAP_APPFONT ( 35 , 12 ) ; TabStop = TRUE ; Left = TRUE ; Repeat = TRUE ; @@ -339,16 +339,16 @@ TabPage TP_COLUMN }; FixedText FT_POSITION { - Pos = MAP_APPFONT ( 122 , 156 ) ; - Size = MAP_APPFONT ( 35 , 8 ) ; + Pos = MAP_APPFONT ( 91 , 172 ) ; + Size = MAP_APPFONT ( 30 , 8 ) ; Left = TRUE ; Text [ en-US ] = "~Position" ; }; ListBox LB_POSITION { HelpID = "sw:ListBox:TP_COLUMN:LB_POSITION"; - Pos = MAP_APPFONT ( 160 , 154 ) ; - Size = MAP_APPFONT ( 60 , 40 ) ; + Pos = MAP_APPFONT ( 124 , 170 ) ; + Size = MAP_APPFONT ( 35 , 40 ) ; TabStop = TRUE ; DropDown = TRUE ; StringList [ en-US ] = @@ -360,28 +360,14 @@ TabPage TP_COLUMN }; FixedLine FL_LINETYPE { - Pos = MAP_APPFONT ( 6 , 127 ) ; + Pos = MAP_APPFONT ( 6 , 143 ) ; Size = MAP_APPFONT ( 248 , 8 ) ; Text [ en-US ] = "Separator line" ; }; - FixedLine FL_VERT - { - Pos = MAP_APPFONT ( 116 , 138 ) ; - Size = MAP_APPFONT ( 4 , 43 ) ; - Hide = TRUE ; - Vert = TRUE; - }; - FixedLine FL_PROPERTIES - { - Pos = MAP_APPFONT ( 121 , 127 ) ; - Size = MAP_APPFONT ( 133 , 8 ) ; - Hide = TRUE ; - Text [ en-US ] = "Properties"; - }; FixedText FT_TEXTDIRECTION { - Pos = MAP_APPFONT ( 127 , 138 ) ; - Size = MAP_APPFONT ( 127 , 8 ) ; + Pos = MAP_APPFONT ( 12 , 60 ) ; + Size = MAP_APPFONT ( 60 , 8 ) ; Hide = TRUE ; Text [ en-US ] = "Text ~direction"; }; @@ -389,8 +375,8 @@ TabPage TP_COLUMN { HelpID = "sw:ListBox:TP_COLUMN:LB_TEXTDIRECTION"; Border = TRUE ; - Pos = MAP_APPFONT ( 127 , 149 ) ; - Size = MAP_APPFONT ( 127 , 50 ) ; + Pos = MAP_APPFONT ( 75 , 58 ) ; + Size = MAP_APPFONT ( 150 , 50 ) ; DropDown = TRUE ; Hide = TRUE ; StringList [ en-US ] = diff --git a/sw/source/ui/inc/column.hxx b/sw/source/ui/inc/column.hxx index 67c58bebcb3a..b36e0623e719 100644 --- a/sw/source/ui/inc/column.hxx +++ b/sw/source/ui/inc/column.hxx @@ -139,8 +139,6 @@ class SwColumnPage : public SfxTabPage FixedText aLinePosLbl; ListBox aLinePosDLB; - FixedLine aVertFL; - FixedLine aPropertiesFL; FixedText aTextDirectionFT; ListBox aTextDirectionLB; diff --git a/sw/source/ui/inc/wrtsh.hxx b/sw/source/ui/inc/wrtsh.hxx index a6f8fa62a3af..634cd97966c4 100644 --- a/sw/source/ui/inc/wrtsh.hxx +++ b/sw/source/ui/inc/wrtsh.hxx @@ -342,7 +342,8 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)(); virtual void MoveObjectIfActive( svt::EmbeddedObjectRef& xObj, const Point& rOffset ); virtual void CalcAndSetScale( svt::EmbeddedObjectRef& xObj, const SwRect *pFlyPrtRect = 0, - const SwRect *pFlyFrmRect = 0 ); + const SwRect *pFlyFrmRect = 0, + const bool bNoTxtFrmPrtAreaChanged = false ); virtual void ConnectObj( svt::EmbeddedObjectRef& xIPObj, const SwRect &rPrt, const SwRect &rFrm ); diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 5963491e82a5..d5c2838e18ee 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -3185,7 +3185,7 @@ void SwTokenWindow::InsertAtSelection( SwFormToken aTmpToken(TOKEN_TEXT); SwTOXEdit* pEdit = new SwTOXEdit(&aCtrlParentWin, this, aTmpToken); - aControlList.insert(iterInsert, pEdit); + iterInsert = aControlList.insert(iterInsert, pEdit); pEdit->SetText(sRight); pEdit->SetSizePixel(aControlSize); diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx index 1835b3b1443d..97c1ca230b79 100644 --- a/sw/source/ui/wrtsh/wrtsh1.cxx +++ b/sw/source/ui/wrtsh/wrtsh1.cxx @@ -663,8 +663,9 @@ void SwWrtShell::MoveObjectIfActive( svt::EmbeddedObjectRef& xObj, const Point& void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj, - const SwRect *pFlyPrtRect, - const SwRect *pFlyFrmRect ) + const SwRect *pFlyPrtRect, + const SwRect *pFlyFrmRect, + const bool bNoTxtFrmPrtAreaChanged ) { //Einstellen der Skalierung am Client. Diese ergibt sich aus der Differenz //zwischen der VisArea des Objektes und der ObjArea. @@ -745,12 +746,13 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj, SfxInPlaceClient* pCli = GetView().FindIPClient( xObj.GetObject(), &GetView().GetEditWin() ); if ( !pCli ) { - if ( (embed::EmbedMisc::EMBED_ACTIVATEIMMEDIATELY & nMisc) || bLinkingChart + if ( (embed::EmbedMisc::EMBED_ACTIVATEIMMEDIATELY & nMisc) + || bLinkingChart // TODO/LATER: ResizeOnPrinterChange //|| SVOBJ_MISCSTATUS_RESIZEONPRINTERCHANGE & xObj->GetMiscStatus() - || nMisc & embed::EmbedMisc::EMBED_NEVERRESIZE // non-resizable objects need to be - // set the size back by this method - ) + // --> OD #i117189# - refine condition for non-resizable objects + // non-resizable objects need to be set the size back by this method + || ( bNoTxtFrmPrtAreaChanged && nMisc & embed::EmbedMisc::EMBED_NEVERRESIZE ) ) { pCli = new SwOleClient( &GetView(), &GetView().GetEditWin(), xObj ); } |