summaryrefslogtreecommitdiff
path: root/sw/source/core
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core')
-rw-r--r--sw/source/core/doc/doc.cxx2
-rw-r--r--sw/source/core/layout/trvlfrm.cxx92
-rw-r--r--sw/source/core/text/portxt.cxx2
-rw-r--r--sw/source/core/txtnode/fntcap.cxx2
-rw-r--r--sw/source/core/view/viewsh.cxx28
-rw-r--r--sw/source/core/view/vnew.cxx2
6 files changed, 70 insertions, 58 deletions
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index a031aa86098f..7c4e1984b819 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -1947,7 +1947,7 @@ void SwDoc::ResetModified()
mbModified = sal_False;
// If there is already a document statistic, we assume that
// it is correct. In this case we reset the modified flag.
- if ( 0 != pDocStat->nChar )
+ if ( 0 != pDocStat->nCharExcludingSpaces )
pDocStat->bModified = sal_False;
GetIDocumentUndoRedo().SetUndoNoModifiedPosition();
if( nCall && aOle2Link.IsSet() )
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index 2673082d5468..17b9a29ee78b 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -162,63 +162,63 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
aPoint.Y() = Min( aPoint.Y(), Frm().Bottom() );
}
- //Wenn kein Cntnt unterhalb der Seite 'antwortet', so korrigieren
- //wir den StartPoint und fangen nochmal eine Seite vor der
- //aktuellen an. Mit Flys ist es dann allerdings vorbei.
- if ( SwLayoutFrm::GetCrsrOfst( pPos, aPoint, pCMS ) )
- bRet = sal_True;
- else
+ //Koennte ein Freifliegender gemeint sein?
+ //Wenn sein Inhalt geschuetzt werden soll, so ist nix mit Crsr
+ //hineinsetzen, dadurch sollten alle Aenderungen unmoeglich sein.
+ if ( GetSortedObjs() )
{
- if ( pCMS && (pCMS->bStop || pCMS->bExactOnly) )
+ SwOrderIter aIter( this );
+ aIter.Top();
+ while ( aIter() )
{
- ((SwCrsrMoveState*)pCMS)->bStop = sal_True;
- return sal_False;
- }
- const SwCntntFrm *pCnt = GetCntntPos( aPoint, sal_False, sal_False, sal_False, pCMS, sal_False );
- if ( pCMS && pCMS->bStop )
- return sal_False;
-
- OSL_ENSURE( pCnt, "Crsr is gone to a Black hole" );
- if( pCMS && pCMS->pFill && pCnt->IsTxtFrm() )
- bRet = pCnt->GetCrsrOfst( pPos, rPoint, pCMS );
- else
- bRet = pCnt->GetCrsrOfst( pPos, aPoint, pCMS );
+ const SwVirtFlyDrawObj* pObj =
+ static_cast<const SwVirtFlyDrawObj*>(aIter());
+ const SwFlyFrm* pFly = pObj ? pObj->GetFlyFrm() : 0;
+ if ( pFly &&
+ ( ( pCMS ? pCMS->bSetInReadOnly : sal_False ) ||
+ !pFly->IsProtected() ) &&
+ pFly->GetCrsrOfst( pPos, aPoint, pCMS ) )
+ {
+ bRet = sal_True;
+ break;
+ }
- if ( !bRet )
- {
- // Set point to pCnt, delete mark
- // this may happen, if pCnt is hidden
- *pPos = SwPosition( *pCnt->GetNode(), SwIndex( (SwTxtNode*)pCnt->GetNode(), 0 ) );
- bRet = sal_True;
+ if ( pCMS && pCMS->bStop )
+ return sal_False;
+ aIter.Prev();
}
}
if ( !bRet )
{
- //Koennte ein Freifliegender gemeint sein?
- //Wenn sein Inhalt geschuetzt werden soll, so ist nix mit Crsr
- //hineinsetzen, dadurch sollten alle Aenderungen unmoeglich sein.
- if ( GetSortedObjs() )
+ //Wenn kein Cntnt unterhalb der Seite 'antwortet', so korrigieren
+ //wir den StartPoint und fangen nochmal eine Seite vor der
+ //aktuellen an. Mit Flys ist es dann allerdings vorbei.
+ if ( SwLayoutFrm::GetCrsrOfst( pPos, aPoint, pCMS ) )
+ bRet = sal_True;
+ else
{
- SwOrderIter aIter( this );
- aIter.Top();
- while ( aIter() )
+ if ( pCMS && (pCMS->bStop || pCMS->bExactOnly) )
{
- const SwVirtFlyDrawObj* pObj =
- static_cast<const SwVirtFlyDrawObj*>(aIter());
- const SwFlyFrm* pFly = pObj ? pObj->GetFlyFrm() : 0;
- if ( pFly &&
- ( ( pCMS ? pCMS->bSetInReadOnly : sal_False ) ||
- !pFly->IsProtected() ) &&
- pFly->GetCrsrOfst( pPos, aPoint, pCMS ) )
- {
- bRet = sal_True;
- break;
- }
+ ((SwCrsrMoveState*)pCMS)->bStop = sal_True;
+ return sal_False;
+ }
+ const SwCntntFrm *pCnt = GetCntntPos( aPoint, sal_False, sal_False, sal_False, pCMS, sal_False );
+ if ( pCMS && pCMS->bStop )
+ return sal_False;
- if ( pCMS && pCMS->bStop )
- return sal_False;
- aIter.Prev();
+ OSL_ENSURE( pCnt, "Crsr is gone to a Black hole" );
+ if( pCMS && pCMS->pFill && pCnt->IsTxtFrm() )
+ bRet = pCnt->GetCrsrOfst( pPos, rPoint, pCMS );
+ else
+ bRet = pCnt->GetCrsrOfst( pPos, aPoint, pCMS );
+
+ if ( !bRet )
+ {
+ // Set point to pCnt, delete mark
+ // this may happen, if pCnt is hidden
+ *pPos = SwPosition( *pCnt->GetNode(), SwIndex( (SwTxtNode*)pCnt->GetNode(), 0 ) );
+ bRet = sal_True;
}
}
}
diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index a84ccb6b52de..c72c22fb02f9 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -820,7 +820,7 @@ void SwFieldFormPortion::Paint( const SwTxtPaintInfo& rInf ) const
{
if ( pBM->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMCHECKBOX ) ) )
{ // a checkbox...
- ICheckboxFieldmark* pCheckboxFm = reinterpret_cast< ICheckboxFieldmark* >(pBM);
+ ICheckboxFieldmark* pCheckboxFm = dynamic_cast< ICheckboxFieldmark* >(pBM);
bool checked = pCheckboxFm->IsChecked();
rInf.DrawCheckBox(*this, checked);
}
diff --git a/sw/source/core/txtnode/fntcap.cxx b/sw/source/core/txtnode/fntcap.cxx
index 8a40614a3d93..5696984a7dce 100644
--- a/sw/source/core/txtnode/fntcap.cxx
+++ b/sw/source/core/txtnode/fntcap.cxx
@@ -623,7 +623,7 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo )
pBigFont = pLastFont;
// Hier entsteht der Kleinbuchstabenfont:
- aFont.SetProportion( sal_uInt8 (aFont.GetPropr() * SMALL_CAPS_PERCENTAGE ) / 100L);
+ aFont.SetProportion( (aFont.GetPropr() * SMALL_CAPS_PERCENTAGE ) / 100L );
pMagic2 = NULL;
nIndex2 = 0;
SwFntAccess *pSmallFontAccess = new SwFntAccess( pMagic2, nIndex2, &aFont,
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 797ed01a3287..e328e369e696 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -98,7 +98,7 @@ using namespace ::com::sun::star;
//////////////////////////////////////////////////////////////////////////////
// #i72754# 2nd set of Pre/PostPaints
-// This time it uses the lock counter mnPrePostPaintCount to allow only one activation
+// This time it uses the lock counter (mPrePostPaintRegions empty/non-empty) to allow only one activation
// and deactivation and mpPrePostOutDev to remember the OutDev from the BeginDrawLayers
// call. That way, all places where paint take place can be handled the same way, even
// when calling other paint methods. This is the case at the places where SW paints
@@ -116,8 +116,9 @@ void ViewShell::PrePaint()
void ViewShell::DLPrePaint2(const Region& rRegion)
{
- if(0L == mnPrePostPaintCount)
+ if(mPrePostPaintRegions.empty())
{
+ mPrePostPaintRegions.push( rRegion );
// #i75172# ensure DrawView to use DrawingLayer bufferings
if ( !HasDrawView() )
MakeDrawView();
@@ -139,16 +140,29 @@ void ViewShell::DLPrePaint2(const Region& rRegion)
// remember original paint MapMode for wrapped FlyFrame paints
maPrePostMapMode = pOut->GetMapMode();
}
-
- mnPrePostPaintCount++;
+ else
+ {
+ // region needs to be updated to the given one
+ if( mPrePostPaintRegions.top() != rRegion )
+ Imp()->GetDrawView()->UpdateDrawLayersRegion(mpPrePostOutDev, rRegion);
+ mPrePostPaintRegions.push( rRegion );
+ }
}
void ViewShell::DLPostPaint2(bool bPaintFormLayer)
{
- OSL_ENSURE(mnPrePostPaintCount > 0L, "ViewShell::DLPostPaint2: Pre/PostPaint encapsulation broken (!)");
- mnPrePostPaintCount--;
+ OSL_ENSURE(!mPrePostPaintRegions.empty(), "ViewShell::DLPostPaint2: Pre/PostPaint encapsulation broken (!)");
- if((0L == mnPrePostPaintCount) && (0 != mpTargetPaintWindow))
+ if( mPrePostPaintRegions.size() > 1 )
+ {
+ Region current = mPrePostPaintRegions.top();
+ mPrePostPaintRegions.pop();
+ if( current != mPrePostPaintRegions.top())
+ Imp()->GetDrawView()->UpdateDrawLayersRegion(mpPrePostOutDev, mPrePostPaintRegions.top());
+ return;
+ }
+ mPrePostPaintRegions.pop(); // clear
+ if(0 != mpTargetPaintWindow)
{
// #i74769# restore buffered OutDev
if(mpTargetPaintWindow->GetPreRenderDevice())
diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx
index 668a9028d36a..7b51f53b9df3 100644
--- a/sw/source/core/view/vnew.cxx
+++ b/sw/source/core/view/vnew.cxx
@@ -158,7 +158,6 @@ ViewShell::ViewShell( SwDoc& rDocument, Window *pWindow,
pDoc( &rDocument ),
nStartAction( 0 ),
nLockPaint( 0 ),
- mnPrePostPaintCount(0L),
mpPrePostOutDev(0),
maPrePostMapMode()
{
@@ -226,7 +225,6 @@ ViewShell::ViewShell( ViewShell& rShell, Window *pWindow,
pDoc( rShell.GetDoc() ),
nStartAction( 0 ),
nLockPaint( 0 ),
- mnPrePostPaintCount(0L),
mpPrePostOutDev(0),
maPrePostMapMode()
{